From 491f5f40591267cab79422649b5dec40f5676ec7 Mon Sep 17 00:00:00 2001 From: bluebin14 <80577827+bluebin14@users.noreply.github.com> Date: Wed, 7 Jul 2021 20:34:12 +0200 Subject: [PATCH 01/47] Darwin BLE: fix length check in advertisement data (#8112) --- src/platform/Darwin/BleConnectionDelegateImpl.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 3ce916d3441f58..52db7e6b6b1881 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -159,7 +159,7 @@ - (void)centralManager:(CBCentralManager *)central NSData * serviceData = [servicesData objectForKey:serviceUUID]; NSUInteger length = [serviceData length]; - if (length == 7) { + if (length >= 7) { const uint8_t * bytes = (const uint8_t *) [serviceData bytes]; uint8_t opCode = bytes[0]; uint16_t discriminator = (bytes[1] | (bytes[2] << 8)) & 0xfff; From 176661fe51ccb145773454a733704884d1c021df Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 7 Jul 2021 23:33:23 +0200 Subject: [PATCH 02/47] Remove unused or redundant helpers from src/app/zap-templates/templates/app/helper.js (#8141) --- .../zap-templates/common/ChipTypesHelper.js | 7 -- src/app/zap-templates/templates/app/helper.js | 87 +++---------------- .../app/im-cluster-command-handler.zapt | 3 - .../CHIP/templates/CHIPClustersObjc-src.zapt | 2 +- .../CHIP/templates/CHIPClustersObjc.zapt | 2 +- 5 files changed, 13 insertions(+), 88 deletions(-) diff --git a/src/app/zap-templates/common/ChipTypesHelper.js b/src/app/zap-templates/common/ChipTypesHelper.js index c0e512bf8a87e3..a674fa785e65a7 100644 --- a/src/app/zap-templates/common/ChipTypesHelper.js +++ b/src/app/zap-templates/common/ChipTypesHelper.js @@ -44,14 +44,7 @@ function asBasicType(type) } } -const signedTypes = [ 'INT8S', 'INT16S', 'INT32S', 'INT64S' ]; -function isSigned(type) -{ - return signedTypes.includes(type); -} - // // Module exports // exports.asBasicType = asBasicType; -exports.isSigned = isSigned; diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 0ddb1deb3fc98a..e008c09f709263 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -16,65 +16,15 @@ */ // Import helpers from zap core -const zapPath = '../../../../../third_party/zap/repo/src-electron/'; -const templateUtil = require(zapPath + 'generator/template-util.js') -const queryEndpoint = require(zapPath + 'db/query-endpoint.js') -const zclHelper = require(zapPath + 'generator/helper-zcl.js') -const zclQuery = require(zapPath + 'db/query-zcl.js') -const cHelper = require(zapPath + 'generator/helper-c.js') +const zapPath = '../../../../../third_party/zap/repo/src-electron/'; +const templateUtil = require(zapPath + 'generator/template-util.js') +const zclHelper = require(zapPath + 'generator/helper-zcl.js') +const zclQuery = require(zapPath + 'db/query-zcl.js') +const cHelper = require(zapPath + 'generator/helper-c.js') const StringHelper = require('../../common/StringHelper.js'); const ChipTypesHelper = require('../../common/ChipTypesHelper.js'); -/** - * Check if the cluster (name) has any enabled manufacturer commands. This works only inside - * cluster block helpers. - * - * @param {*} name : Cluster name - * @param {*} side : Cluster side - * @param {*} options - * @returns True if cluster has enabled commands otherwise false - */ -function user_cluster_has_enabled_manufacturer_command(name, side, options) -{ - return queryEndpoint.selectEndPointTypeIds(this.global.db, this.global.sessionId) - .then((endpointTypes) => zclQuery.exportClustersAndEndpointDetailsFromEndpointTypes(this.global.db, endpointTypes)) - .then((endpointsAndClusters) => zclQuery.exportCommandDetailsFromAllEndpointTypesAndClusters( - this.global.db, endpointsAndClusters)) - .then((endpointCommands) => { - return !!endpointCommands.find(cmd => cmd.mfgCode && zclHelper.isStrEqual(name, cmd.clusterName) - && zclHelper.isCommandAvailable(side, cmd.incoming, cmd.outgoing, cmd.commandSource, cmd.name)); - }) -} - -function asValueIfNotPresent(type, isArray) -{ - if (StringHelper.isString(type) || isArray) { - return 'NULL'; - } - - function fn(pkgId) - { - const options = { 'hash' : {} }; - return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { - switch (zclType) { - case 'uint8_t': - return 'UINT8_MAX'; - case 'uint16_t': - return 'UINT16_MAX'; - case 'uint32_t': - return 'UINT32_MAX'; - default: - error = 'Unhandled underlying type ' + zclType + ' for original type ' + type; - throw error; - } - }) - } - - const promise = templateUtil.ensureZclPackageId(this).then(fn.bind(this)).catch(err => console.log(err)); - return templateUtil.templatePromise(this.global, promise) -} - // TODO Expose the readTypeLength as an additional member field of {{asUnderlyingZclType}} instead // of having to call this method separately. function asReadTypeLength(type) @@ -324,16 +274,6 @@ function asPrintFormat(type) return templateUtil.templatePromise(this.global, promise) } -function isFirstElement(index) -{ - return index == 0; -} - -function isStrEndsWith(str, substr) -{ - return str.endsWith(substr); -} - function asTypeLiteralSuffix(type) { switch (type) { @@ -355,14 +295,9 @@ function asTypeLiteralSuffix(type) // // Module exports // -exports.asPrintFormat = asPrintFormat; -exports.asReadType = asReadType; -exports.asReadTypeLength = asReadTypeLength; -exports.asValueIfNotPresent = asValueIfNotPresent; -exports.isFirstElement = isFirstElement; -exports.user_cluster_has_enabled_manufacturer_command = user_cluster_has_enabled_manufacturer_command; -exports.chip_endpoint_generated_functions = chip_endpoint_generated_functions -exports.chip_endpoint_cluster_list = chip_endpoint_cluster_list -exports.isSigned = ChipTypesHelper.isSigned; -exports.isStrEndsWith = isStrEndsWith; -exports.asTypeLiteralSuffix = asTypeLiteralSuffix; +exports.asPrintFormat = asPrintFormat; +exports.asReadType = asReadType; +exports.asReadTypeLength = asReadTypeLength; +exports.chip_endpoint_generated_functions = chip_endpoint_generated_functions +exports.chip_endpoint_cluster_list = chip_endpoint_cluster_list +exports.asTypeLiteralSuffix = asTypeLiteralSuffix; diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index 73801226a07943..d5b734378581bb 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -37,9 +37,6 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com uint32_t expectArgumentCount = 0; uint32_t currentDecodeTagId = 0; bool wasHandled = false; - {{#if (user_cluster_has_enabled_manufacturer_command name side)}} - {{else}} - {{/if}} { switch (aCommandId) { diff --git a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt index 8d8b4474b8b4d8..7ed35327b674fe 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt @@ -584,7 +584,7 @@ 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}}responseHandler:(ResponseHandler)responseHandler +- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if index includeZero=false}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}responseHandler:(ResponseHandler)responseHandler {{else}} - (void){{asCamelCased name}}:(ResponseHandler)responseHandler {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt index cb7e64c656cea1..4326865455c56d 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt @@ -35,7 +35,7 @@ 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}}responseHandler:(ResponseHandler)responseHandler; +- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if index includeZero=false}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}responseHandler:(ResponseHandler)responseHandler; {{else}} - (void){{asCamelCased name}}:(ResponseHandler)responseHandler; {{/if}} From 24da0a3c24a7101d04fd19b3661924b9821e8c9d Mon Sep 17 00:00:00 2001 From: Song Guo Date: Thu, 8 Jul 2021 05:38:09 +0800 Subject: [PATCH 03/47] [im] Add helper for mapping ember error code to im protocol code (#8131) * Add im error mapping helper * Run codegen --- examples/lighting-app/mbed/CMakeLists.txt | 1 + .../lighting-app/nrfconnect/CMakeLists.txt | 1 + examples/lighting-app/telink/CMakeLists.txt | 1 + examples/lock-app/mbed/CMakeLists.txt | 1 + examples/lock-app/nrfconnect/CMakeLists.txt | 1 + .../pump-common/gen/CHIPClientCallbacks.cpp | 48 ++--- .../gen/CHIPClientCallbacks.cpp | 48 ++--- src/app/chip_data_model.gni | 1 + .../util/ember-compatibility-functions.cpp | 11 +- src/app/util/error-mapping.cpp | 194 ++++++++++++++++++ src/app/util/error-mapping.h | 30 +++ .../app/CHIPClientCallbacks-src.zapt | 48 ++--- .../data_model/gen/CHIPClientCallbacks.cpp | 48 ++--- .../Framework/CHIP.xcodeproj/project.pbxproj | 4 + src/protocols/interaction_model/Constants.h | 28 +-- 15 files changed, 350 insertions(+), 115 deletions(-) create mode 100644 src/app/util/error-mapping.cpp create mode 100644 src/app/util/error-mapping.h diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index 2431f9842c3708..9449fff2884079 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -61,6 +61,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/util/client-api.cpp ${CHIP_ROOT}/src/app/util/ember-compatibility-functions.cpp ${CHIP_ROOT}/src/app/util/ember-print.cpp + ${CHIP_ROOT}/src/app/util/error-mapping.cpp ${CHIP_ROOT}/src/app/util/message.cpp ${CHIP_ROOT}/src/app/util/process-cluster-message.cpp ${CHIP_ROOT}/src/app/util/process-global-message.cpp diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 9d173012c0eafb..6fcb90a6528e78 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -75,6 +75,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/client-api.cpp ${CHIP_ROOT}/src/app/util/ember-compatibility-functions.cpp ${CHIP_ROOT}/src/app/util/ember-print.cpp + ${CHIP_ROOT}/src/app/util/error-mapping.cpp ${CHIP_ROOT}/src/app/util/message.cpp ${CHIP_ROOT}/src/app/util/process-cluster-message.cpp ${CHIP_ROOT}/src/app/util/process-global-message.cpp diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 35b46de78d6264..b39138e4a30e2d 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -64,6 +64,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/client-api.cpp ${CHIP_ROOT}/src/app/util/ember-compatibility-functions.cpp ${CHIP_ROOT}/src/app/util/ember-print.cpp + ${CHIP_ROOT}/src/app/util/error-mapping.cpp ${CHIP_ROOT}/src/app/util/message.cpp ${CHIP_ROOT}/src/app/util/process-cluster-message.cpp ${CHIP_ROOT}/src/app/util/process-global-message.cpp diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 340c48733dafd1..353ed051450b0c 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -61,6 +61,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/util/client-api.cpp ${CHIP_ROOT}/src/app/util/ember-compatibility-functions.cpp ${CHIP_ROOT}/src/app/util/ember-print.cpp + ${CHIP_ROOT}/src/app/util/error-mapping.cpp ${CHIP_ROOT}/src/app/util/message.cpp ${CHIP_ROOT}/src/app/util/process-cluster-message.cpp ${CHIP_ROOT}/src/app/util/process-global-message.cpp diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 1ed34b9267c70f..037f6fa4dc5b72 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -75,6 +75,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/client-api.cpp ${CHIP_ROOT}/src/app/util/ember-compatibility-functions.cpp ${CHIP_ROOT}/src/app/util/ember-print.cpp + ${CHIP_ROOT}/src/app/util/error-mapping.cpp ${CHIP_ROOT}/src/app/util/message.cpp ${CHIP_ROOT}/src/app/util/process-cluster-message.cpp ${CHIP_ROOT}/src/app/util/process-global-message.cpp diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index 8a0f831d8f3469..0a959b13d21b84 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -272,14 +272,14 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved82: - ChipLogProgress(Zcl, " status: Reserved82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated82: + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved83: - ChipLogProgress(Zcl, " status: Reserved83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated83: + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved84: - ChipLogProgress(Zcl, " status: Reserved84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated84: + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -296,8 +296,8 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8a: - ChipLogProgress(Zcl, " status: Reserved8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8a: + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -308,23 +308,23 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::InvalidDataType: ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8e: - ChipLogProgress(Zcl, " status: Reserved8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8e: + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved90: - ChipLogProgress(Zcl, " status: Reserved90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated90: + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved91: - ChipLogProgress(Zcl, " status: Reserved91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated91: + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved93: - ChipLogProgress(Zcl, " status: Reserved93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated93: + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -353,20 +353,20 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::Busy: ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc0: - ChipLogProgress(Zcl, " status: Reservedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc1: - ChipLogProgress(Zcl, " status: Reservedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc2: - ChipLogProgress(Zcl, " status: Reservedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc4: - ChipLogProgress(Zcl, " status: Reservedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp index 8a0f831d8f3469..0a959b13d21b84 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp @@ -272,14 +272,14 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved82: - ChipLogProgress(Zcl, " status: Reserved82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated82: + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved83: - ChipLogProgress(Zcl, " status: Reserved83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated83: + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved84: - ChipLogProgress(Zcl, " status: Reserved84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated84: + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -296,8 +296,8 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8a: - ChipLogProgress(Zcl, " status: Reserved8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8a: + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -308,23 +308,23 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::InvalidDataType: ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8e: - ChipLogProgress(Zcl, " status: Reserved8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8e: + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved90: - ChipLogProgress(Zcl, " status: Reserved90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated90: + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved91: - ChipLogProgress(Zcl, " status: Reserved91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated91: + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved93: - ChipLogProgress(Zcl, " status: Reserved93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated93: + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -353,20 +353,20 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::Busy: ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc0: - ChipLogProgress(Zcl, " status: Reservedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc1: - ChipLogProgress(Zcl, " status: Reservedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc2: - ChipLogProgress(Zcl, " status: Reservedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc4: - ChipLogProgress(Zcl, " status: Reservedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index a0ae28d2d653e3..243c711cfc7d5f 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -110,6 +110,7 @@ template("chip_data_model") { "${_app_root}/util/client-api.cpp", "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/ember-print.cpp", + "${_app_root}/util/error-mapping.cpp", "${_app_root}/util/message.cpp", "${_app_root}/util/process-cluster-message.cpp", "${_app_root}/util/process-global-message.cpp", diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index f8cfca2264004c..51f1277aa48057 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -168,7 +169,8 @@ bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status) returnStatusParam, status == EMBER_ZCL_STATUS_SUCCESS ? chip::Protocols::SecureChannel::GeneralStatusCode::kSuccess : chip::Protocols::SecureChannel::GeneralStatusCode::kFailure, - chip::Protocols::InteractionModel::Id, static_cast(status)); + chip::Protocols::InteractionModel::Id, + static_cast(ToInteractionModelProtocolCode(status))); return CHIP_NO_ERROR == err; } @@ -202,8 +204,6 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap status = emberAfReadAttribute(aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mFieldId, CLUSTER_MASK_SERVER, data, sizeof(data), &attributeType); - // TODO: Currently, all errors are considered as attribute not exists, should be fixed by mapping ember error code to IM error - // codes. if (apDataExists != nullptr) { *apDataExists = (EMBER_ZCL_STATUS_SUCCESS == status); @@ -212,9 +212,8 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap VerifyOrReturnError(apWriter != nullptr, CHIP_NO_ERROR); if (status != EMBER_ZCL_STATUS_SUCCESS) { - return apWriter->Put( - chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status), - Protocols::InteractionModel::ToUint16(Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute)); + return apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status), + Protocols::InteractionModel::ToUint16(ToInteractionModelProtocolCode(status))); } // TODO: ZCL_STRUCT_ATTRIBUTE_TYPE is not included in this switch case currently, should add support for structures. diff --git a/src/app/util/error-mapping.cpp b/src/app/util/error-mapping.cpp new file mode 100644 index 00000000000000..26049bd4de10b8 --- /dev/null +++ b/src/app/util/error-mapping.cpp @@ -0,0 +1,194 @@ +/** + * + * 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. + */ + +#include "error-mapping.h" + +namespace chip { +namespace app { + +EmberAfStatus ToEmberAfStatus(Protocols::InteractionModel::ProtocolCode code) +{ + using imcode = Protocols::InteractionModel::ProtocolCode; + switch (code) + { + case imcode::Success: // 0x00 + return EMBER_ZCL_STATUS_SUCCESS; + case imcode::Failure: // 0x01 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::InvalidSubscription: // 0x7d + return EMBER_ZCL_STATUS_FAILURE; + case imcode::UnsupportedAccess: // 0x7e + return EMBER_ZCL_STATUS_NOT_AUTHORIZED; + case imcode::UnsupportedEndpoint: // 0x7f + return EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER; + case imcode::InvalidAction: // 0x80 + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + case imcode::UnsupportedCommand: // 0x81 + return EMBER_ZCL_STATUS_UNSUP_COMMAND; + case imcode::Deprecated82: // 0x82 + return EMBER_ZCL_STATUS_UNSUP_COMMAND; + case imcode::Deprecated83: // 0x83 + return EMBER_ZCL_STATUS_UNSUP_COMMAND; + case imcode::Deprecated84: // 0x84 + return EMBER_ZCL_STATUS_UNSUP_COMMAND; + case imcode::InvalidCommand: // 0x85 + return EMBER_ZCL_STATUS_INVALID_FIELD; + case imcode::UnsupportedAttribute: // 0x86 + return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + case imcode::InvalidValue: // 0x87 + return EMBER_ZCL_STATUS_INVALID_VALUE; + case imcode::UnsupportedWrite: // 0x88 + return EMBER_ZCL_STATUS_READ_ONLY; + case imcode::ResourceExhausted: // 0x89 + return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE; + case imcode::Deprecated8a: + return EMBER_ZCL_STATUS_SUCCESS; + case imcode::NotFound: // 0x8b + return EMBER_ZCL_STATUS_NOT_FOUND; + case imcode::UnreportableAttribute: // 0x8c + return EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE; + case imcode::InvalidDataType: // 0x8d + return EMBER_ZCL_STATUS_INVALID_DATA_TYPE; + case imcode::Deprecated8e: // 0x8e + return EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE; + case imcode::UnsupportedRead: // 0x8f + return EMBER_ZCL_STATUS_WRITE_ONLY; + case imcode::Deprecated90: // 0x90 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Deprecated91: // 0x91 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved92: // 0x92 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Deprecated93: // 0x93 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Timeout: // 0x94 + return EMBER_ZCL_STATUS_TIMEOUT; + case imcode::Reserved95: // 0x95 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved96: // 0x96 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved97: // 0x97 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved98: // 0x98 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved99: // 0x99 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Reserved9a: // 0x9a + return EMBER_ZCL_STATUS_FAILURE; + case imcode::ConstraintError: // 0x9b + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Busy: // 0x9c + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Deprecatedc0: // 0xc0 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Deprecatedc1: // 0xc1 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::Deprecatedc2: // 0xc2 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::UnsupportedCluster: // 0xc3 + return EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER; + case imcode::Deprecatedc4: // 0xc4 + return EMBER_ZCL_STATUS_SUCCESS; + case imcode::NoUpstreamSubscription: // 0xc5 + return EMBER_ZCL_STATUS_FAILURE; + case imcode::InvalidArgument: // 0xc6 + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + // Default case is omitted intentionally so we can guarantee that we exhaust all of the error codes. + } + return EMBER_ZCL_STATUS_FAILURE; +} + +Protocols::InteractionModel::ProtocolCode ToInteractionModelProtocolCode(EmberAfStatus code) +{ + using imcode = Protocols::InteractionModel::ProtocolCode; + switch (code) + { + case EMBER_ZCL_STATUS_SUCCESS: // 0x00 + return imcode::Success; + case EMBER_ZCL_STATUS_FAILURE: // 0x01 + return imcode::Failure; + case EMBER_ZCL_STATUS_NOT_AUTHORIZED: // 0x7E + return imcode::UnsupportedAccess; + case EMBER_ZCL_STATUS_MALFORMED_COMMAND: // 0x80 + return imcode::InvalidAction; + case EMBER_ZCL_STATUS_UNSUP_COMMAND: // 0x81 + return imcode::UnsupportedCommand; + case EMBER_ZCL_STATUS_UNSUP_GENERAL_COMMAND: // 0x82 + return imcode::UnsupportedCommand; + case EMBER_ZCL_STATUS_UNSUP_MANUF_CLUSTER_COMMAND: // 0x83 + return imcode::UnsupportedCommand; + case EMBER_ZCL_STATUS_UNSUP_MANUF_GENERAL_COMMAND: // 0x84 + return imcode::UnsupportedCommand; + case EMBER_ZCL_STATUS_INVALID_FIELD: // 0x85 + return imcode::InvalidCommand; + case EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE: // 0x86 + return imcode::UnsupportedAttribute; + case EMBER_ZCL_STATUS_INVALID_VALUE: // 0x87 + return imcode::InvalidValue; + case EMBER_ZCL_STATUS_READ_ONLY: // 0x88 + return imcode::UnsupportedWrite; + case EMBER_ZCL_STATUS_INSUFFICIENT_SPACE: // 0x89 + return imcode::ResourceExhausted; + case EMBER_ZCL_STATUS_DUPLICATE_EXISTS: // 0x8A + return imcode::Success; + case EMBER_ZCL_STATUS_NOT_FOUND: // 0x8B + return imcode::NotFound; + case EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE: // 0x8C + return imcode::UnreportableAttribute; + case EMBER_ZCL_STATUS_INVALID_DATA_TYPE: // 0x8D + return imcode::InvalidDataType; + case EMBER_ZCL_STATUS_INVALID_SELECTOR: // 0x8E + return imcode::Failure; + case EMBER_ZCL_STATUS_WRITE_ONLY: // 0x8F + return imcode::UnsupportedRead; + case EMBER_ZCL_STATUS_INCONSISTENT_STARTUP_STATE: // 0x90 + return imcode::Failure; + case EMBER_ZCL_STATUS_DEFINED_OUT_OF_BAND: // 0x91 + return imcode::Failure; + case EMBER_ZCL_STATUS_ACTION_DENIED: // 0x93 + return imcode::Failure; + case EMBER_ZCL_STATUS_TIMEOUT: // 0x94 + return imcode::Timeout; + case EMBER_ZCL_STATUS_ABORT: // 0x95 + return imcode::Failure; + case EMBER_ZCL_STATUS_INVALID_IMAGE: // 0x96 + return imcode::Failure; + case EMBER_ZCL_STATUS_WAIT_FOR_DATA: // 0x97 + return imcode::Failure; + case EMBER_ZCL_STATUS_NO_IMAGE_AVAILABLE: // 0x98 + return imcode::Failure; + case EMBER_ZCL_STATUS_REQUIRE_MORE_IMAGE: // 0x99 + return imcode::Failure; + case EMBER_ZCL_STATUS_NOTIFICATION_PENDING: // 0x9A + return imcode::Failure; + case EMBER_ZCL_STATUS_HARDWARE_FAILURE: // 0xC0 + return imcode::Failure; + case EMBER_ZCL_STATUS_SOFTWARE_FAILURE: // 0xC1 + return imcode::Failure; + case EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER: // 0xC3 + return imcode::UnsupportedCluster; + case EMBER_ZCL_STATUS_LIMIT_REACHED: // 0xC4 + return imcode::Success; + case EMBER_ZCL_STATUS_INVALID_ARGUMENT: // 0xC6 + return imcode::InvalidArgument; + default: + return imcode::Failure; + } +} + +} // namespace app +} // namespace chip diff --git a/src/app/util/error-mapping.h b/src/app/util/error-mapping.h new file mode 100644 index 00000000000000..3bfbb8f415960a --- /dev/null +++ b/src/app/util/error-mapping.h @@ -0,0 +1,30 @@ +/** + * + * 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 + +namespace chip { +namespace app { + +EmberAfStatus ToEmberAfStatus(Protocols::InteractionModel::ProtocolCode code); +Protocols::InteractionModel::ProtocolCode ToInteractionModelProtocolCode(EmberAfStatus code); + +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 10ed8a6887d4ce..46889ad604dc47 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -257,14 +257,14 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved82: - ChipLogProgress(Zcl, " status: Reserved82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated82: + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved83: - ChipLogProgress(Zcl, " status: Reserved83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated83: + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved84: - ChipLogProgress(Zcl, " status: Reserved84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated84: + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -281,8 +281,8 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8a: - ChipLogProgress(Zcl, " status: Reserved8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8a: + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -293,23 +293,23 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::InvalidDataType: ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8e: - ChipLogProgress(Zcl, " status: Reserved8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8e: + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved90: - ChipLogProgress(Zcl, " status: Reserved90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated90: + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved91: - ChipLogProgress(Zcl, " status: Reserved91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated91: + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved93: - ChipLogProgress(Zcl, " status: Reserved93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated93: + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -338,20 +338,20 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::Busy: ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc0: - ChipLogProgress(Zcl, " status: Reservedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc1: - ChipLogProgress(Zcl, " status: Reservedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc2: - ChipLogProgress(Zcl, " status: Reservedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc4: - ChipLogProgress(Zcl, " status: Reservedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index f7bef97ef6e019..b182885d9847ff 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -272,14 +272,14 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved82: - ChipLogProgress(Zcl, " status: Reserved82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated82: + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved83: - ChipLogProgress(Zcl, " status: Reserved83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated83: + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved84: - ChipLogProgress(Zcl, " status: Reserved84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated84: + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -296,8 +296,8 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8a: - ChipLogProgress(Zcl, " status: Reserved8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8a: + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -308,23 +308,23 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::InvalidDataType: ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved8e: - ChipLogProgress(Zcl, " status: Reserved8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated8e: + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved90: - ChipLogProgress(Zcl, " status: Reserved90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated90: + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved91: - ChipLogProgress(Zcl, " status: Reserved91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated91: + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reserved93: - ChipLogProgress(Zcl, " status: Reserved93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecated93: + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); @@ -353,20 +353,20 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) case Protocols::InteractionModel::ProtocolCode::Busy: ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc0: - ChipLogProgress(Zcl, " status: Reservedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc1: - ChipLogProgress(Zcl, " status: Reservedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc2: - ChipLogProgress(Zcl, " status: Reservedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; - case Protocols::InteractionModel::ProtocolCode::Reservedc4: - ChipLogProgress(Zcl, " status: Reservedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index ccd9e5d1dfaea4..1c5b57f67a9369 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -48,6 +48,7 @@ 2CB7163B252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CB71638252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h */; }; 2CB7163C252E8A7C0026E2BB /* CHIPDevicePairingDelegateBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2CB71639252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.mm */; }; 2CB7163F252F731E0026E2BB /* CHIPDevicePairingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CB7163E252F731E0026E2BB /* CHIPDevicePairingDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2FD775552695557E00FF4B12 /* error-mapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FD775542695557E00FF4B12 /* error-mapping.cpp */; }; 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 */; }; @@ -121,6 +122,7 @@ 2CB71638252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPDevicePairingDelegateBridge.h; sourceTree = ""; }; 2CB71639252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPDevicePairingDelegateBridge.mm; sourceTree = ""; }; 2CB7163E252F731E0026E2BB /* CHIPDevicePairingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPDevicePairingDelegate.h; sourceTree = ""; }; + 2FD775542695557E00FF4B12 /* error-mapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "error-mapping.cpp"; path = "../../../app/util/error-mapping.cpp"; sourceTree = ""; }; 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 = ""; }; @@ -170,6 +172,7 @@ 1E857311265519DE0050A4D9 /* CHIPApp */ = { isa = PBXGroup; children = ( + 2FD775542695557E00FF4B12 /* error-mapping.cpp */, 1E85733326551A700050A4D9 /* reporting-default-configuration.cpp */, 1E85733226551A700050A4D9 /* reporting.cpp */, 1E85731926551A490050A4D9 /* af-event.cpp */, @@ -456,6 +459,7 @@ 1E857310265519AE0050A4D9 /* IMClusterCommandHandler.cpp in Sources */, 1E85732D26551A490050A4D9 /* util.cpp in Sources */, 1E85732B26551A490050A4D9 /* af-main-common.cpp in Sources */, + 2FD775552695557E00FF4B12 /* error-mapping.cpp in Sources */, 1E85732A26551A490050A4D9 /* ember-compatibility-functions.cpp in Sources */, B289D4222639C0D300D4E314 /* CHIPOnboardingPayloadParser.m in Sources */, 1E85732F26551A490050A4D9 /* attribute-size-util.cpp in Sources */, diff --git a/src/protocols/interaction_model/Constants.h b/src/protocols/interaction_model/Constants.h index 80fcbf3b0ef32a..7a7d155351a749 100644 --- a/src/protocols/interaction_model/Constants.h +++ b/src/protocols/interaction_model/Constants.h @@ -25,6 +25,8 @@ #pragma once +#include + #include /** @@ -72,24 +74,24 @@ enum class ProtocolCode : uint16_t UnsupportedEndpoint = 0x7f, InvalidAction = 0x80, UnsupportedCommand = 0x81, - Reserved82 = 0x82, - Reserved83 = 0x83, - Reserved84 = 0x84, + Deprecated82 = 0x82, + Deprecated83 = 0x83, + Deprecated84 = 0x84, InvalidCommand = 0x85, UnsupportedAttribute = 0x86, InvalidValue = 0x87, UnsupportedWrite = 0x88, ResourceExhausted = 0x89, - Reserved8a = 0x8a, + Deprecated8a = 0x8a, NotFound = 0x8b, UnreportableAttribute = 0x8c, InvalidDataType = 0x8d, - Reserved8e = 0x8e, + Deprecated8e = 0x8e, UnsupportedRead = 0x8f, - Reserved90 = 0x90, - Reserved91 = 0x91, - Reserved92 = 0x92, - Reserved93 = 0x93, + Deprecated90 = 0x90, + Deprecated91 = 0x91, + Reserved92 = 0x92, // ProtocolCode 0x92 does not have any comments in the spec. + Deprecated93 = 0x93, Timeout = 0x94, Reserved95 = 0x95, Reserved96 = 0x96, @@ -99,11 +101,11 @@ enum class ProtocolCode : uint16_t Reserved9a = 0x9a, ConstraintError = 0x9b, Busy = 0x9c, - Reservedc0 = 0xc0, - Reservedc1 = 0xc1, - Reservedc2 = 0xc2, + Deprecatedc0 = 0xc0, + Deprecatedc1 = 0xc1, + Deprecatedc2 = 0xc2, UnsupportedCluster = 0xc3, - Reservedc4 = 0xc4, + Deprecatedc4 = 0xc4, NoUpstreamSubscription = 0xc5, InvalidArgument = 0xc6, }; From 3d5171ccc28192c6aeaad65de41d2d393252abf5 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 7 Jul 2021 23:38:33 +0200 Subject: [PATCH 04/47] Log string attribute value into CHIPClientCallbacks.cpp (#8134) * Log string attribute value into CHIPClientCallbacks.cpp * Update gen/ folders --- .../pump-common/gen/CHIPClientCallbacks.cpp | 19 ++++++------- .../gen/CHIPClientCallbacks.cpp | 19 ++++++------- .../util/ember-compatibility-functions.cpp | 28 +++++++++++++++---- .../app/CHIPClientCallbacks-src.zapt | 19 ++++++------- .../data_model/gen/CHIPClientCallbacks.cpp | 19 ++++++------- 5 files changed, 54 insertions(+), 50 deletions(-) diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index 0a959b13d21b84..b435ce73230155 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -380,25 +381,19 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) } } -void LogStringAttribute(const uint8_t * string, const uint16_t length, const bool isAscii) +void LogStringAttribute(const uint8_t * string, const uint32_t length, const bool isHumanReadable) { - if (isAscii) + if (isHumanReadable) { ChipLogProgress(Zcl, " value: %.*s", length, string); return; } - constexpr size_t kByteInHexLength = 3; // 2 hex digits + space - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE] = " value: "; - char * bufferPos = buffer + strlen(buffer); - char * const bufferEnd = buffer + CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE; - - for (uint16_t i = 0; i < length && bufferPos + kByteInHexLength < bufferEnd; i++, bufferPos += kByteInHexLength) + char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + if (CHIP_NO_ERROR == Encoding::BytesToUppercaseHexString(&string[0], length, &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) { - snprintf(bufferPos, static_cast(bufferEnd - bufferPos), "%02X ", string[i]); + ChipLogProgress(Zcl, " value: %s", buffer); } - - ChipLogProgress(Zcl, "%s", buffer); } // Singleton instance of the callbacks manager @@ -471,6 +466,8 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, if (CHIP_NO_ERROR == err) { + LogStringAttribute(val, len, data->GetType() == chip::TLV::kTLVType_UTF8String); + chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onSuccess); cb->mCall(cb->mContext, chip::ByteSpan(val, len)); diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp index 0a959b13d21b84..b435ce73230155 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -380,25 +381,19 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) } } -void LogStringAttribute(const uint8_t * string, const uint16_t length, const bool isAscii) +void LogStringAttribute(const uint8_t * string, const uint32_t length, const bool isHumanReadable) { - if (isAscii) + if (isHumanReadable) { ChipLogProgress(Zcl, " value: %.*s", length, string); return; } - constexpr size_t kByteInHexLength = 3; // 2 hex digits + space - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE] = " value: "; - char * bufferPos = buffer + strlen(buffer); - char * const bufferEnd = buffer + CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE; - - for (uint16_t i = 0; i < length && bufferPos + kByteInHexLength < bufferEnd; i++, bufferPos += kByteInHexLength) + char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + if (CHIP_NO_ERROR == Encoding::BytesToUppercaseHexString(&string[0], length, &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) { - snprintf(bufferPos, static_cast(bufferEnd - bufferPos), "%02X ", string[i]); + ChipLogProgress(Zcl, " value: %s", buffer); } - - ChipLogProgress(Zcl, "%s", buffer); } // Singleton instance of the callbacks manager @@ -471,6 +466,8 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, if (CHIP_NO_ERROR == err) { + LogStringAttribute(val, len, data->GetType() == chip::TLV::kTLVType_UTF8String); + chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onSuccess); cb->mCall(cb->mContext, chip::ByteSpan(val, len)); diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 51f1277aa48057..b5b3d5117dbab2 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -119,12 +119,6 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) "chip::NodeId is expected to be uint64_t, change this when necessary"); return ZCL_INT64U_ATTRIBUTE_TYPE; - case ZCL_CHAR_STRING_ATTRIBUTE_TYPE: // Character string - return ZCL_OCTET_STRING_ATTRIBUTE_TYPE; - - case ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE: - return ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE; - default: return type; } @@ -277,6 +271,28 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap ReturnErrorOnFailure(apWriter->Put(TLV::ContextTag(AttributeDataElement::kCsTag_Data), int64_data)); break; } + case ZCL_CHAR_STRING_ATTRIBUTE_TYPE: // Char string + { + char * actualData = reinterpret_cast(data + 1); + uint8_t dataLength = data[0]; + if (dataLength == 0xFF /* invalid data, put empty value instead */) + { + dataLength = 0; + } + ReturnErrorOnFailure(apWriter->PutString(TLV::ContextTag(AttributeDataElement::kCsTag_Data), actualData, dataLength)); + break; + } + case ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE: { + char * actualData = reinterpret_cast(data + 2); // The pascal string contains 2 bytes length + uint16_t dataLength; + memcpy(&dataLength, data, sizeof(dataLength)); + if (dataLength == 0xFFFF /* invalid data, put empty value instead */) + { + dataLength = 0; + } + ReturnErrorOnFailure(apWriter->PutString(TLV::ContextTag(AttributeDataElement::kCsTag_Data), actualData, dataLength)); + break; + } case ZCL_OCTET_STRING_ATTRIBUTE_TYPE: // Octet string { uint8_t * actualData = data + 1; diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 46889ad604dc47..97fb6a55ca15d0 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -365,25 +366,19 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) } } -void LogStringAttribute(const uint8_t * string, const uint16_t length, const bool isAscii) +void LogStringAttribute(const uint8_t * string, const uint32_t length, const bool isHumanReadable) { - if (isAscii) + if (isHumanReadable) { ChipLogProgress(Zcl, " value: %.*s", length, string); return; } - constexpr size_t kByteInHexLength = 3; // 2 hex digits + space - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE] = " value: "; - char * bufferPos = buffer + strlen(buffer); - char * const bufferEnd = buffer + CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE; - - for (uint16_t i = 0; i < length && bufferPos + kByteInHexLength < bufferEnd; i++, bufferPos += kByteInHexLength) + char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + if (CHIP_NO_ERROR == Encoding::BytesToUppercaseHexString(&string[0], length, &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) { - snprintf(bufferPos, static_cast(bufferEnd - bufferPos), "%02X ", string[i]); + ChipLogProgress(Zcl, " value: %s", buffer); } - - ChipLogProgress(Zcl, "%s", buffer); } // Singleton instance of the callbacks manager @@ -453,6 +448,8 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, if (CHIP_NO_ERROR == err) { + LogStringAttribute(val, len, data->GetType() == chip::TLV::kTLVType_UTF8String); + chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onSuccess); cb->mCall(cb->mContext, chip::ByteSpan(val, len)); diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index b182885d9847ff..885800a77e0b99 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -380,25 +381,19 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) } } -void LogStringAttribute(const uint8_t * string, const uint16_t length, const bool isAscii) +void LogStringAttribute(const uint8_t * string, const uint32_t length, const bool isHumanReadable) { - if (isAscii) + if (isHumanReadable) { ChipLogProgress(Zcl, " value: %.*s", length, string); return; } - constexpr size_t kByteInHexLength = 3; // 2 hex digits + space - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE] = " value: "; - char * bufferPos = buffer + strlen(buffer); - char * const bufferEnd = buffer + CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE; - - for (uint16_t i = 0; i < length && bufferPos + kByteInHexLength < bufferEnd; i++, bufferPos += kByteInHexLength) + char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + if (CHIP_NO_ERROR == Encoding::BytesToUppercaseHexString(&string[0], length, &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) { - snprintf(bufferPos, static_cast(bufferEnd - bufferPos), "%02X ", string[i]); + ChipLogProgress(Zcl, " value: %s", buffer); } - - ChipLogProgress(Zcl, "%s", buffer); } // Singleton instance of the callbacks manager @@ -471,6 +466,8 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, if (CHIP_NO_ERROR == err) { + LogStringAttribute(val, len, data->GetType() == chip::TLV::kTLVType_UTF8String); + chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onSuccess); cb->mCall(cb->mContext, chip::ByteSpan(val, len)); From 4fad969d411f0e1742dd3898d2ba69849e7843aa Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Wed, 7 Jul 2021 23:46:41 +0200 Subject: [PATCH 05/47] [TV App] Enable missing attributes (#8120) * Enabling missing attributes as current media input on TV app * Adding tests for code changes * Generating the code using ZAP script * Restyle fix * Enable attributes on all-clusters app so tests can pass --- .../all-clusters-common/all-clusters-app.zap | 60 ++++ .../all-clusters-common/gen/endpoint_config.h | 36 +- .../chip-tool/commands/clusters/Commands.h | 156 ++++++++- examples/chip-tool/commands/tests/Commands.h | 315 +++++++++++++++--- .../tv-app/tv-common/gen/endpoint_config.h | 39 ++- examples/tv-app/tv-common/tv-app.zap | 45 +++ .../suites/TV_ApplicationLauncherCluster.yaml | 21 ++ .../tests/suites/TV_MediaInputCluster.yaml | 6 + .../data_model/controller-clusters.zap | 60 ++++ .../data_model/gen/CHIPClusters.cpp | 48 +++ src/controller/data_model/gen/CHIPClusters.h | 4 + .../data_model/gen/chip-zcl-zpro-codec-api.h | 32 ++ src/controller/data_model/gen/encoder.cpp | 56 ++++ .../python/chip/clusters/CHIPClusters.cpp | 37 ++ .../python/chip/clusters/CHIPClusters.py | 36 ++ .../Framework/CHIP/gen/CHIPClustersObjc.h | 4 + .../Framework/CHIP/gen/CHIPClustersObjc.mm | 108 ++++++ .../Framework/CHIPTests/CHIPClustersTests.m | 76 +++++ 18 files changed, 1059 insertions(+), 80 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f9aace48dfb1ef..f5209f5788abde 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 @@ -12119,6 +12119,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "current media input", + "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": "cluster revision", "code": 65533, @@ -12450,6 +12465,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "current audio output", + "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": "cluster revision", "code": 65533, @@ -12535,6 +12565,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "catalog vendor id", + "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": "application id", + "code": 2, + "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, 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 4753f78a2f96c8..6690b2eaf13dd6 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 @@ -1809,7 +1809,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 363 +#define GENERATED_ATTRIBUTE_COUNT 367 #define GENERATED_ATTRIBUTES \ { \ \ @@ -2216,6 +2216,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6470) }, /* media input list */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Low Power (server) */ \ @@ -2231,10 +2232,13 @@ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7232) }, /* audio output list */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7486) }, /* application launcher list */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ + { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ @@ -2510,46 +2514,46 @@ 0x0506, ZAP_ATTRIBUTE_INDEX(302), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(303), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(303), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(305), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(306), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(306), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(307), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(307), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(308), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(310), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(311), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(312), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(314), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(314), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(318), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(322), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(326), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(323), 21, 1579, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(327), 21, 1579, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(344), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(348), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(356), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(360), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(357), \ + ZAP_ATTRIBUTE_INDEX(361), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(359), \ + ZAP_ATTRIBUTE_INDEX(363), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2561,7 +2565,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 6238 }, { ZAP_CLUSTER_INDEX(52), 2, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 6242 }, { ZAP_CLUSTER_INDEX(52), 2, 8 }, \ } // Largest attribute size is needed for various buffers @@ -2571,7 +2575,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1497) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (9806) +#define ATTRIBUTE_MAX_SIZE (9810) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index 3bdd877ac4fdfb..c9a3a7a2338b79 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -1698,6 +1698,8 @@ class ReadApplicationBasicClusterRevision : public ModelCommand |------------------------------------------------------------------------------| | Attributes: | | | * ApplicationLauncherList | 0x0000 | +| * CatalogVendorId | 0x0001 | +| * ApplicationId | 0x0002 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -1807,6 +1809,74 @@ class ReadApplicationLauncherApplicationLauncherList : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute CatalogVendorId + */ +class ReadApplicationLauncherCatalogVendorId : public ModelCommand +{ +public: + ReadApplicationLauncherCatalogVendorId() : ModelCommand("read") + { + AddArgument("attr-name", "catalog-vendor-id"); + ModelCommand::AddArguments(); + } + + ~ReadApplicationLauncherCatalogVendorId() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeCatalogVendorId(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); +}; + +/* + * Attribute ApplicationId + */ +class ReadApplicationLauncherApplicationId : public ModelCommand +{ +public: + ReadApplicationLauncherApplicationId() : ModelCommand("read") + { + AddArgument("attr-name", "application-id"); + ModelCommand::AddArguments(); + } + + ~ReadApplicationLauncherApplicationId() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeApplicationId(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); +}; + /* * Attribute ClusterRevision */ @@ -1850,6 +1920,7 @@ class ReadApplicationLauncherClusterRevision : public ModelCommand |------------------------------------------------------------------------------| | Attributes: | | | * AudioOutputList | 0x0000 | +| * CurrentAudioOutput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -1989,6 +2060,40 @@ class ReadAudioOutputAudioOutputList : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute CurrentAudioOutput + */ +class ReadAudioOutputCurrentAudioOutput : public ModelCommand +{ +public: + ReadAudioOutputCurrentAudioOutput() : ModelCommand("read") + { + AddArgument("attr-name", "current-audio-output"); + ModelCommand::AddArguments(); + } + + ~ReadAudioOutputCurrentAudioOutput() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeCurrentAudioOutput(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); +}; + /* * Attribute ClusterRevision */ @@ -11962,6 +12067,7 @@ class ReadLowPowerClusterRevision : public ModelCommand |------------------------------------------------------------------------------| | Attributes: | | | * MediaInputList | 0x0000 | +| * CurrentMediaInput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -12159,6 +12265,40 @@ class ReadMediaInputMediaInputList : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute CurrentMediaInput + */ +class ReadMediaInputCurrentMediaInput : public ModelCommand +{ +public: + ReadMediaInputCurrentMediaInput() : ModelCommand("read") + { + AddArgument("attr-name", "current-media-input"); + ModelCommand::AddArguments(); + } + + ~ReadMediaInputCurrentMediaInput() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeCurrentMediaInput(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); +}; + /* * Attribute ClusterRevision */ @@ -22844,6 +22984,8 @@ void registerClusterApplicationLauncher(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), }; @@ -22854,9 +22996,9 @@ void registerClusterAudioOutput(Commands & commands) const char * clusterName = "AudioOutput"; 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(), }; commands.Register(clusterName, clusterCommands); @@ -23298,10 +23440,10 @@ void registerClusterMediaInput(Commands & commands) const char * clusterName = "MediaInput"; 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(), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/chip-tool/commands/tests/Commands.h b/examples/chip-tool/commands/tests/Commands.h index ac3344fd18b9e1..4f543f863b9602 100644 --- a/examples/chip-tool/commands/tests/Commands.h +++ b/examples/chip-tool/commands/tests/Commands.h @@ -512,6 +512,12 @@ class TV_ApplicationLauncherCluster : public TestCommand case 1: err = TestSendClusterApplicationLauncherCommandLaunchApp_1(); break; + case 2: + err = TestSendClusterApplicationLauncherCommandReadAttribute_2(); + break; + case 3: + err = TestSendClusterApplicationLauncherCommandReadAttribute_3(); + break; } if (CHIP_NO_ERROR != err) @@ -523,7 +529,7 @@ class TV_ApplicationLauncherCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; // // Tests methods @@ -679,6 +685,158 @@ class TV_ApplicationLauncherCluster : public TestCommand runner->NextTest(); } + + // Test Read attribute catalog vendor id + typedef void (*SuccessCallback_2)(void * context, uint8_t catalogVendorId); + chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; + chip::Callback::Callback * mOnFailureCallback_2 = nullptr; + bool mIsFailureExpected_2 = 0; + + CHIP_ERROR TestSendClusterApplicationLauncherCommandReadAttribute_2() + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute catalog vendor id: Sending command..."); + + mOnFailureCallback_2 = new chip::Callback::Callback( + OnTestSendClusterApplicationLauncherCommandReadAttribute_2_FailureResponse, this); + mOnSuccessCallback_2 = new chip::Callback::Callback( + OnTestSendClusterApplicationLauncherCommandReadAttribute_2_SuccessResponse, this); + + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); + + if (CHIP_NO_ERROR != err) + { + delete mOnFailureCallback_2; + delete mOnSuccessCallback_2; + } + + return err; + } + + static void OnTestSendClusterApplicationLauncherCommandReadAttribute_2_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute catalog vendor id: Failure Response"); + + TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_2; + delete runner->mOnSuccessCallback_2; + + if (runner->mIsFailureExpected_2 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterApplicationLauncherCommandReadAttribute_2_SuccessResponse(void * context, uint8_t catalogVendorId) + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute catalog vendor id: Success Response"); + + TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_2; + delete runner->mOnSuccessCallback_2; + + if (runner->mIsFailureExpected_2 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (catalogVendorId != 0) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute application id + typedef void (*SuccessCallback_3)(void * context, uint8_t applicationId); + chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; + chip::Callback::Callback * mOnFailureCallback_3 = nullptr; + bool mIsFailureExpected_3 = 0; + + CHIP_ERROR TestSendClusterApplicationLauncherCommandReadAttribute_3() + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute application id: Sending command..."); + + mOnFailureCallback_3 = new chip::Callback::Callback( + OnTestSendClusterApplicationLauncherCommandReadAttribute_3_FailureResponse, this); + mOnSuccessCallback_3 = new chip::Callback::Callback( + OnTestSendClusterApplicationLauncherCommandReadAttribute_3_SuccessResponse, this); + + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeApplicationId(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); + + if (CHIP_NO_ERROR != err) + { + delete mOnFailureCallback_3; + delete mOnSuccessCallback_3; + } + + return err; + } + + static void OnTestSendClusterApplicationLauncherCommandReadAttribute_3_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute application id: Failure Response"); + + TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_3; + delete runner->mOnSuccessCallback_3; + + if (runner->mIsFailureExpected_3 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterApplicationLauncherCommandReadAttribute_3_SuccessResponse(void * context, uint8_t applicationId) + { + ChipLogProgress(chipTool, "Application Launcher - Read attribute application id: Success Response"); + + TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_3; + delete runner->mOnSuccessCallback_3; + + if (runner->mIsFailureExpected_3 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (applicationId != 0) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } }; class TV_KeypadInputCluster : public TestCommand @@ -2874,13 +3032,16 @@ class TV_MediaInputCluster : public TestCommand err = TestSendClusterMediaInputCommandSelectInput_1(); break; case 2: - err = TestSendClusterMediaInputCommandHideInputStatus_2(); + err = TestSendClusterMediaInputCommandReadAttribute_2(); break; case 3: - err = TestSendClusterMediaInputCommandShowInputStatus_3(); + err = TestSendClusterMediaInputCommandHideInputStatus_3(); break; case 4: - err = TestSendClusterMediaInputCommandRenameInput_4(); + err = TestSendClusterMediaInputCommandShowInputStatus_4(); + break; + case 5: + err = TestSendClusterMediaInputCommandRenameInput_5(); break; } @@ -2893,7 +3054,7 @@ class TV_MediaInputCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 6; // // Tests methods @@ -3046,27 +3207,27 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } - // Test Hide Input Status Command - typedef void (*SuccessCallback_2)(void * context); + // Test Read current input list + typedef void (*SuccessCallback_2)(void * context, uint8_t currentMediaInput); chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; chip::Callback::Callback * mOnFailureCallback_2 = nullptr; bool mIsFailureExpected_2 = 0; - CHIP_ERROR TestSendClusterMediaInputCommandHideInputStatus_2() + CHIP_ERROR TestSendClusterMediaInputCommandReadAttribute_2() { - ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Sending command..."); + ChipLogProgress(chipTool, "Media Input - Read current input list: Sending command..."); mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandHideInputStatus_2_FailureResponse, this); + OnTestSendClusterMediaInputCommandReadAttribute_2_FailureResponse, this); mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandHideInputStatus_2_SuccessResponse, this); + OnTestSendClusterMediaInputCommandReadAttribute_2_SuccessResponse, this); chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.HideInputStatus(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); + err = cluster.ReadAttributeCurrentMediaInput(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); if (CHIP_NO_ERROR != err) { @@ -3077,9 +3238,9 @@ class TV_MediaInputCluster : public TestCommand return err; } - static void OnTestSendClusterMediaInputCommandHideInputStatus_2_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterMediaInputCommandReadAttribute_2_FailureResponse(void * context, uint8_t status) { - ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Failure Response"); + ChipLogProgress(chipTool, "Media Input - Read current input list: Failure Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3096,9 +3257,9 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterMediaInputCommandHideInputStatus_2_SuccessResponse(void * context) + static void OnTestSendClusterMediaInputCommandReadAttribute_2_SuccessResponse(void * context, uint8_t currentMediaInput) { - ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Success Response"); + ChipLogProgress(chipTool, "Media Input - Read current input list: Success Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3112,30 +3273,37 @@ class TV_MediaInputCluster : public TestCommand return; } + if (currentMediaInput != 1) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "1"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + runner->NextTest(); } - // Test Show Input Status Command + // Test Hide Input Status Command typedef void (*SuccessCallback_3)(void * context); chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; chip::Callback::Callback * mOnFailureCallback_3 = nullptr; bool mIsFailureExpected_3 = 0; - CHIP_ERROR TestSendClusterMediaInputCommandShowInputStatus_3() + CHIP_ERROR TestSendClusterMediaInputCommandHideInputStatus_3() { - ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Sending command..."); + ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Sending command..."); mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandShowInputStatus_3_FailureResponse, this); + OnTestSendClusterMediaInputCommandHideInputStatus_3_FailureResponse, this); mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandShowInputStatus_3_SuccessResponse, this); + OnTestSendClusterMediaInputCommandHideInputStatus_3_SuccessResponse, this); chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ShowInputStatus(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); + err = cluster.HideInputStatus(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); if (CHIP_NO_ERROR != err) { @@ -3146,9 +3314,9 @@ class TV_MediaInputCluster : public TestCommand return err; } - static void OnTestSendClusterMediaInputCommandShowInputStatus_3_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterMediaInputCommandHideInputStatus_3_FailureResponse(void * context, uint8_t status) { - ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Failure Response"); + ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Failure Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3165,9 +3333,9 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterMediaInputCommandShowInputStatus_3_SuccessResponse(void * context) + static void OnTestSendClusterMediaInputCommandHideInputStatus_3_SuccessResponse(void * context) { - ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Success Response"); + ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Success Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3184,29 +3352,27 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } - // Test Rename Input Command + // Test Show Input Status Command typedef void (*SuccessCallback_4)(void * context); chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; chip::Callback::Callback * mOnFailureCallback_4 = nullptr; bool mIsFailureExpected_4 = 0; - CHIP_ERROR TestSendClusterMediaInputCommandRenameInput_4() + CHIP_ERROR TestSendClusterMediaInputCommandShowInputStatus_4() { - ChipLogProgress(chipTool, "Media Input - Rename Input Command: Sending command..."); + ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Sending command..."); mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandRenameInput_4_FailureResponse, this); - mOnSuccessCallback_4 = - new chip::Callback::Callback(OnTestSendClusterMediaInputCommandRenameInput_4_SuccessResponse, this); + OnTestSendClusterMediaInputCommandShowInputStatus_4_FailureResponse, this); + mOnSuccessCallback_4 = new chip::Callback::Callback( + OnTestSendClusterMediaInputCommandShowInputStatus_4_SuccessResponse, this); chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t indexArgument = 1; - chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("newName"), strlen("newName")); - err = cluster.RenameInput(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel(), indexArgument, nameArgument); + err = cluster.ShowInputStatus(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); if (CHIP_NO_ERROR != err) { @@ -3217,9 +3383,9 @@ class TV_MediaInputCluster : public TestCommand return err; } - static void OnTestSendClusterMediaInputCommandRenameInput_4_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterMediaInputCommandShowInputStatus_4_FailureResponse(void * context, uint8_t status) { - ChipLogProgress(chipTool, "Media Input - Rename Input Command: Failure Response"); + ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Failure Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3236,9 +3402,9 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterMediaInputCommandRenameInput_4_SuccessResponse(void * context) + static void OnTestSendClusterMediaInputCommandShowInputStatus_4_SuccessResponse(void * context) { - ChipLogProgress(chipTool, "Media Input - Rename Input Command: Success Response"); + ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Success Response"); TV_MediaInputCluster * runner = reinterpret_cast(context); @@ -3254,6 +3420,77 @@ class TV_MediaInputCluster : public TestCommand runner->NextTest(); } + + // Test Rename Input Command + typedef void (*SuccessCallback_5)(void * context); + chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; + chip::Callback::Callback * mOnFailureCallback_5 = nullptr; + bool mIsFailureExpected_5 = 0; + + CHIP_ERROR TestSendClusterMediaInputCommandRenameInput_5() + { + ChipLogProgress(chipTool, "Media Input - Rename Input Command: Sending command..."); + + mOnFailureCallback_5 = new chip::Callback::Callback( + OnTestSendClusterMediaInputCommandRenameInput_5_FailureResponse, this); + mOnSuccessCallback_5 = + new chip::Callback::Callback(OnTestSendClusterMediaInputCommandRenameInput_5_SuccessResponse, this); + + chip::Controller::MediaInputCluster cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + uint8_t indexArgument = 1; + chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("newName"), strlen("newName")); + err = cluster.RenameInput(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel(), indexArgument, nameArgument); + + if (CHIP_NO_ERROR != err) + { + delete mOnFailureCallback_5; + delete mOnSuccessCallback_5; + } + + return err; + } + + static void OnTestSendClusterMediaInputCommandRenameInput_5_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Media Input - Rename Input Command: Failure Response"); + + TV_MediaInputCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_5; + delete runner->mOnSuccessCallback_5; + + if (runner->mIsFailureExpected_5 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterMediaInputCommandRenameInput_5_SuccessResponse(void * context) + { + ChipLogProgress(chipTool, "Media Input - Rename Input Command: Success Response"); + + TV_MediaInputCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_5; + delete runner->mOnSuccessCallback_5; + + if (runner->mIsFailureExpected_5 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } }; class TestCluster : public TestCommand diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h index e12fcc97e816ee..d32273256c8ca3 100644 --- a/examples/tv-app/tv-common/gen/endpoint_config.h +++ b/examples/tv-app/tv-common/gen/endpoint_config.h @@ -1391,7 +1391,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 182 +#define GENERATED_ATTRIBUTE_COUNT 185 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1567,6 +1567,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4054) }, /* media input list */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Low Power (server) */ \ @@ -1582,6 +1583,8 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4816) }, /* application launcher list */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ + { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 2, Cluster: On/off (server) */ \ @@ -1735,55 +1738,55 @@ 0x0505, ZAP_ATTRIBUTE_INDEX(124), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(126), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(126), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(128), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(129), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(129), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(130), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(130), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(131), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(133), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(134), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(135), \ + ZAP_ATTRIBUTE_INDEX(138), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(137), \ + ZAP_ATTRIBUTE_INDEX(140), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 2, Cluster: Level Control (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(139), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(142), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Audio Output (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(142), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(145), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Media Playback (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(151), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(154), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(154), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(157), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(165), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Account Login (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(163), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(166), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(166), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(169), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(174), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(177), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ } @@ -1792,7 +1795,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 15, 3527 }, { ZAP_CLUSTER_INDEX(15), 9, 1639 }, { ZAP_CLUSTER_INDEX(24), 3, 263 }, \ + { ZAP_CLUSTER_INDEX(0), 15, 3527 }, { ZAP_CLUSTER_INDEX(15), 9, 1642 }, { ZAP_CLUSTER_INDEX(24), 3, 263 }, \ { ZAP_CLUSTER_INDEX(27), 4, 676 }, { ZAP_CLUSTER_INDEX(31), 2, 615 }, { ZAP_CLUSTER_INDEX(33), 1, 105 }, \ } @@ -1803,7 +1806,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (641) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (6825) +#define ATTRIBUTE_MAX_SIZE (6828) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (6) diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 01b30d6c9afbe7..5d3c22746c03b6 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -6307,6 +6307,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "current media input", + "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": "cluster revision", "code": 65533, @@ -6639,6 +6654,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "catalog vendor id", + "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": "application id", + "code": 2, + "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, diff --git a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml index 545623bd82dfa8..27c795a7a648e6 100644 --- a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml @@ -35,3 +35,24 @@ tests: value: 1 - name: "applicationId" value: "appId" + + # TODO: Enable this once struct as response type is supported + # response: + # values: + # - name: "status" + # value: 0 + # - name: "data" + # value: "data" + # TODO: Read attribute catalog vendor id and Read attribute catalog vendor id + # TODO: shoudl be one test, but currently struct as attribute is not supported + - label: "Read attribute catalog vendor id" + command: "readAttribute" + attribute: "catalog vendor id" + response: + value: 0 + + - label: "Read attribute application id" + command: "readAttribute" + attribute: "application id" + response: + value: 0 diff --git a/src/app/tests/suites/TV_MediaInputCluster.yaml b/src/app/tests/suites/TV_MediaInputCluster.yaml index 8f26fb10311501..b07076486f99ff 100644 --- a/src/app/tests/suites/TV_MediaInputCluster.yaml +++ b/src/app/tests/suites/TV_MediaInputCluster.yaml @@ -36,6 +36,12 @@ tests: - name: "index" value: 1 + - label: "Read current input list" + command: "readAttribute" + attribute: "current media input" + response: + value: 1 + - label: "Hide Input Status Command" command: "HideInputStatus" diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 913a394d462ce9..35216d8b2fe229 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -7825,6 +7825,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "current media input", + "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": "cluster revision", "code": 65533, @@ -8156,6 +8171,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "current audio output", + "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": "cluster revision", "code": 65533, @@ -8241,6 +8271,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "catalog vendor id", + "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": "application id", + "code": 2, + "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, diff --git a/src/controller/data_model/gen/CHIPClusters.cpp b/src/controller/data_model/gen/CHIPClusters.cpp index a2efa285655cc2..2b0c499c9bad37 100644 --- a/src/controller/data_model/gen/CHIPClusters.cpp +++ b/src/controller/data_model/gen/CHIPClusters.cpp @@ -348,6 +348,30 @@ CHIP_ERROR ApplicationLauncherCluster::ReadAttributeApplicationLauncherList(Call ApplicationLauncherClusterApplicationLauncherListListAttributeFilter); } +CHIP_ERROR ApplicationLauncherCluster::ReadAttributeCatalogVendorId(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0001; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR ApplicationLauncherCluster::ReadAttributeApplicationId(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0002; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + CHIP_ERROR ApplicationLauncherCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -465,6 +489,18 @@ CHIP_ERROR AudioOutputCluster::ReadAttributeAudioOutputList(Callback::Cancelable AudioOutputClusterAudioOutputListListAttributeFilter); } +CHIP_ERROR AudioOutputCluster::ReadAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0001; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + CHIP_ERROR AudioOutputCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -6133,6 +6169,18 @@ CHIP_ERROR MediaInputCluster::ReadAttributeMediaInputList(Callback::Cancelable * MediaInputClusterMediaInputListListAttributeFilter); } +CHIP_ERROR MediaInputCluster::ReadAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0001; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + CHIP_ERROR MediaInputCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/src/controller/data_model/gen/CHIPClusters.h b/src/controller/data_model/gen/CHIPClusters.h index 89e77da8de70d5..bed76bbfc7b39e 100644 --- a/src/controller/data_model/gen/CHIPClusters.h +++ b/src/controller/data_model/gen/CHIPClusters.h @@ -135,6 +135,8 @@ class DLL_EXPORT ApplicationLauncherCluster : public ClusterBase CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeApplicationLauncherList(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeCatalogVendorId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeApplicationId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: @@ -155,6 +157,7 @@ class DLL_EXPORT AudioOutputCluster : public ClusterBase // Cluster Attributes CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeAudioOutputList(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: @@ -889,6 +892,7 @@ class DLL_EXPORT MediaInputCluster : public ClusterBase // Cluster Attributes CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMediaInputList(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: diff --git a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h index f932e0ddf9eadf..a4889b2a70a212 100644 --- a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h +++ b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h @@ -190,6 +190,8 @@ chip::System::PacketBufferHandle encodeApplicationBasicClusterReadClusterRevisio |------------------------------------------------------------------------------| | Attributes: | | | * ApplicationLauncherList | 0x0000 | +| * CatalogVendorId | 0x0001 | +| * ApplicationId | 0x0002 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -208,6 +210,20 @@ chip::System::PacketBufferHandle encodeApplicationLauncherClusterDiscoverAttribu chip::System::PacketBufferHandle encodeApplicationLauncherClusterReadApplicationLauncherListAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +/** + * @brief + * Encode a Application Launcher server read command for the catalog vendor id attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeApplicationLauncherClusterReadCatalogVendorIdAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Application Launcher server read command for the application id attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeApplicationLauncherClusterReadApplicationIdAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /** * @brief * Encode a Application Launcher server read command for the cluster revision attribute into buffer including the APS frame @@ -224,6 +240,7 @@ chip::System::PacketBufferHandle encodeApplicationLauncherClusterReadClusterRevi |------------------------------------------------------------------------------| | Attributes: | | | * AudioOutputList | 0x0000 | +| * CurrentAudioOutput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -240,6 +257,13 @@ chip::System::PacketBufferHandle encodeAudioOutputClusterDiscoverAttributes(uint chip::System::PacketBufferHandle encodeAudioOutputClusterReadAudioOutputListAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +/** + * @brief + * Encode a Audio Output server read command for the current audio output attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeAudioOutputClusterReadCurrentAudioOutputAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /** * @brief * Encode a Audio Output server read command for the cluster revision attribute into buffer including the APS frame @@ -2061,6 +2085,7 @@ chip::System::PacketBufferHandle encodeLowPowerClusterReadClusterRevisionAttribu |------------------------------------------------------------------------------| | Attributes: | | | * MediaInputList | 0x0000 | +| * CurrentMediaInput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -2077,6 +2102,13 @@ chip::System::PacketBufferHandle encodeMediaInputClusterDiscoverAttributes(uint8 chip::System::PacketBufferHandle encodeMediaInputClusterReadMediaInputListAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +/** + * @brief + * Encode a Media Input server read command for the current media input attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeMediaInputClusterReadCurrentMediaInputAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /** * @brief * Encode a Media Input server read command for the cluster revision attribute into buffer including the APS frame diff --git a/src/controller/data_model/gen/encoder.cpp b/src/controller/data_model/gen/encoder.cpp index 76b72ca3d4a771..922545e7a00f55 100644 --- a/src/controller/data_model/gen/encoder.cpp +++ b/src/controller/data_model/gen/encoder.cpp @@ -289,6 +289,8 @@ PacketBufferHandle encodeApplicationBasicClusterReadClusterRevisionAttribute(uin |------------------------------------------------------------------------------| | Attributes: | | | * ApplicationLauncherList | 0x0000 | +| * CatalogVendorId | 0x0001 | +| * ApplicationId | 0x0002 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -313,6 +315,32 @@ PacketBufferHandle encodeApplicationLauncherClusterReadApplicationLauncherListAt COMMAND_FOOTER(); } +/* + * Attribute CatalogVendorId + */ +PacketBufferHandle encodeApplicationLauncherClusterReadCatalogVendorIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadApplicationLauncherCatalogVendorId", ApplicationLauncher::Id); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put32(Globals::Commands::Ids::ReadAttributes) + .Put32(ApplicationLauncher::Attributes::Ids::CatalogVendorId); + COMMAND_FOOTER(); +} + +/* + * Attribute ApplicationId + */ +PacketBufferHandle encodeApplicationLauncherClusterReadApplicationIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadApplicationLauncherApplicationId", ApplicationLauncher::Id); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put32(Globals::Commands::Ids::ReadAttributes) + .Put32(ApplicationLauncher::Attributes::Ids::ApplicationId); + COMMAND_FOOTER(); +} + /* * Attribute ClusterRevision */ @@ -335,6 +363,7 @@ PacketBufferHandle encodeApplicationLauncherClusterReadClusterRevisionAttribute( |------------------------------------------------------------------------------| | Attributes: | | | * AudioOutputList | 0x0000 | +| * CurrentAudioOutput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -358,6 +387,19 @@ PacketBufferHandle encodeAudioOutputClusterReadAudioOutputListAttribute(uint8_t COMMAND_FOOTER(); } +/* + * Attribute CurrentAudioOutput + */ +PacketBufferHandle encodeAudioOutputClusterReadCurrentAudioOutputAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadAudioOutputCurrentAudioOutput", AudioOutput::Id); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put32(Globals::Commands::Ids::ReadAttributes) + .Put32(AudioOutput::Attributes::Ids::CurrentAudioOutput); + COMMAND_FOOTER(); +} + /* * Attribute ClusterRevision */ @@ -3301,6 +3343,7 @@ PacketBufferHandle encodeLowPowerClusterReadClusterRevisionAttribute(uint8_t seq |------------------------------------------------------------------------------| | Attributes: | | | * MediaInputList | 0x0000 | +| * CurrentMediaInput | 0x0001 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -3324,6 +3367,19 @@ PacketBufferHandle encodeMediaInputClusterReadMediaInputListAttribute(uint8_t se COMMAND_FOOTER(); } +/* + * Attribute CurrentMediaInput + */ +PacketBufferHandle encodeMediaInputClusterReadCurrentMediaInputAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadMediaInputCurrentMediaInput", MediaInput::Id); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put32(Globals::Commands::Ids::ReadAttributes) + .Put32(MediaInput::Attributes::Ids::CurrentMediaInput); + COMMAND_FOOTER(); +} + /* * Attribute ClusterRevision */ diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 580ad583d7c6ab..f4109508e4d28a 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -476,6 +476,25 @@ CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList(ch gDefaultFailureCallback.Cancel()); } +CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCatalogVendorId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeApplicationId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -516,6 +535,15 @@ CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_AudioOutputList(chip::Controller:: gDefaultFailureCallback.Cancel()); } +CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentAudioOutput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) { @@ -2915,6 +2943,15 @@ CHIP_ERROR chip_ime_ReadAttribute_MediaInput_MediaInputList(chip::Controller::De gDefaultFailureCallback.Cancel()); } +CHIP_ERROR chip_ime_ReadAttribute_MediaInput_CurrentMediaInput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentMediaInput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + CHIP_ERROR chip_ime_ReadAttribute_MediaInput_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) { diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 95c359beeb0492..20fef58b03f735 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -770,6 +770,14 @@ def ListClusterAttributes(self): "attributeId": 0x0000, "type": "int", }, + "CatalogVendorId": { + "attributeId": 0x0001, + "type": "int", + }, + "ApplicationId": { + "attributeId": 0x0002, + "type": "int", + }, "ClusterRevision": { "attributeId": 0xFFFD, "type": "int", @@ -780,6 +788,10 @@ def ListClusterAttributes(self): "attributeId": 0x0000, "type": "", }, + "CurrentAudioOutput": { + "attributeId": 0x0001, + "type": "int", + }, "ClusterRevision": { "attributeId": 0xFFFD, "type": "int", @@ -1456,6 +1468,10 @@ def ListClusterAttributes(self): "attributeId": 0x0000, "type": "", }, + "CurrentMediaInput": { + "attributeId": 0x0001, + "type": "int", + }, "ClusterRevision": { "attributeId": 0xFFFD, "type": "int", @@ -2882,10 +2898,16 @@ def ClusterApplicationBasic_ReadAttributeClusterRevision(self, device: ctypes.c_ return self._chipLib.chip_ime_ReadAttribute_ApplicationBasic_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterApplicationLauncher_ReadAttributeApplicationLauncherList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList(device, ZCLendpoint, ZCLgroupid) + def ClusterApplicationLauncher_ReadAttributeCatalogVendorId(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId(device, ZCLendpoint, ZCLgroupid) + def ClusterApplicationLauncher_ReadAttributeApplicationId(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId(device, ZCLendpoint, ZCLgroupid) def ClusterApplicationLauncher_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterAudioOutput_ReadAttributeAudioOutputList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_AudioOutput_AudioOutputList(device, ZCLendpoint, ZCLgroupid) + def ClusterAudioOutput_ReadAttributeCurrentAudioOutput(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput(device, ZCLendpoint, ZCLgroupid) def ClusterAudioOutput_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_AudioOutput_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterBarrierControl_ReadAttributeBarrierMovingState(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): @@ -3249,6 +3271,8 @@ def ClusterLowPower_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, return self._chipLib.chip_ime_ReadAttribute_LowPower_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterMediaInput_ReadAttributeMediaInputList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_MediaInput_MediaInputList(device, ZCLendpoint, ZCLgroupid) + def ClusterMediaInput_ReadAttributeCurrentMediaInput(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_MediaInput_CurrentMediaInput(device, ZCLendpoint, ZCLgroupid) def ClusterMediaInput_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_MediaInput_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterMediaPlayback_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): @@ -3730,6 +3754,12 @@ def InitLib(self, chipLib): # Cluster ApplicationLauncher ReadAttribute ApplicationLauncherList self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList.restype = ctypes.c_uint32 + # Cluster ApplicationLauncher ReadAttribute CatalogVendorId + self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId.restype = ctypes.c_uint32 + # Cluster ApplicationLauncher ReadAttribute ApplicationId + self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId.restype = ctypes.c_uint32 # Cluster ApplicationLauncher ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision.restype = ctypes.c_uint32 @@ -3743,6 +3773,9 @@ def InitLib(self, chipLib): # Cluster AudioOutput ReadAttribute AudioOutputList self._chipLib.chip_ime_ReadAttribute_AudioOutput_AudioOutputList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_AudioOutput_AudioOutputList.restype = ctypes.c_uint32 + # Cluster AudioOutput ReadAttribute CurrentAudioOutput + self._chipLib.chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput.restype = ctypes.c_uint32 # Cluster AudioOutput ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_AudioOutput_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_AudioOutput_ClusterRevision.restype = ctypes.c_uint32 @@ -4534,6 +4567,9 @@ def InitLib(self, chipLib): # Cluster MediaInput ReadAttribute MediaInputList self._chipLib.chip_ime_ReadAttribute_MediaInput_MediaInputList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_MediaInput_MediaInputList.restype = ctypes.c_uint32 + # Cluster MediaInput ReadAttribute CurrentMediaInput + self._chipLib.chip_ime_ReadAttribute_MediaInput_CurrentMediaInput.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_MediaInput_CurrentMediaInput.restype = ctypes.c_uint32 # Cluster MediaInput ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_MediaInput_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_MediaInput_ClusterRevision.restype = ctypes.c_uint32 diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index 7352a6cc036898..61bd2978915499 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -86,6 +86,8 @@ NS_ASSUME_NONNULL_BEGIN responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler; - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -100,6 +102,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)selectOutput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentAudioOutputWithResponseHandler:(ResponseHandler)responseHandler; - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -758,6 +761,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)showInputStatus:(ResponseHandler)responseHandler; - (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentMediaInputWithResponseHandler:(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 13552d9589c353..42f37cb48d46ed 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -4066,6 +4066,60 @@ - (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler } } +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); + if (!onSuccess) { + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); + if (!onSuccess) { + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); @@ -4189,6 +4243,33 @@ - (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)respons } } +- (void)readAttributeCurrentAudioOutputWithResponseHandler:(ResponseHandler)responseHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); + if (!onSuccess) { + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeCurrentAudioOutput(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); @@ -11808,6 +11889,33 @@ - (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)response } } +- (void)readAttributeCurrentMediaInputWithResponseHandler:(ResponseHandler)responseHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); + if (!onSuccess) { + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeCurrentMediaInput(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 0bafee5cbd8175..ddb961903667ea 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -3129,6 +3129,44 @@ - (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherListWi [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterApplicationLauncherReadAttributeCatalogVendorIdWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationLauncherReadAttributeCatalogVendorIdWithResponseHandler"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCatalogVendorIdWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ApplicationLauncher CatalogVendorId Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterApplicationLauncherReadAttributeApplicationIdWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationIdWithResponseHandler"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeApplicationIdWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ApplicationLauncher ApplicationId Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterApplicationLauncherReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -3167,6 +3205,25 @@ - (void)testSendClusterAudioOutputReadAttributeAudioOutputListWithResponseHandle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterAudioOutputReadAttributeCurrentAudioOutputWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"AudioOutputReadAttributeCurrentAudioOutputWithResponseHandler"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentAudioOutputWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"AudioOutput CurrentAudioOutput Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterAudioOutputReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -5969,6 +6026,25 @@ - (void)testSendClusterMediaInputReadAttributeMediaInputListWithResponseHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterMediaInputReadAttributeCurrentMediaInputWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"MediaInputReadAttributeCurrentMediaInputWithResponseHandler"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentMediaInputWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"MediaInput CurrentMediaInput Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterMediaInputReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = From 16866d3edaec69de0bc253caa4cae0785e9c2016 Mon Sep 17 00:00:00 2001 From: Lukasz Gniadzik Date: Wed, 7 Jul 2021 23:46:50 +0200 Subject: [PATCH 06/47] Mbed: Add 'cortex-debug' vscode extension to devcontainer.json (#8122) The 'cortex-debug' vscode extension is used by mbed-os launch tasks during debug/flash processes. However, it looks like it is not installed automatically when opening vscode inside the container. To fix this, the 'cortex debug' has to be added to devcontainer.json file. --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 616a7dcd8afe7b..52c7b7e513acb6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -37,7 +37,8 @@ "redhat.vscode-yaml", "christian-kohler.path-intellisense", "knisterpeter.vscode-github", - "npclaudiu.vscode-gn" + "npclaudiu.vscode-gn", + "marus25.cortex-debug" ], // Use 'settings' to set *default* container specific settings.json values on container create. // You can edit these settings after create using File > Preferences > Settings > Remote. From 0c01fbfcb501c9d0731d51719b0e1e63ceb07770 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel <67607049+kpschoedel@users.noreply.github.com> Date: Wed, 7 Jul 2021 17:47:09 -0400 Subject: [PATCH 07/47] Clean up temporary error code macros added in PR#7916 (#8119) * #### Problem PR #7916 _Consolidate error types_ included some temporary definitions to avoid breaking any PRs in flight. #### Change overview - Removed the temporary definitions. - Updated names in recent PRs. #### Testing No changes to functionality. * missed esp32 example * missed Mbed mutex * missed chip-tool and more Mbed --- .../esp32/main/DeviceCallbacks.cpp | 2 +- .../chip-tool/commands/common/Command.cpp | 2 +- src/ble/BleError.h | 14 ---------- src/inet/IPEndPointBasis.cpp | 4 +-- src/inet/InetError.h | 16 ----------- src/lib/asn1/ASN1Error.h | 6 ---- .../tests/TestReliableMessageProtocol.cpp | 2 +- src/platform/mbed/BLEManagerImpl.cpp | 6 ---- src/platform/mbed/SystemTimeSupport.cpp | 28 +++++++++---------- src/system/SystemError.h | 15 ---------- src/system/SystemMutex.h | 4 +-- 11 files changed, 21 insertions(+), 78 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index 9c863579826f0a..21be643045fb58 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -164,7 +164,7 @@ void DeviceCallbacks::OnLevelControlAttributeChangeCallback(EndpointId endpointI return; } -void IdentifyTimerHandler(Layer * systemLayer, void * appState, Error error) +void IdentifyTimerHandler(Layer * systemLayer, void * appState, CHIP_ERROR error) { statusLED1.Animate(); diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 25ca0afad652f4..a0b3d5a6380a3a 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -413,7 +413,7 @@ void Command::WaitForResponse(uint16_t seconds) #else // CONFIG_USE_SEPARATE_EVENTLOOP -static void OnResponseTimeout(chip::System::Layer *, void *, chip::System::Error) +static void OnResponseTimeout(chip::System::Layer *, void *, CHIP_ERROR) { ChipLogError(chipTool, "No response from device"); diff --git a/src/ble/BleError.h b/src/ble/BleError.h index 2b0fb181ef0699..6526db95c0b954 100644 --- a/src/ble/BleError.h +++ b/src/ble/BleError.h @@ -310,20 +310,6 @@ * @} */ -// !!!!! IMPORTANT !!!!! -// These definitions are present temporarily in order to reduce breakage for PRs in flight. -// TODO: remove compatibility definitions -#define BLE_ERROR CHIP_ERROR -#define BLE_NO_ERROR CHIP_NO_ERROR -#define BLE_ERROR_BAD_ARGS CHIP_ERROR_INVALID_ARGUMENT -#define BLE_ERROR_INCORRECT_STATE CHIP_ERROR_INCORRECT_STATE -#define BLE_ERROR_MESSAGE_INCOMPLETE CHIP_ERROR_MESSAGE_INCOMPLETE -#define BLE_ERROR_NOT_IMPLEMENTED CHIP_ERROR_NOT_IMPLEMENTED -#define BLE_ERROR_NO_ENDPOINTS CHIP_ERROR_ENDPOINT_POOL_FULL -#define BLE_ERROR_NO_MEMORY CHIP_ERROR_NO_MEMORY -#define BLE_ERROR_OUTBOUND_MESSAGE_TOO_BIG CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG -#define BLE_ERROR_RECEIVED_MESSAGE_TOO_BIG CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG - // clang-format on namespace chip { diff --git a/src/inet/IPEndPointBasis.cpp b/src/inet/IPEndPointBasis.cpp index f5685fe8a0df30..5eb7d82d7724ca 100644 --- a/src/inet/IPEndPointBasis.cpp +++ b/src/inet/IPEndPointBasis.cpp @@ -1424,7 +1424,7 @@ CHIP_ERROR IPEndPointBasis::StartListener() case nw_listener_state_cancelled: ChipLogDetail(Inet, "Listener: Cancelled"); if (res == CHIP_NO_ERROR) - res = INET_ERROR_CONNECTION_ABORTED; + res = CHIP_ERROR_CONNECTION_ABORTED; dispatch_semaphore_signal(mListenerSemaphore); break; @@ -1480,7 +1480,7 @@ CHIP_ERROR IPEndPointBasis::StartConnection(nw_connection_t & aConnection) case nw_connection_state_cancelled: ChipLogDetail(Inet, "Connection: Cancelled"); if (res == CHIP_NO_ERROR) - res = INET_ERROR_CONNECTION_ABORTED; + res = CHIP_ERROR_CONNECTION_ABORTED; dispatch_semaphore_signal(mConnectionSemaphore); break; diff --git a/src/inet/InetError.h b/src/inet/InetError.h index 13e67f2318848e..a34690699b8624 100644 --- a/src/inet/InetError.h +++ b/src/inet/InetError.h @@ -236,22 +236,6 @@ * @} */ -// !!!!! IMPORTANT !!!!! -// These definitions are present temporarily in order to reduce breakage for PRs in flight. -// TODO: remove compatibility definitions -#define INET_ERROR CHIP_ERROR -#define INET_NO_ERROR CHIP_NO_ERROR -#define INET_ERROR_BAD_ARGS CHIP_ERROR_INVALID_ARGUMENT -#define INET_ERROR_INBOUND_MESSAGE_TOO_BIG CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG -#define INET_ERROR_INCORRECT_STATE CHIP_ERROR_INCORRECT_STATE -#define INET_ERROR_MESSAGE_TOO_LONG CHIP_ERROR_MESSAGE_TOO_LONG -#define INET_ERROR_NO_CONNECTION_HANDLER CHIP_ERROR_NO_CONNECTION_HANDLER -#define INET_ERROR_NO_ENDPOINTS CHIP_ERROR_ENDPOINT_POOL_FULL -#define INET_ERROR_NOT_IMPLEMENTED CHIP_ERROR_NOT_IMPLEMENTED -#define INET_ERROR_NOT_SUPPORTED CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE -#define INET_ERROR_NO_MEMORY CHIP_ERROR_NO_MEMORY -#define INET_ERROR_CONNECTION_ABORTED CHIP_ERROR_CONNECTION_ABORTED - // clang-format on namespace chip { diff --git a/src/lib/asn1/ASN1Error.h b/src/lib/asn1/ASN1Error.h index 1ee65dee6d9e46..4b94650b6d4b13 100644 --- a/src/lib/asn1/ASN1Error.h +++ b/src/lib/asn1/ASN1Error.h @@ -194,12 +194,6 @@ namespace ASN1 { * @} */ -// !!!!! IMPORTANT !!!!! -// These definitions are present temporarily in order to reduce breakage for PRs in flight. -// TODO: remove compatibility definitions -#define ASN1_ERROR CHIP_ERROR -#define ASN1_NO_ERROR CHIP_NO_ERROR - // clang-format on bool FormatASN1Error(char * buf, uint16_t bufSize, int32_t err); diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index a21a4e27629d71..f6c0c22ceecc1f 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -709,7 +709,7 @@ void CheckDuplicateMessage(nlTestSuite * inSuite, void * inContext) // 1 tick is 64 ms, sleep 65 ms to trigger first re-transmit test_os_sleep_ms(65); - ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_SYSTEM_NO_ERROR); + ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm, CHIP_NO_ERROR); // Ensure the retransmit message was sent and the ack was sent // and retransmit table was cleared diff --git a/src/platform/mbed/BLEManagerImpl.cpp b/src/platform/mbed/BLEManagerImpl.cpp index ffb66da8ed11b1..a57c82d6495fed 100644 --- a/src/platform/mbed/BLEManagerImpl.cpp +++ b/src/platform/mbed/BLEManagerImpl.cpp @@ -38,12 +38,6 @@ // Show BLE status with LEDs #define _BLEMGRIMPL_USE_LEDS 0 -/* Undefine the BLE_ERROR_NOT_IMPLEMENTED macro provided by CHIP's - * src/ble/BleError.h to avoid a name conflict with Mbed-OS ble_error_t - * enum value. For the enum values, see: - * mbed-os/connectivity/FEATURE_BLE/include/ble/common/blecommon.h - */ -#undef BLE_ERROR_NOT_IMPLEMENTED // mbed-os headers #include "ble/BLE.h" #include "ble/Gap.h" diff --git a/src/platform/mbed/SystemTimeSupport.cpp b/src/platform/mbed/SystemTimeSupport.cpp index 3669a88875da10..37b9e044eb0f4b 100644 --- a/src/platform/mbed/SystemTimeSupport.cpp +++ b/src/platform/mbed/SystemTimeSupport.cpp @@ -60,46 +60,46 @@ uint64_t GetClock_MonotonicHiRes() // Platform-specific function for getting the current real (civil) time in microsecond Unix time format, // where |curTime| argument is the current time, expressed as Unix time scaled to microseconds. -// Returns CHIP_SYSTEM_NO_ERROR if the method succeeded. -Error GetClock_RealTime(uint64_t & curTime) +// Returns CHIP_NO_ERROR if the method succeeded. +CHIP_ERROR GetClock_RealTime(uint64_t & curTime) { struct timeval tv; int res = gettimeofday(&tv, NULL); if (res != 0) { - return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE; + return CHIP_ERROR_INCORRECT_STATE; } if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD) { - return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED; + return CHIP_ERROR_REAL_TIME_NOT_SYNCED; } curTime = (tv.tv_sec * UINT64_C(1000000)) + tv.tv_usec; - return CHIP_SYSTEM_NO_ERROR; + return CHIP_NO_ERROR; } // Platform-specific function for getting the current real (civil) time in millisecond Unix time // where |curTimeMS| is the current time, expressed as Unix time scaled to milliseconds. -// Returns CHIP_SYSTEM_NO_ERROR if the method succeeded. -Error GetClock_RealTimeMS(uint64_t & curTimeMS) +// Returns CHIP_NO_ERROR if the method succeeded. +CHIP_ERROR GetClock_RealTimeMS(uint64_t & curTimeMS) { struct timeval tv; int res = gettimeofday(&tv, NULL); if (res != 0) { - return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE; + return CHIP_ERROR_INCORRECT_STATE; } if (tv.tv_sec < CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD) { - return CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED; + return CHIP_ERROR_REAL_TIME_NOT_SYNCED; } curTimeMS = (tv.tv_sec * UINT64_C(1000)) + (tv.tv_usec / 1000); - return CHIP_SYSTEM_NO_ERROR; + return CHIP_NO_ERROR; } // Platform-specific function for setting the current real (civil) time // where |newCurTime| is the new current time, expressed as Unix time scaled to microseconds. -// Returns CHIP_SYSTEM_NO_ERROR if the method succeeded. -Error SetClock_RealTime(uint64_t newCurTime) +// Returns CHIP_NO_ERROR if the method succeeded. +CHIP_ERROR SetClock_RealTime(uint64_t newCurTime) { struct timeval tv; tv.tv_sec = static_cast(newCurTime / UINT64_C(1000000)); @@ -107,7 +107,7 @@ Error SetClock_RealTime(uint64_t newCurTime) int res = settimeofday(&tv, NULL); if (res != 0) { - return CHIP_SYSTEM_ERROR_UNEXPECTED_STATE; + return CHIP_ERROR_INCORRECT_STATE; } #if CHIP_PROGRESS_LOGGING { @@ -120,7 +120,7 @@ Error SetClock_RealTime(uint64_t newCurTime) tv.tv_sec, year, month, dayOfMonth, hour, minute, second); } #endif // CHIP_PROGRESS_LOGGING - return CHIP_SYSTEM_NO_ERROR; + return CHIP_NO_ERROR; } } // namespace Layer diff --git a/src/system/SystemError.h b/src/system/SystemError.h index bc1667c7e33564..d2fb84645eb2f9 100644 --- a/src/system/SystemError.h +++ b/src/system/SystemError.h @@ -66,21 +66,6 @@ extern bool FormatLwIPError(char * buf, uint16_t bufSize, CHIP_ERROR err); // clang-format off -// !!!!! IMPORTANT !!!!! -// These definitions are present temporarily in order to reduce breakage for PRs in flight. -// TODO: remove compatibility definitions -using Error = CHIP_ERROR; -#define CHIP_SYSTEM_NO_ERROR CHIP_NO_ERROR -#define CHIP_SYSTEM_ERROR_ACCESS_DENIED CHIP_ERROR_ACCESS_DENIED -#define CHIP_SYSTEM_ERROR_BAD_ARGS CHIP_ERROR_INVALID_ARGUMENT -#define CHIP_SYSTEM_ERROR_NOT_SUPPORTED CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE -#define CHIP_SYSTEM_ERROR_NO_MEMORY CHIP_ERROR_NO_MEMORY -#define CHIP_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED CHIP_ERROR_REAL_TIME_NOT_SYNCED -#define CHIP_SYSTEM_ERROR_UNEXPECTED_EVENT CHIP_ERROR_UNEXPECTED_EVENT -#define CHIP_SYSTEM_ERROR_UNEXPECTED_STATE CHIP_ERROR_INCORRECT_STATE - -// clang-format on - } // namespace System } // namespace chip diff --git a/src/system/SystemMutex.h b/src/system/SystemMutex.h index 24fe262c72945d..8ba9fa395de960 100644 --- a/src/system/SystemMutex.h +++ b/src/system/SystemMutex.h @@ -124,11 +124,11 @@ inline void Mutex::Unlock(void) #endif // CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING #if CHIP_SYSTEM_CONFIG_MBED_LOCKING -inline Error Mutex::Init(Mutex & aMutex) +inline CHIP_ERROR Mutex::Init(Mutex & aMutex) { // The mutex is initialized when constructed and generates // a runtime error in case of failure. - return CHIP_SYSTEM_NO_ERROR; + return CHIP_NO_ERROR; } inline void Mutex::Lock() From 8b5b24fce6cb4633bdc32497e9ba8f24b732a587 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Wed, 7 Jul 2021 17:49:38 -0400 Subject: [PATCH 08/47] Add CHIP_Crypto_HMAC implementation (#8144) * Add CHIP_Crypto_HMAC implementation - CHIP_Crypto_HMAC primitive is needed to compute CASE destination ID. - Added OpenSSL and mbedTLS version. - Added basic unit test Testing done: unit test pass on OpenSSL and mbedTLS backends on Linux Issue #5934 * Restyled by clang-format * Fix Doxygen being pedantic about chevrons * added HMAC for HSM * updated HMAC HSM code * restyled Co-authored-by: Restyled.io Co-authored-by: Jagadish B E Co-authored-by: sujaygkulkarni --- src/crypto/BUILD.gn | 1 + src/crypto/CHIPCryptoPAL.h | 36 +++++- src/crypto/CHIPCryptoPALOpenSSL.cpp | 33 +++++ src/crypto/CHIPCryptoPALmbedTLS.cpp | 22 ++++ src/crypto/hsm/CHIPCryptoPALHsm.h | 21 ++++ src/crypto/hsm/CHIPCryptoPALHsm_config.h | 9 ++ .../hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp | 118 ++++++++++++++++++ .../hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h | 1 + src/crypto/tests/BUILD.gn | 1 + src/crypto/tests/CHIPCryptoPALTest.cpp | 28 +++++ src/crypto/tests/HMAC_SHA256_test_vectors.h | 70 +++++++++++ 11 files changed, 335 insertions(+), 5 deletions(-) create mode 100644 src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp create mode 100644 src/crypto/tests/HMAC_SHA256_test_vectors.h diff --git a/src/crypto/BUILD.gn b/src/crypto/BUILD.gn index 58a18f2935db33..b8b0086dbea049 100644 --- a/src/crypto/BUILD.gn +++ b/src/crypto/BUILD.gn @@ -88,6 +88,7 @@ static_library("crypto") { if (chip_with_se05x == 1) { sources += [ "hsm/nxp/CHIPCryptoPALHsm_SE05X_HKDF.cpp", + "hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp", "hsm/nxp/CHIPCryptoPALHsm_SE05X_P256.cpp", "hsm/nxp/CHIPCryptoPALHsm_SE05X_PBKDF.cpp", "hsm/nxp/CHIPCryptoPALHsm_SE05X_Spake2p.cpp", diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 7ff5548aff36a5..985f58daf4ac26 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -39,14 +39,14 @@ namespace Crypto { constexpr size_t kMax_x509_Certificate_Length = 600; -// TODO: Consider renaming these values to be closer to definisions in the spec: -// CHIP_CRYPTO_GROUP_SIZE_BYTES -// CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES constexpr size_t kP256_FE_Length = 32; constexpr size_t kP256_ECDSA_Signature_Length_Raw = (2 * kP256_FE_Length); constexpr size_t kP256_Point_Length = (2 * kP256_FE_Length + 1); constexpr size_t kSHA256_Hash_Length = 32; +constexpr size_t CHIP_CRYPTO_GROUP_SIZE_BYTES = kP256_FE_Length; +constexpr size_t CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES = kP256_Point_Length; + constexpr size_t kMax_ECDH_Secret_Length = kP256_FE_Length; constexpr size_t kMax_ECDSA_Signature_Length = 72; constexpr size_t kMAX_FE_Length = kP256_FE_Length; @@ -54,11 +54,13 @@ constexpr size_t kMAX_Point_Length = kP256_Point_Length; constexpr size_t kMAX_Hash_Length = kSHA256_Hash_Length; constexpr size_t kMAX_CSR_Length = 512; +constexpr size_t CHIP_CRYPTO_HASH_LEN_BYTES = kSHA256_Hash_Length; + constexpr size_t kMin_Salt_Length = 8; constexpr size_t kMax_Salt_Length = 16; -constexpr size_t kP256_PrivateKey_Length = 32; -constexpr size_t kP256_PublicKey_Length = 65; +constexpr size_t kP256_PrivateKey_Length = CHIP_CRYPTO_GROUP_SIZE_BYTES; +constexpr size_t kP256_PublicKey_Length = CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES; /* These sizes are hardcoded here to remove header dependency on underlying crypto library * in a public interface file. The validity of these sizes is verified by static_assert in @@ -430,6 +432,30 @@ class HKDF_sha const uint8_t * info, size_t info_length, uint8_t * out_buffer, size_t out_length); }; +class HMAC_sha +{ +public: + HMAC_sha() {} + virtual ~HMAC_sha() {} + + /** + * @brief A function that implements SHA-256 based HMAC per FIPS1981. + * + * The `out_length` must be at least CHIP_CRYPTO_HASH_LEN_BYTES + * + * @param key The key to use for the HMAC operation + * @param key_length Length of the key + * @param message Message over which to compute the HMAC + * @param message_length Length of the message over which to compute the HMAC + * @param out_buffer Pointer to buffer to write output into. + * @param out_length Resulting length of out_buffer + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ + + virtual CHIP_ERROR HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length); +}; + /** * @brief A cryptographically secure random number generator based on NIST SP800-90A * @param out_buffer Buffer to write random bytes into diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index c0bb69b1f65428..5edf9a0ba19cca 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -407,6 +407,39 @@ CHIP_ERROR HKDF_sha::HKDF_SHA256(const uint8_t * secret, const size_t secret_len return error; } +CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length) +{ + VerifyOrReturnError(key != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= CHIP_CRYPTO_HASH_LEN_BYTES, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR error = CHIP_ERROR_INTERNAL; + int error_openssl = 0; + unsigned int mac_out_len = 0; + + HMAC_CTX * mac_ctx = HMAC_CTX_new(); + VerifyOrExit(mac_ctx != nullptr, error = CHIP_ERROR_INTERNAL); + + error_openssl = HMAC_Init_ex(mac_ctx, Uint8::to_const_uchar(key), static_cast(key_length), EVP_sha256(), nullptr); + VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); + + error_openssl = HMAC_Update(mac_ctx, Uint8::to_const_uchar(message), message_length); + VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); + + mac_out_len = static_cast(CHIP_CRYPTO_HASH_LEN_BYTES); + error_openssl = HMAC_Final(mac_ctx, Uint8::to_uchar(out_buffer), &mac_out_len); + VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); + + error = CHIP_NO_ERROR; +exit: + HMAC_CTX_free(mac_ctx); + return error; +} + CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * password, size_t plen, const uint8_t * salt, size_t slen, unsigned int iteration_count, uint32_t key_length, uint8_t * output) { diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index 1b438f81f07928..197eb4d9996b20 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -274,6 +274,28 @@ CHIP_ERROR HKDF_sha::HKDF_SHA256(const uint8_t * secret, const size_t secret_len return CHIP_NO_ERROR; } +CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length) +{ + VerifyOrReturnError(key != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= CHIP_CRYPTO_HASH_LEN_BYTES, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + const mbedtls_md_info_t * const md = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + VerifyOrReturnError(md != nullptr, CHIP_ERROR_INTERNAL); + + const int result = + mbedtls_md_hmac(md, Uint8::to_const_uchar(key), key_length, Uint8::to_const_uchar(message), message_length, out_buffer); + + _log_mbedTLS_error(result); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * password, size_t plen, const uint8_t * salt, size_t slen, unsigned int iteration_count, uint32_t key_length, uint8_t * output) { diff --git a/src/crypto/hsm/CHIPCryptoPALHsm.h b/src/crypto/hsm/CHIPCryptoPALHsm.h index 89c99bcb6f36ff..a5b763016f0356 100644 --- a/src/crypto/hsm/CHIPCryptoPALHsm.h +++ b/src/crypto/hsm/CHIPCryptoPALHsm.h @@ -187,6 +187,27 @@ class HKDF_shaHSM : public HKDF_sha #endif //#if ENABLE_HSM_HKDF_SHA256 +#if ENABLE_HSM_HMAC_SHA256 + +class HMAC_shaHSM : public HMAC_sha +{ +public: + HMAC_shaHSM(); + ~HMAC_shaHSM(); + + virtual CHIP_ERROR HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length); + + void SetKeyId(uint32_t id) { keyid = id; } + + uint32_t GetKeyId() { return keyid; } + +private: + uint32_t keyid; +}; + +#endif //#if ENABLE_HSM_HMAC_SHA256 + } // namespace Crypto } // namespace chip diff --git a/src/crypto/hsm/CHIPCryptoPALHsm_config.h b/src/crypto/hsm/CHIPCryptoPALHsm_config.h index a04db54104ffb4..c1aa6a1fd6e05b 100644 --- a/src/crypto/hsm/CHIPCryptoPALHsm_config.h +++ b/src/crypto/hsm/CHIPCryptoPALHsm_config.h @@ -48,6 +48,11 @@ */ #define ENABLE_HSM_HKDF_SHA256 1 +/* + * Enable HSM for HMAC SHA256 + */ +#define ENABLE_HSM_HMAC_SHA256 1 + #if ((CHIP_CRYPTO_HSM) && ((ENABLE_HSM_SPAKE_VERIFIER) || (ENABLE_HSM_SPAKE_PROVER))) #define ENABLE_HSM_SPAKE #endif @@ -66,4 +71,8 @@ #define ENABLE_HSM_HKDF #endif +#if ((CHIP_CRYPTO_HSM) && (ENABLE_HSM_HMAC_SHA256)) +#define ENABLE_HSM_HMAC +#endif + #endif //#ifndef _CHIP_CRYPTO_PAL_HSM_CONFIG_H_ diff --git a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp new file mode 100644 index 00000000000000..a022f79ec7498a --- /dev/null +++ b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_HMAC.cpp @@ -0,0 +1,118 @@ +/* + * + * 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 + * HSM based implementation of CHIP crypto primitives + * Based on configurations in CHIPCryptoPALHsm_config.h file, + * chip crypto apis use either HSM or rollback to software implementation. + */ + +#include "CHIPCryptoPALHsm_SE05X_utils.h" +#include + +#if ENABLE_HSM_HMAC_SHA256 + +#define MAX_MAC_ONE_SHOT_DATA_LEN 900 + +namespace chip { +namespace Crypto { + +HMAC_shaHSM::HMAC_shaHSM() +{ + keyid = kKeyId_hmac_sha256_keyid; +} +HMAC_shaHSM::~HMAC_shaHSM() {} + +CHIP_ERROR HMAC_shaHSM::HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length) + +{ + sss_mac_t ctx_mac = { 0 }; + sss_object_t keyObject = { 0 }; + + VerifyOrReturnError(key != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= CHIP_CRYPTO_HASH_LEN_BYTES, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + if (key_length > 256) + { + return HMAC_sha::HMAC_SHA256(key, key_length, message, message_length, out_buffer, out_length); + } + + VerifyOrReturnError(keyid != kKeyId_NotInitialized, CHIP_ERROR_HSM); + + se05x_sessionOpen(); + VerifyOrReturnError(gex_sss_chip_ctx.ks.session != NULL, CHIP_ERROR_INTERNAL); + + sss_status_t status = sss_key_object_init(&keyObject, &gex_sss_chip_ctx.ks); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + status = sss_key_object_allocate_handle(&keyObject, keyid, kSSS_KeyPart_Default, kSSS_CipherType_HMAC, key_length, + kKeyObject_Mode_Transient); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + status = sss_key_store_set_key(&gex_sss_chip_ctx.ks, &keyObject, key, key_length, key_length * 8, NULL, 0); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + status = sss_mac_context_init(&ctx_mac, &gex_sss_chip_ctx.session, &keyObject, kAlgorithm_SSS_HMAC_SHA256, kMode_SSS_Mac); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + if (message_length <= MAX_MAC_ONE_SHOT_DATA_LEN) + { + status = sss_mac_one_go(&ctx_mac, message, message_length, out_buffer, &out_length); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + } + else + { + /* Calculate MAC using multistep calls */ + size_t datalenTemp = 0; + size_t rem_len = message_length; + + status = sss_mac_init(&ctx_mac); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + while (rem_len > 0) + { + datalenTemp = (rem_len > MAX_MAC_ONE_SHOT_DATA_LEN) ? MAX_MAC_ONE_SHOT_DATA_LEN : rem_len; + status = sss_mac_update(&ctx_mac, (message + (message_length - rem_len)), datalenTemp); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + rem_len = rem_len - datalenTemp; + } + + status = sss_mac_finish(&ctx_mac, out_buffer, &out_length); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + } + + status = sss_key_store_erase_key(&gex_sss_chip_ctx.ks, &keyObject); + VerifyOrReturnError(status == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); + + if (ctx_mac.session != NULL) + { + sss_mac_context_free(&ctx_mac); + } + + return CHIP_NO_ERROR; +} + +} // namespace Crypto +} // namespace chip + +#endif //#if ENABLE_HSM_HMAC_SHA256 diff --git a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h index 5b50539f38debc..ec9c5f4975a083 100644 --- a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h +++ b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h @@ -45,6 +45,7 @@ enum keyid_values kKeyId_NotInitialized = 0, kKeyId_pbkdf2_sha256_hmac_keyid = 0xBCBCBCBC, kKeyId_hkdf_sha256_hmac_keyid, + kKeyId_hmac_sha256_keyid, kKeyId_sha256_ecc_pub_keyid, }; diff --git a/src/crypto/tests/BUILD.gn b/src/crypto/tests/BUILD.gn index dac85992799849..c355a4f040e42e 100644 --- a/src/crypto/tests/BUILD.gn +++ b/src/crypto/tests/BUILD.gn @@ -27,6 +27,7 @@ chip_test_suite("tests") { "CHIPCryptoPALTest.cpp", "ECDH_P256_test_vectors.h", "HKDF_SHA256_test_vectors.h", + "HMAC_SHA256_test_vectors.h", "Hash_SHA256_test_vectors.h", "PBKDF2_SHA256_test_vectors.h", "PBKDF2_SHA256_test_vectors.h", diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index 33d6526d5f1f6c..c0f74a638a9fd0 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -21,6 +21,7 @@ #include "AES_CCM_256_test_vectors.h" #include "ECDH_P256_test_vectors.h" #include "HKDF_SHA256_test_vectors.h" +#include "HMAC_SHA256_test_vectors.h" #include "Hash_SHA256_test_vectors.h" #include "PBKDF2_SHA256_test_vectors.h" @@ -90,6 +91,12 @@ using TestHKDF_sha = HKDF_shaHSM; using TestHKDF_sha = HKDF_sha; #endif +#ifdef ENABLE_HSM_HMAC +using TestHMAC_sha = HMAC_shaHSM; +#else +using TestHMAC_sha = HMAC_sha; +#endif + static uint32_t gs_test_entropy_source_called = 0; static int test_entropy_source(void * data, uint8_t * output, size_t len, size_t * olen) { @@ -652,6 +659,26 @@ static void TestHash_SHA256_Stream(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, numOfTestsExecuted == ArraySize(hash_sha256_test_vectors)); } +static void TestHMAC_SHA256(nlTestSuite * inSuite, void * inContext) +{ + int numOfTestCases = ArraySize(hmac_sha256_test_vectors); + int numOfTestsExecuted = 0; + TestHMAC_sha mHMAC; + + for (numOfTestsExecuted = 0; numOfTestsExecuted < numOfTestCases; numOfTestsExecuted++) + { + hmac_sha256_vector v = hmac_sha256_test_vectors[numOfTestsExecuted]; + size_t out_length = v.output_hash_length; + chip::Platform::ScopedMemoryBuffer out_buffer; + out_buffer.Alloc(out_length); + NL_TEST_ASSERT(inSuite, out_buffer); + mHMAC.HMAC_SHA256(v.key, v.key_length, v.message, v.message_length, out_buffer.Get(), v.output_hash_length); + bool success = memcmp(v.output_hash, out_buffer.Get(), out_length) == 0; + NL_TEST_ASSERT(inSuite, success); + } + NL_TEST_ASSERT(inSuite, numOfTestsExecuted == numOfTestCases); +} + static void TestHKDF_SHA256(nlTestSuite * inSuite, void * inContext) { int numOfTestCases = ArraySize(hkdf_sha256_test_vectors); @@ -1521,6 +1548,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test Hash SHA 256", TestHash_SHA256), NL_TEST_DEF("Test Hash SHA 256 Stream", TestHash_SHA256_Stream), NL_TEST_DEF("Test HKDF SHA 256", TestHKDF_SHA256), + NL_TEST_DEF("Test HMAC SHA 256", TestHMAC_SHA256), NL_TEST_DEF("Test DRBG invalid inputs", TestDRBG_InvalidInputs), NL_TEST_DEF("Test DRBG output", TestDRBG_Output), NL_TEST_DEF("Test ECDH derive shared secret", TestECDH_EstablishSecret), diff --git a/src/crypto/tests/HMAC_SHA256_test_vectors.h b/src/crypto/tests/HMAC_SHA256_test_vectors.h new file mode 100644 index 00000000000000..7e46f97386f631 --- /dev/null +++ b/src/crypto/tests/HMAC_SHA256_test_vectors.h @@ -0,0 +1,70 @@ +/* + * + * 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 - This file contains HMAC SHA256 test vectors. + * + * See https://tools.ietf.org/html/rfc4231#section-4.7 + */ + +#ifndef _HMAC_SHA256_TEST_VECTOR +#define _HMAC_SHA256_TEST_VECTOR + +#include +#include + +typedef struct hmac_sha256_vector +{ + const uint8_t * key; + const size_t key_length; + const uint8_t * message; + const size_t message_length; + const uint8_t * output_hash; + const size_t output_hash_length; +} hmac_sha256_vector; + +// Basic test case +const uint8_t kHmacTestCase1Key[131] = { + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, +}; + +const uint8_t kHmacTestCase1Message[54] = { + 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, + 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x4b, 0x65, + 0x79, 0x20, 0x2d, 0x20, 0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x46, 0x69, 0x72, 0x73, 0x74, +}; + +const uint8_t kHmacTestCase1Expected[32] = { + 0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f, 0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f, + 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54, +}; + +hmac_sha256_vector kHmacSha256TestCase1 = { .key = kHmacTestCase1Key, + .key_length = sizeof(kHmacTestCase1Key), + .message = kHmacTestCase1Message, + .message_length = sizeof(kHmacTestCase1Message), + .output_hash = kHmacTestCase1Expected, + .output_hash_length = sizeof(kHmacTestCase1Expected) }; + +hmac_sha256_vector hmac_sha256_test_vectors[] = { kHmacSha256TestCase1 }; +#endif From b0625f9845e1818f8294f0e542885e8a281f2581 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Thu, 8 Jul 2021 03:44:48 -0400 Subject: [PATCH 09/47] Minor clean-ups in src/crypto (#8182) - Replace all header guards with `#pragma once` that were not already. - Replace "specific" implementation of HMAC in SPAKE2P impl with the common HMAC method, saving bytes overall once HMAC is more frequently used outside of SPAKE2P - Minor typo fixes and some added context to comments Testing done: ran OpenSSL and mbedTLS unit tests --- src/crypto/CHIPCryptoPAL.h | 5 +--- src/crypto/CHIPCryptoPALOpenSSL.cpp | 27 ++----------------- src/crypto/CHIPCryptoPALmbedTLS.cpp | 27 ++----------------- src/crypto/hsm/CHIPCryptoPALHsm.h | 5 +--- src/crypto/hsm/CHIPCryptoPALHsm_config.h | 5 +--- .../hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h | 5 +--- src/crypto/tests/AES_CCM_256_test_vectors.h | 4 +-- src/crypto/tests/ECDH_P256_test_vectors.h | 4 +-- src/crypto/tests/HKDF_SHA256_test_vectors.h | 4 +-- src/crypto/tests/HMAC_SHA256_test_vectors.h | 4 +-- src/crypto/tests/Hash_SHA256_test_vectors.h | 4 +-- .../tests/SPAKE2P_FE_MUL_test_vectors.h | 5 +--- src/crypto/tests/SPAKE2P_FE_RW_test_vectors.h | 5 +--- src/crypto/tests/SPAKE2P_HMAC_test_vectors.h | 7 ++--- .../SPAKE2P_POINT_MUL_ADD_test_vectors.h | 7 ++--- .../tests/SPAKE2P_POINT_MUL_test_vectors.h | 7 ++--- .../tests/SPAKE2P_POINT_RW_test_vectors.h | 5 +--- .../tests/SPAKE2P_POINT_VALID_test_vectors.h | 5 +--- src/crypto/tests/SPAKE2P_RFC_test_vectors.h | 5 +--- .../tests/X509_PKCS7Extraction_test_vectors.h | 5 +--- 20 files changed, 25 insertions(+), 120 deletions(-) diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 985f58daf4ac26..1f98534704a1f5 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -20,8 +20,7 @@ * Header that exposes the platform agnostic CHIP crypto primitives */ -#ifndef _CHIP_CRYPTO_PAL_H_ -#define _CHIP_CRYPTO_PAL_H_ +#pragma once #if CHIP_HAVE_CONFIG_H #include @@ -946,5 +945,3 @@ CHIP_ERROR ExtractPubkeyFromX509Cert(const ByteSpan & certificate, Crypto::P256P } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index 5edf9a0ba19cca..72ada5d7ad0565 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -1331,31 +1331,8 @@ void Spake2p_P256_SHA256_HKDF_HMAC::FreeImpl() CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::Mac(const uint8_t * key, size_t key_len, const uint8_t * in, size_t in_len, uint8_t * out) { - CHIP_ERROR error = CHIP_ERROR_INTERNAL; - int error_openssl = 0; - unsigned int mac_out_len = 0; - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - HMAC_CTX * mac_ctx = HMAC_CTX_new(); - VerifyOrExit(mac_ctx != nullptr, error = CHIP_ERROR_INTERNAL); - - VerifyOrExit(CanCastTo(key_len), error = CHIP_ERROR_INTERNAL); - error_openssl = HMAC_Init_ex(mac_ctx, Uint8::to_const_uchar(key), static_cast(key_len), context->md_info, nullptr); - VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); - - error_openssl = HMAC_Update(mac_ctx, Uint8::to_const_uchar(in), in_len); - VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); - - VerifyOrExit(CanCastTo(hash_size), error = CHIP_ERROR_INTERNAL); - mac_out_len = static_cast(hash_size); - error_openssl = HMAC_Final(mac_ctx, Uint8::to_uchar(out), &mac_out_len); - VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); - - error = CHIP_NO_ERROR; -exit: - HMAC_CTX_free(mac_ctx); - return error; + HMAC_sha hmac; + return hmac.HMAC_SHA256(key, key_len, in, in_len, out, kSHA256_Hash_Length); } CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::MacVerify(const uint8_t * key, size_t key_len, const uint8_t * mac, size_t mac_len, diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index 197eb4d9996b20..f377e4815e5df8 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -951,31 +951,8 @@ void Spake2p_P256_SHA256_HKDF_HMAC::FreeImpl(void) CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::Mac(const uint8_t * key, size_t key_len, const uint8_t * in, size_t in_len, uint8_t * out) { - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - mbedtls_md_context_t hmac_ctx; - mbedtls_md_init(&hmac_ctx); - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - result = mbedtls_md_setup(&hmac_ctx, context->md_info, 1); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_md_hmac_starts(&hmac_ctx, Uint8::to_const_uchar(key), key_len); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_md_hmac_update(&hmac_ctx, Uint8::to_const_uchar(in), in_len); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_md_hmac_finish(&hmac_ctx, Uint8::to_uchar(out)); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - - mbedtls_md_free(&hmac_ctx); - return error; + HMAC_sha hmac; + return hmac.HMAC_SHA256(key, key_len, in, in_len, out, kSHA256_Hash_Length); } /** diff --git a/src/crypto/hsm/CHIPCryptoPALHsm.h b/src/crypto/hsm/CHIPCryptoPALHsm.h index a5b763016f0356..a00106a1540093 100644 --- a/src/crypto/hsm/CHIPCryptoPALHsm.h +++ b/src/crypto/hsm/CHIPCryptoPALHsm.h @@ -20,8 +20,7 @@ * Header that exposes the platform agnostic CHIP crypto primitives */ -#ifndef _CHIP_CRYPTO_PAL_HSM_H_ -#define _CHIP_CRYPTO_PAL_HSM_H_ +#pragma once #include "CHIPCryptoPALHsm_config.h" @@ -210,5 +209,3 @@ class HMAC_shaHSM : public HMAC_sha } // namespace Crypto } // namespace chip - -#endif //#ifndef _CHIP_CRYPTO_PAL_HSM_H_ diff --git a/src/crypto/hsm/CHIPCryptoPALHsm_config.h b/src/crypto/hsm/CHIPCryptoPALHsm_config.h index c1aa6a1fd6e05b..73d435335a6ac9 100644 --- a/src/crypto/hsm/CHIPCryptoPALHsm_config.h +++ b/src/crypto/hsm/CHIPCryptoPALHsm_config.h @@ -20,8 +20,7 @@ * Header that exposes the options to enable HSM for required crypto operations. */ -#ifndef _CHIP_CRYPTO_PAL_HSM_CONFIG_H_ -#define _CHIP_CRYPTO_PAL_HSM_CONFIG_H_ +#pragma once /* * Enable HSM for SPAKE VERIFIER @@ -74,5 +73,3 @@ #if ((CHIP_CRYPTO_HSM) && (ENABLE_HSM_HMAC_SHA256)) #define ENABLE_HSM_HMAC #endif - -#endif //#ifndef _CHIP_CRYPTO_PAL_HSM_CONFIG_H_ diff --git a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h index ec9c5f4975a083..8fbefc252c1722 100644 --- a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h +++ b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_utils.h @@ -15,8 +15,7 @@ * limitations under the License. */ -#ifndef _CHIP_CRYPTO_PAL_HSM_SE05X_UTILS_ -#define _CHIP_CRYPTO_PAL_HSM_SE05X_UTILS_ +#pragma once #include @@ -98,5 +97,3 @@ void setObjID(SE05x_CryptoObjectID_t objId, uint8_t status); #ifdef __cplusplus } #endif - -#endif /*_CHIP_CRYPTO_PAL_HSM_SE05X_UTILS_*/ diff --git a/src/crypto/tests/AES_CCM_256_test_vectors.h b/src/crypto/tests/AES_CCM_256_test_vectors.h index 35acec97add531..6adb5e1e887074 100644 --- a/src/crypto/tests/AES_CCM_256_test_vectors.h +++ b/src/crypto/tests/AES_CCM_256_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains AES-CCM test vectors. */ -#ifndef _AES_CCM_256_TEST_VECTORS_H_ -#define _AES_CCM_256_TEST_VECTORS_H_ +#pragma once typedef struct ccm_test_vector { @@ -1527,4 +1526,3 @@ static const struct ccm_test_vector chiptest_12cb0ed34854_test_vector_1471 = { . static const struct ccm_test_vector * ccm_invalid_test_vectors[] = { &chiptest_12cb0ed34854_test_vector_3781, &chiptest_12cb0ed34854_test_vector_1471 }; -#endif diff --git a/src/crypto/tests/ECDH_P256_test_vectors.h b/src/crypto/tests/ECDH_P256_test_vectors.h index 6df0c5cf0164b1..17fbd206c4fe1c 100644 --- a/src/crypto/tests/ECDH_P256_test_vectors.h +++ b/src/crypto/tests/ECDH_P256_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains ECDH P256 test vectors. */ -#ifndef _ECDH_P256_TEST_VECTORS_H_ -#define _ECDH_P256_TEST_VECTORS_H_ +#pragma once typedef struct ECDH_P256_test_vector { @@ -92,4 +91,3 @@ ECDH_P256_test_vector ecdh_v3 = { .local_pvt_key = local_private_key3, .shared_secret_length = sizeof(shared_secret3) }; ECDH_P256_test_vector ecdh_test_vectors[] = { ecdh_v1, ecdh_v2, ecdh_v3 }; -#endif diff --git a/src/crypto/tests/HKDF_SHA256_test_vectors.h b/src/crypto/tests/HKDF_SHA256_test_vectors.h index 02a22c71987a39..75d45bd8d93198 100644 --- a/src/crypto/tests/HKDF_SHA256_test_vectors.h +++ b/src/crypto/tests/HKDF_SHA256_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains HKDF SHA256 test vectors. https://tools.ietf.org/html/rfc5869 */ -#ifndef _HKDF_SHA256_TEST_VECTOR -#define _HKDF_SHA256_TEST_VECTOR +#pragma once #include @@ -121,4 +120,3 @@ hkdf_sha256_vector v3 = { .initial_key_material = IKM3, .output_key_material_length = sizeof(expected_OKM3) }; hkdf_sha256_vector hkdf_sha256_test_vectors[] = { v1, v2, v3 }; -#endif diff --git a/src/crypto/tests/HMAC_SHA256_test_vectors.h b/src/crypto/tests/HMAC_SHA256_test_vectors.h index 7e46f97386f631..4a8b5746ed7be8 100644 --- a/src/crypto/tests/HMAC_SHA256_test_vectors.h +++ b/src/crypto/tests/HMAC_SHA256_test_vectors.h @@ -21,8 +21,7 @@ * See https://tools.ietf.org/html/rfc4231#section-4.7 */ -#ifndef _HMAC_SHA256_TEST_VECTOR -#define _HMAC_SHA256_TEST_VECTOR +#pragma once #include #include @@ -67,4 +66,3 @@ hmac_sha256_vector kHmacSha256TestCase1 = { .key = kHmacTestCase1 .output_hash_length = sizeof(kHmacTestCase1Expected) }; hmac_sha256_vector hmac_sha256_test_vectors[] = { kHmacSha256TestCase1 }; -#endif diff --git a/src/crypto/tests/Hash_SHA256_test_vectors.h b/src/crypto/tests/Hash_SHA256_test_vectors.h index 62825c7e8bbc2d..fc2683e05da3cc 100644 --- a/src/crypto/tests/Hash_SHA256_test_vectors.h +++ b/src/crypto/tests/Hash_SHA256_test_vectors.h @@ -21,8 +21,7 @@ * http://csrc.nist.gov/groups/STM/cavp/index.html */ -#ifndef _HASH_SHA256_TEST_VECTOR -#define _HASH_SHA256_TEST_VECTOR +#pragma once #include @@ -164,4 +163,3 @@ const uint8_t hash11[] = { 0x6c, 0x83, 0xf9, 0xb6, 0x97, 0x54, 0xfa, 0xcc, 0x31, hash_sha256_vector v11 = { .data = data11, .data_length = sizeof(data11), .hash = hash11 }; hash_sha256_vector hash_sha256_test_vectors[] = { v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11 }; -#endif diff --git a/src/crypto/tests/SPAKE2P_FE_MUL_test_vectors.h b/src/crypto/tests/SPAKE2P_FE_MUL_test_vectors.h index a8ac3d31fa0395..86f94b3d3e441c 100644 --- a/src/crypto/tests/SPAKE2P_FE_MUL_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_FE_MUL_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains field element multipication test vectors. */ -#ifndef _SPAKE2P_FE_MUL_TEST_VECTORS_H_ -#define _SPAKE2P_FE_MUL_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -387,5 +386,3 @@ static const struct spake2p_fe_mul_tv * fe_mul_tvs[] = { } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_FE_RW_test_vectors.h b/src/crypto/tests/SPAKE2P_FE_RW_test_vectors.h index 9dece772df7706..66fbd54151af20 100644 --- a/src/crypto/tests/SPAKE2P_FE_RW_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_FE_RW_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains read / write field element test vectors. */ -#ifndef _SPAKE2P_FE_RW_TEST_VECTORS_H_ -#define _SPAKE2P_FE_RW_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -120,5 +119,3 @@ static const struct spake2p_fe_rw_tv * fe_rw_tvs[] = { &chiptest_53ea71b7cccd_te } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_HMAC_test_vectors.h b/src/crypto/tests/SPAKE2P_HMAC_test_vectors.h index 615bfb5d753883..dd1f083195d299 100644 --- a/src/crypto/tests/SPAKE2P_HMAC_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_HMAC_test_vectors.h @@ -16,11 +16,10 @@ */ /** - * @file - This file contains hmac test vectors. + * @file - This file contains SPAKE2P HMAC test vectors. */ -#ifndef _SPAKE2P_FE_HMAC_TEST_VECTORS_H_ -#define _SPAKE2P_FE_HMAC_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -131,5 +130,3 @@ static const struct spake2p_hmac_tv * hmac_tvs[] = { &chiptest_be68c22260b3_test } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_POINT_MUL_ADD_test_vectors.h b/src/crypto/tests/SPAKE2P_POINT_MUL_ADD_test_vectors.h index df1415032ef12f..f4f37fdf670e6e 100644 --- a/src/crypto/tests/SPAKE2P_POINT_MUL_ADD_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_POINT_MUL_ADD_test_vectors.h @@ -16,11 +16,10 @@ */ /** - * @file - This file contains point multipication & addition test vectors. + * @file - This file contains elliptic curve point multiplication & addition test vectors. */ -#ifndef _SPAKE2P_POINT_MUL_ADD_TEST_VECTORS_H_ -#define _SPAKE2P_POINT_MUL_ADD_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -772,5 +771,3 @@ static const struct spake2p_point_muladd_tv * point_muladd_tvs[] = { } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_POINT_MUL_test_vectors.h b/src/crypto/tests/SPAKE2P_POINT_MUL_test_vectors.h index 374fe90850850b..fca6caa99ce7db 100644 --- a/src/crypto/tests/SPAKE2P_POINT_MUL_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_POINT_MUL_test_vectors.h @@ -16,11 +16,10 @@ */ /** - * @file - This file contains point multipication test vectors. + * @file - This file contains elliptic curve point multipication test vectors. */ -#ifndef _SPAKE2P_POINT_MUL_TEST_VECTORS_H_ -#define _SPAKE2P_POINT_MUL_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -508,5 +507,3 @@ static const struct spake2p_point_mul_tv * point_mul_tvs[] = { } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_POINT_RW_test_vectors.h b/src/crypto/tests/SPAKE2P_POINT_RW_test_vectors.h index 76a2fe59e0a74d..91b487ea5f7b1f 100644 --- a/src/crypto/tests/SPAKE2P_POINT_RW_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_POINT_RW_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains point r/w test vectors. */ -#ifndef _SPAKE2P_POINT_RW_TEST_VECTORS_H_ -#define _SPAKE2P_POINT_RW_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -140,5 +139,3 @@ static const struct spake2p_point_rw_tv * point_rw_tvs[] = { } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_POINT_VALID_test_vectors.h b/src/crypto/tests/SPAKE2P_POINT_VALID_test_vectors.h index ee77d91d187da1..5dc6210551a8ec 100644 --- a/src/crypto/tests/SPAKE2P_POINT_VALID_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_POINT_VALID_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains point validity test vectors. */ -#ifndef _SPAKE2P_POINT_VALID_TEST_VECTORS_H_ -#define _SPAKE2P_POINT_VALID_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -491,5 +490,3 @@ static const struct spake2p_point_valid_tv * point_valid_tvs[] = { } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/SPAKE2P_RFC_test_vectors.h b/src/crypto/tests/SPAKE2P_RFC_test_vectors.h index 20a77596a7a874..8d1efd5149b158 100644 --- a/src/crypto/tests/SPAKE2P_RFC_test_vectors.h +++ b/src/crypto/tests/SPAKE2P_RFC_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains Spake2+ RFC test vectors. */ -#ifndef _SPAKE2P_POINT_RFC_TEST_VECTORS_H_ -#define _SPAKE2P_POINT_RFC_TEST_VECTORS_H_ +#pragma once namespace chip { namespace Crypto { @@ -441,5 +440,3 @@ static const struct spake2p_rfc_tv * rfc_tvs[] = { &chiptest_e4836c3b50dd_test_v } // namespace Crypto } // namespace chip - -#endif diff --git a/src/crypto/tests/X509_PKCS7Extraction_test_vectors.h b/src/crypto/tests/X509_PKCS7Extraction_test_vectors.h index 008414a6b0a187..e9087b24b99551 100644 --- a/src/crypto/tests/X509_PKCS7Extraction_test_vectors.h +++ b/src/crypto/tests/X509_PKCS7Extraction_test_vectors.h @@ -19,8 +19,7 @@ * @file - This file contains PKCS7 test vectors. */ -#ifndef _X509_PKCS7_EXTRACTION_H_ -#define _X509_PKCS7_EXTRACTION_H_ +#pragma once #include @@ -144,5 +143,3 @@ static const uint8_t certificate_blob_root[] = { } // namespace Crypto } // namespace chip - -#endif From 2f6c61f62da0c8cbb7ab0bd44ff7fe6fc3664332 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 8 Jul 2021 09:04:33 -0400 Subject: [PATCH 10/47] Fix bloat check workflow concurrency (#8189) --- .github/workflows/bloat_check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 0f98b88ebf503c..9487abddb7a7b5 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -19,7 +19,9 @@ on: concurrency: group: ${{ github.workflow }} - cancel-in-progress: true + # Don't cancel an already-running bloat check just because it took more + # than 5 minutes to run and our cron job is trying to schedule a new one. + cancel-in-progress: false jobs: pull_request_update: From eec83bdd71ec5d3d6cf17245ac097e7f363cdf15 Mon Sep 17 00:00:00 2001 From: Song Guo Date: Thu, 8 Jul 2021 21:22:02 +0800 Subject: [PATCH 11/47] [util] Introduce `to_underlying` for casting enum classes to underlying values. (#8125) * [support] Add to_underlying * Run codegen --- .../pump-common/gen/CHIPClientCallbacks.cpp | 87 ++++++++++--------- .../gen/CHIPClientCallbacks.cpp | 87 ++++++++++--------- src/app/CommandHandler.cpp | 4 +- src/app/WriteHandler.cpp | 4 +- .../tests/integration/chip_im_initiator.cpp | 3 +- .../util/ember-compatibility-functions.cpp | 5 +- .../app/CHIPClientCallbacks-src.zapt | 87 ++++++++++--------- .../data_model/gen/CHIPClientCallbacks.cpp | 87 ++++++++++--------- src/lib/support/TypeTraits.h | 41 +++++++++ src/protocols/interaction_model/Constants.h | 6 -- 10 files changed, 226 insertions(+), 185 deletions(-) create mode 100644 src/lib/support/TypeTraits.h diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index b435ce73230155..3b35be20e9df17 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include using namespace ::chip; @@ -253,130 +254,130 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) switch (status) { case Protocols::InteractionModel::ProtocolCode::Success: - ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Failure: - ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidSubscription: - ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAccess: - ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedEndpoint: - ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidAction: - ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: - ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated82: - ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated83: - ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated84: - ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: - ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute: - ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidValue: - ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedWrite: - ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: - ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8a: - ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: - ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnreportableAttribute: - ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidDataType: - ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8e: - ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: - ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated90: - ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated91: - ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: - ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated93: - ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: - ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved95: - ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved96: - ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved97: - ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved98: - ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved99: - ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved9a: - ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ConstraintError: - ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Busy: - ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: - ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: - ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: - ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: - ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: - ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: - ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidArgument: - ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", chip::to_underlying(status)); break; default: - ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, Protocols::InteractionModel::ToUint16(status)); + ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, chip::to_underlying(status)); break; } } @@ -528,7 +529,7 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); // TODO: Should change failure callbacks to accept uint16 status code. - cb->mCall(cb->mContext, static_cast(Protocols::InteractionModel::ToUint16(status))); + cb->mCall(cb->mContext, static_cast(chip::to_underlying(status))); } return true; diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp index b435ce73230155..3b35be20e9df17 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include using namespace ::chip; @@ -253,130 +254,130 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) switch (status) { case Protocols::InteractionModel::ProtocolCode::Success: - ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Failure: - ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidSubscription: - ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAccess: - ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedEndpoint: - ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidAction: - ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: - ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated82: - ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated83: - ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated84: - ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: - ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute: - ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidValue: - ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedWrite: - ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: - ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8a: - ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: - ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnreportableAttribute: - ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidDataType: - ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8e: - ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: - ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated90: - ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated91: - ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: - ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated93: - ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: - ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved95: - ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved96: - ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved97: - ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved98: - ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved99: - ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved9a: - ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ConstraintError: - ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Busy: - ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: - ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: - ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: - ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: - ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: - ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: - ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidArgument: - ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", chip::to_underlying(status)); break; default: - ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, Protocols::InteractionModel::ToUint16(status)); + ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, chip::to_underlying(status)); break; } } @@ -528,7 +529,7 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); // TODO: Should change failure callbacks to accept uint16 status code. - cb->mCall(cb->mContext, static_cast(Protocols::InteractionModel::ToUint16(status))); + cb->mCall(cb->mContext, static_cast(chip::to_underlying(status))); } return true; diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index fd81fb33c353ec..248cf94270f68f 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -28,6 +28,7 @@ #include "InteractionModelEngine.h" #include +#include using GeneralStatusCode = chip::Protocols::SecureChannel::GeneralStatusCode; @@ -146,8 +147,7 @@ CHIP_ERROR CommandHandler::AddStatusCode(const CommandPathParams & aCommandPathP statusElementBuilder = mInvokeCommandBuilder.GetCommandListBuilder().GetCommandDataElementBuilder().CreateStatusElementBuilder(); statusElementBuilder - .EncodeStatusElement(aGeneralCode, aProtocolId.ToFullyQualifiedSpecForm(), - Protocols::InteractionModel::ToUint16(aProtocolCode)) + .EncodeStatusElement(aGeneralCode, aProtocolId.ToFullyQualifiedSpecForm(), chip::to_underlying(aProtocolCode)) .EndOfStatusElement(); err = statusElementBuilder.GetError(); SuccessOrExit(err); diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index b2b90e953d8153..17d619dc2a741d 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -257,8 +258,7 @@ CHIP_ERROR WriteHandler::AddAttributeStatusCode(const AttributePathParams & aAtt statusElementBuilder = attributeStatusElement.CreateStatusElementBuilder(); statusElementBuilder - .EncodeStatusElement(aGeneralCode, aProtocolId.ToFullyQualifiedSpecForm(), - Protocols::InteractionModel::ToUint16(aProtocolCode)) + .EncodeStatusElement(aGeneralCode, aProtocolId.ToFullyQualifiedSpecForm(), chip::to_underlying(aProtocolCode)) .EndOfStatusElement(); err = statusElementBuilder.GetError(); SuccessOrExit(err); diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 8d3d43f2555784..3dbca058058da2 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -394,7 +395,7 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap // We do not really care about the value, just return a not found status code. VerifyOrReturnError(apWriter != nullptr, CHIP_NO_ERROR); return apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status), - Protocols::InteractionModel::ToUint16(Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute)); + chip::to_underlying(Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute)); } CHIP_ERROR WriteSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVReader & aReader) diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index b5b3d5117dbab2..a577b7d9a5abdc 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -207,7 +208,7 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap if (status != EMBER_ZCL_STATUS_SUCCESS) { return apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status), - Protocols::InteractionModel::ToUint16(ToInteractionModelProtocolCode(status))); + chip::to_underlying(ToInteractionModelProtocolCode(status))); } // TODO: ZCL_STRUCT_ATTRIBUTE_TYPE is not included in this switch case currently, should add support for structures. @@ -331,7 +332,7 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * ap default: ChipLogError(DataManagement, "Attribute type 0x%x not handled", static_cast(attributeType)); return apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_Status), - Protocols::InteractionModel::ToUint16(Protocols::InteractionModel::ProtocolCode::UnsupportedRead)); + chip::to_underlying(Protocols::InteractionModel::ProtocolCode::UnsupportedRead)); } // TODO: Add DataVersion support diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 97fb6a55ca15d0..2d79881351c2ed 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -15,6 +15,7 @@ #include #include #include +#include #include using namespace ::chip; @@ -238,130 +239,130 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) switch (status) { case Protocols::InteractionModel::ProtocolCode::Success: - ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Failure: - ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidSubscription: - ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAccess: - ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedEndpoint: - ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidAction: - ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: - ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated82: - ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated83: - ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated84: - ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: - ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute: - ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidValue: - ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedWrite: - ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: - ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8a: - ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: - ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnreportableAttribute: - ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidDataType: - ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8e: - ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: - ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated90: - ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated91: - ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: - ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated93: - ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: - ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved95: - ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved96: - ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved97: - ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved98: - ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved99: - ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved9a: - ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ConstraintError: - ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Busy: - ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: - ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: - ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: - ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: - ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: - ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: - ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidArgument: - ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", chip::to_underlying(status)); break; default: - ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, Protocols::InteractionModel::ToUint16(status)); + ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, chip::to_underlying(status)); break; } } @@ -510,7 +511,7 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); // TODO: Should change failure callbacks to accept uint16 status code. - cb->mCall(cb->mContext, static_cast(Protocols::InteractionModel::ToUint16(status))); + cb->mCall(cb->mContext, static_cast(chip::to_underlying(status))); } return true; diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index 885800a77e0b99..f45bfa7764f20a 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include using namespace ::chip; @@ -253,130 +254,130 @@ static void LogIMStatus(Protocols::InteractionModel::ProtocolCode status) switch (status) { case Protocols::InteractionModel::ProtocolCode::Success: - ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Success (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Failure: - ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Failure (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidSubscription: - ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAccess: - ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAccess (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedEndpoint: - ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedEndpoint (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidAction: - ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidAction (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCommand: - ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated82: - ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated82 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated83: - ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated83 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated84: - ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated84 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidCommand: - ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidCommand (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedAttribute: - ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidValue: - ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidValue (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedWrite: - ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedWrite (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ResourceExhausted: - ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ResourceExhausted (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8a: - ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NotFound: - ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NotFound (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnreportableAttribute: - ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnreportableAttribute (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidDataType: - ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidDataType (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated8e: - ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated8e (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedRead: - ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedRead (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated90: - ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated90 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated91: - ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated91 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved92: - ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved92 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecated93: - ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecated93 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Timeout: - ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Timeout (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved95: - ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved95 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved96: - ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved96 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved97: - ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved97 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved98: - ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved98 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved99: - ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved99 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Reserved9a: - ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Reserved9a (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::ConstraintError: - ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: ConstraintError (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Busy: - ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Busy (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc0: - ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc0 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc1: - ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc1 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc2: - ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc2 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::UnsupportedCluster: - ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: UnsupportedCluster (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::Deprecatedc4: - ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: Deprecatedc4 (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::NoUpstreamSubscription: - ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: NoUpstreamSubscription (0x%04" PRIx16 ")", chip::to_underlying(status)); break; case Protocols::InteractionModel::ProtocolCode::InvalidArgument: - ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", Protocols::InteractionModel::ToUint16(status)); + ChipLogProgress(Zcl, " status: InvalidArgument (0x%04" PRIx16 ")", chip::to_underlying(status)); break; default: - ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, Protocols::InteractionModel::ToUint16(status)); + ChipLogError(Zcl, "Unknown status: 0x%04" PRIx16, chip::to_underlying(status)); break; } } @@ -528,7 +529,7 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); // TODO: Should change failure callbacks to accept uint16 status code. - cb->mCall(cb->mContext, static_cast(Protocols::InteractionModel::ToUint16(status))); + cb->mCall(cb->mContext, static_cast(chip::to_underlying(status))); } return true; diff --git a/src/lib/support/TypeTraits.h b/src/lib/support/TypeTraits.h new file mode 100644 index 00000000000000..4eb344b2ce9fc7 --- /dev/null +++ b/src/lib/support/TypeTraits.h @@ -0,0 +1,41 @@ +/* + * + * 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 + * This file defines and implements a number of miscellaneous + * templates for simplify code with handling types. + * + */ + +#pragma once + +#include + +namespace chip { + +/** + * @brief Implemented std::to_underlying introduced in C++23. + */ +template +constexpr std::underlying_type_t to_underlying(T e) +{ + static_assert(std::is_enum::value, "to_underlying called to non-enum values."); + return static_cast>(e); +} + +} // namespace chip diff --git a/src/protocols/interaction_model/Constants.h b/src/protocols/interaction_model/Constants.h index 7a7d155351a749..0adc286ce1a87e 100644 --- a/src/protocols/interaction_model/Constants.h +++ b/src/protocols/interaction_model/Constants.h @@ -109,12 +109,6 @@ enum class ProtocolCode : uint16_t NoUpstreamSubscription = 0xc5, InvalidArgument = 0xc6, }; - -inline uint16_t ToUint16(ProtocolCode aProtocolCode) -{ - static_assert(std::is_same>::value, "Cast might not be right"); - return static_cast(aProtocolCode); -} } // namespace InteractionModel template <> From b51b169a6ece69632b155c33944bf512528dbe01 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 8 Jul 2021 15:22:10 +0200 Subject: [PATCH 12/47] [ChipTool] Add pairing qrcode/manualcode option (#8168) --- .../chip-tool/commands/pairing/Commands.h | 17 +++++++-- .../commands/pairing/PairingCommand.cpp | 36 +++++++++++++++++++ .../commands/pairing/PairingCommand.h | 12 +++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/examples/chip-tool/commands/pairing/Commands.h b/examples/chip-tool/commands/pairing/Commands.h index 70008a924a0a8c..ac30f08598d330 100644 --- a/examples/chip-tool/commands/pairing/Commands.h +++ b/examples/chip-tool/commands/pairing/Commands.h @@ -32,6 +32,18 @@ class PairBypass : public PairingCommand PairBypass() : PairingCommand("bypass", PairingMode::Bypass, PairingNetworkType::None) {} }; +class PairQRCode : public PairingCommand +{ +public: + PairQRCode() : PairingCommand("qrcode", PairingMode::QRCode, PairingNetworkType::None) {} +}; + +class PairManualCode : public PairingCommand +{ +public: + PairManualCode() : PairingCommand("manualcode", PairingMode::ManualCode, PairingNetworkType::None) {} +}; + class PairOnNetwork : public PairingCommand { public: @@ -67,8 +79,9 @@ void registerCommandsPairing(Commands & commands) const char * clusterName = "Pairing"; 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(), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index f21554299fcd45..ec9772c1bce42e 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -20,6 +20,9 @@ #include "platform/PlatformManager.h" #include +#include +#include + using namespace ::chip; constexpr uint64_t kBreadcrumb = 0; @@ -56,6 +59,12 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId) case PairingMode::Bypass: err = PairWithoutSecurity(remoteId, PeerAddress::UDP(mRemoteAddr.address, mRemotePort)); break; + case PairingMode::QRCode: + err = PairWithQRCode(remoteId); + break; + case PairingMode::ManualCode: + err = PairWithManualCode(remoteId); + break; case PairingMode::Ble: err = Pair(remoteId, PeerAddress::BLE()); break; @@ -71,6 +80,33 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId) return err; } +CHIP_ERROR PairingCommand::PairWithQRCode(NodeId remoteId) +{ + SetupPayload payload; + ReturnErrorOnFailure(QRCodeSetupPayloadParser(mOnboardingPayload).populatePayload(payload)); + return PairWithCode(remoteId, payload); +} + +CHIP_ERROR PairingCommand::PairWithManualCode(NodeId remoteId) +{ + SetupPayload payload; + ReturnErrorOnFailure(ManualSetupPayloadParser(mOnboardingPayload).populatePayload(payload)); + return PairWithCode(remoteId, payload); +} + +CHIP_ERROR PairingCommand::PairWithCode(NodeId remoteId, SetupPayload payload) +{ + chip::RendezvousInformationFlags rendezvousInformation = payload.rendezvousInformation; + ReturnErrorCodeIf(rendezvousInformation != RendezvousInformationFlag::kBLE, CHIP_ERROR_INVALID_ARGUMENT); + + RendezvousParameters params = RendezvousParameters() + .SetSetupPINCode(payload.setUpPINCode) + .SetDiscriminator(payload.discriminator) + .SetPeerAddress(PeerAddress::BLE()); + + return GetExecContext()->commissioner->PairDevice(remoteId, params); +} + CHIP_ERROR PairingCommand::Pair(NodeId remoteId, PeerAddress address) { RendezvousParameters params = diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index 092fbfd806b4de..ac2353f041f280 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -24,12 +24,15 @@ #include "gen/CHIPClusters.h" #include +#include #include enum class PairingMode { None, Bypass, + QRCode, + ManualCode, Ble, SoftAP, Ethernet, @@ -74,6 +77,11 @@ class PairingCommand : public Command, AddArgument("device-remote-ip", &mRemoteAddr); AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort); break; + case PairingMode::QRCode: + case PairingMode::ManualCode: + AddArgument("fabric-id", 0, UINT64_MAX, &mFabricId); + AddArgument("payload", &mOnboardingPayload); + break; case PairingMode::Ble: AddArgument("fabric-id", 0, UINT64_MAX, &mFabricId); AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); @@ -118,6 +126,9 @@ class PairingCommand : public Command, private: CHIP_ERROR RunInternal(NodeId remoteId); CHIP_ERROR Pair(NodeId remoteId, PeerAddress address); + CHIP_ERROR PairWithQRCode(NodeId remoteId); + CHIP_ERROR PairWithManualCode(NodeId remoteId); + CHIP_ERROR PairWithCode(NodeId remoteId, chip::SetupPayload payload); CHIP_ERROR PairWithoutSecurity(NodeId remoteId, PeerAddress address); CHIP_ERROR Unpair(NodeId remoteId); @@ -140,6 +151,7 @@ class PairingCommand : public Command, chip::ByteSpan mOperationalDataset; chip::ByteSpan mSSID; chip::ByteSpan mPassword; + char * mOnboardingPayload; chip::Callback::Callback * mOnAddThreadNetworkCallback = nullptr; chip::Callback::Callback * mOnAddWiFiNetworkCallback = nullptr; From 2d3268c9a45a570dd2d9bc131df0a482f04d0a35 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 8 Jul 2021 09:30:49 -0400 Subject: [PATCH 13/47] Improve PlatformManager documentation. (#8181) Two changes here: 1) The documentation for StopEventLoopTask said "before" when it should have said "after", when describing when work items will stop running. 2) The documetnation for StartEventLoopTask had an unclear parenthetical that this change rewords to be clearer as to which time points "before" in the parenthetical refers to. --- src/include/platform/PlatformManager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index ce99010a1bfd99..8b98c30da236e4 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -119,8 +119,8 @@ class PlatformManager * StartEventLoopTask processes items asynchronously. It can return before * any items are processed, or after some items have been processed, or * while an item is being processed, or even after StopEventLoopTask() has - * been called (e.g. if ScheduleWork() was called with a work item that - * calls StopEventLoopTask before StartEventLoopTask was called). + * been called (e.g. if ScheduleWork() was called before StartEventLoopTask + * was called, with a work item that calls StopEventLoopTask). * * Consumers that call StartEventLoopTask must not call RunEventLoop. * @@ -133,8 +133,8 @@ class PlatformManager * * If called from outside work item processing, StopEventLoopTask guarantees * that any currently-executing work item completes execution and no more - * work items will run before it returns. This is generally how - * StopEventLoopTask is used in conjunction with StartEventLoopTask. + * work items will run after StopEventLoopTask returns. This is generally + * how StopEventLoopTask is used in conjunction with StartEventLoopTask. * * If called from inside work item processing, StopEventLoopTask makes no * guarantees about exactly when work item processing will stop. What it From e4e844ea6208230bf23966630683f1b9b1cbf5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:16:11 +0200 Subject: [PATCH 14/47] [nrfconnect] Minor shell improvements (#8156) * [nrfconnect] Minor shell improvements * Support Matter commands in shells other than UART-based. * Write whole line at once instead of one character at a time. * Fix "config" command. * Restyled by clang-format * Restyled by gn * Include missing file Co-authored-by: Restyled.io --- src/lib/shell/BUILD.gn | 10 +++++----- src/lib/shell/MainLoopZephyr.cpp | 2 ++ src/lib/shell/commands/Config.cpp | 14 +++++++------- src/lib/shell/streamer_zephyr.cpp | 17 ++++++++++++----- src/lib/shell/streamer_zephyr.h | 28 ++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 src/lib/shell/streamer_zephyr.h diff --git a/src/lib/shell/BUILD.gn b/src/lib/shell/BUILD.gn index 2ff6b94d748df2..6e7cbc221c84ac 100644 --- a/src/lib/shell/BUILD.gn +++ b/src/lib/shell/BUILD.gn @@ -59,15 +59,15 @@ static_library("shell") { "streamer_k32w.cpp", ] } else if (current_os == "zephyr") { - sources += [ "MainLoopZephyr.cpp" ] + sources += [ + "MainLoopZephyr.cpp", + "streamer_zephyr.cpp", + "streamer_zephyr.h", + ] } else { sources += [ "MainLoopDefault.cpp" ] } - if (current_os == "zephyr") { - sources += [ "streamer_zephyr.cpp" ] - } - if (current_os == "mbed") { sources += [ "streamer_mbed.cpp" ] } diff --git a/src/lib/shell/MainLoopZephyr.cpp b/src/lib/shell/MainLoopZephyr.cpp index 58bc4c2aa63bd6..fc7dc9809be373 100644 --- a/src/lib/shell/MainLoopZephyr.cpp +++ b/src/lib/shell/MainLoopZephyr.cpp @@ -19,11 +19,13 @@ #include #include +#include using chip::Shell::Engine; static int cmd_matter(const struct shell * shell, size_t argc, char ** argv) { + chip::Shell::streamer_set_shell(shell); return (Engine::Root().ExecCommand(argc - 1, argv + 1) == CHIP_NO_ERROR) ? 0 : -ENOEXEC; } diff --git a/src/lib/shell/commands/Config.cpp b/src/lib/shell/commands/Config.cpp index d486e6c4874074..60b3d020364732 100644 --- a/src/lib/shell/commands/Config.cpp +++ b/src/lib/shell/commands/Config.cpp @@ -35,11 +35,11 @@ static CHIP_ERROR ConfigGetVendorId(bool printHeader) streamer_t * sout = streamer_get(); uint16_t value16; + ReturnErrorOnFailure(ConfigurationMgr().GetVendorId(value16)); if (printHeader) { streamer_printf(sout, "VendorId: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetVendorId(value16)); streamer_printf(sout, "%" PRIu16 " (0x%" PRIX16 ")\r\n", value16, value16); return CHIP_NO_ERROR; } @@ -49,11 +49,11 @@ static CHIP_ERROR ConfigGetProductId(bool printHeader) streamer_t * sout = streamer_get(); uint16_t value16; + ReturnErrorOnFailure(ConfigurationMgr().GetProductId(value16)); if (printHeader) { streamer_printf(sout, "ProductId: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetProductId(value16)); streamer_printf(sout, "%" PRIu16 " (0x%" PRIX16 ")\r\n", value16, value16); return CHIP_NO_ERROR; } @@ -63,11 +63,11 @@ static CHIP_ERROR ConfigGetProductRevision(bool printHeader) streamer_t * sout = streamer_get(); uint16_t value16; + ReturnErrorOnFailure(ConfigurationMgr().GetProductRevision(value16)); if (printHeader) { streamer_printf(sout, "ProductRevision: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetProductRevision(value16)); streamer_printf(sout, "%" PRIu16 " (0x%" PRIX16 ")\r\n", value16, value16); return CHIP_NO_ERROR; } @@ -77,11 +77,11 @@ static CHIP_ERROR ConfigGetDeviceId(bool printHeader) streamer_t * sout = streamer_get(); uint64_t value64; + ReturnErrorOnFailure(ConfigurationMgr().GetDeviceId(value64)); if (printHeader) { streamer_printf(sout, "DeviceId: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetDeviceId(value64)); streamer_printf(sout, "%" PRIu64 " (0x" ChipLogFormatX64 ")\r\n", value64, ChipLogValueX64(value64)); return CHIP_NO_ERROR; } @@ -91,11 +91,11 @@ static CHIP_ERROR ConfigGetSetupPinCode(bool printHeader) streamer_t * sout = streamer_get(); uint32_t setupPinCode; + ReturnErrorOnFailure(ConfigurationMgr().GetSetupPinCode(setupPinCode)); if (printHeader) { streamer_printf(sout, "PinCode: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetSetupPinCode(setupPinCode)); streamer_printf(sout, "%09u\r\n", setupPinCode); return CHIP_NO_ERROR; } @@ -105,11 +105,11 @@ static CHIP_ERROR ConfigGetSetupDiscriminator(bool printHeader) streamer_t * sout = streamer_get(); uint16_t setupDiscriminator; + ReturnErrorOnFailure(ConfigurationMgr().GetSetupDiscriminator(setupDiscriminator)); if (printHeader) { streamer_printf(sout, "Discriminator: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetSetupDiscriminator(setupDiscriminator)); streamer_printf(sout, "%03x\r\n", setupDiscriminator & 0xFFF); return CHIP_NO_ERROR; } @@ -119,11 +119,11 @@ static CHIP_ERROR ConfigGetFabricId(bool printHeader) streamer_t * sout = streamer_get(); uint64_t value64; + ReturnErrorOnFailure(ConfigurationMgr().GetFabricId(value64)); if (printHeader) { streamer_printf(sout, "FabricId: "); } - ReturnErrorOnFailure(ConfigurationMgr().GetFabricId(value64)); streamer_printf(sout, "%" PRIu64 " (0x" ChipLogFormatX64 ")\r\n", value64, ChipLogValueX64(value64)); return CHIP_NO_ERROR; } diff --git a/src/lib/shell/streamer_zephyr.cpp b/src/lib/shell/streamer_zephyr.cpp index 8f93e8252ab175..40a16d56fbbd94 100644 --- a/src/lib/shell/streamer_zephyr.cpp +++ b/src/lib/shell/streamer_zephyr.cpp @@ -30,6 +30,7 @@ namespace chip { namespace Shell { namespace { +const shell * sShellInstance; int streamer_zephyr_init(streamer_t * streamer) { @@ -46,13 +47,14 @@ ssize_t streamer_zephyr_read(streamer_t * streamer, char * buffer, size_t length ssize_t streamer_zephyr_write(streamer_t * streamer, const char * buffer, size_t length) { ARG_UNUSED(streamer); - for (size_t i = 0; i < length; ++i) - // TODO: Don't assume that UART backend is used. - shell_fprintf(shell_backend_uart_get_ptr(), SHELL_NORMAL, "%c", buffer[i]); + + if (sShellInstance) + shell_fprintf(sShellInstance, SHELL_NORMAL, "%.*s", length, buffer); + return length; } -static streamer_t streamer_zephyr = { +streamer_t sStreamer = { .init_cb = streamer_zephyr_init, .read_cb = streamer_zephyr_read, .write_cb = streamer_zephyr_write, @@ -61,7 +63,12 @@ static streamer_t streamer_zephyr = { streamer_t * streamer_get(void) { - return &streamer_zephyr; + return &sStreamer; +} + +void streamer_set_shell(const shell * shellInstance) +{ + sShellInstance = shellInstance; } } // namespace Shell diff --git a/src/lib/shell/streamer_zephyr.h b/src/lib/shell/streamer_zephyr.h new file mode 100644 index 00000000000000..5e1d2685fc91bc --- /dev/null +++ b/src/lib/shell/streamer_zephyr.h @@ -0,0 +1,28 @@ +/* + * + * 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. + */ + +#pragma once + +struct shell; + +namespace chip { +namespace Shell { + +void streamer_set_shell(const shell * shellInstance); + +} // namespace Shell +} // namespace chip From 83a2dd02c55b74b4d291d9e7743484cc90664136 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 8 Jul 2021 13:14:40 -0400 Subject: [PATCH 15/47] Add test for sending a command to an unsupported endpoint (#8073) * Add test for trying to send a command to an endpoint that does not exist. The test script change is to allow it to detect crashes in the server app as failures (due to the server app not being there to be killed). * Regenerate generated files --- examples/chip-tool/commands/tests/Commands.h | 74 ++++++++++++++++++- scripts/tests/test_suites.sh | 2 +- src/app/tests/suites/TestCluster.yaml | 7 ++ .../Framework/CHIPTests/CHIPClustersTests.m | 17 +++++ 4 files changed, 98 insertions(+), 2 deletions(-) diff --git a/examples/chip-tool/commands/tests/Commands.h b/examples/chip-tool/commands/tests/Commands.h index 4f543f863b9602..ecd75e9c96cf12 100644 --- a/examples/chip-tool/commands/tests/Commands.h +++ b/examples/chip-tool/commands/tests/Commands.h @@ -3818,6 +3818,9 @@ class TestCluster : public TestCommand case 100: err = TestSendClusterTestClusterCommandWriteAttribute_100(); break; + case 101: + err = TestSendClusterTestClusterCommandTest_101(); + break; } if (CHIP_NO_ERROR != err) @@ -3829,7 +3832,7 @@ class TestCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 101; + const uint16_t mTestCount = 102; // // Tests methods @@ -11301,6 +11304,75 @@ class TestCluster : public TestCommand runner->NextTest(); } + + // Test Send Test Command to unsupported endpoint + typedef void (*SuccessCallback_101)(void * context); + chip::Callback::Callback * mOnSuccessCallback_101 = nullptr; + chip::Callback::Callback * mOnFailureCallback_101 = nullptr; + bool mIsFailureExpected_101 = 1; + + CHIP_ERROR TestSendClusterTestClusterCommandTest_101() + { + ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Sending command..."); + + mOnFailureCallback_101 = + new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_101_FailureResponse, this); + mOnSuccessCallback_101 = + new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_101_SuccessResponse, this); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(mDevice, 200); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.Test(mOnSuccessCallback_101->Cancel(), mOnFailureCallback_101->Cancel()); + + if (CHIP_NO_ERROR != err) + { + delete mOnFailureCallback_101; + delete mOnSuccessCallback_101; + } + + return err; + } + + static void OnTestSendClusterTestClusterCommandTest_101_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_101; + delete runner->mOnSuccessCallback_101; + + if (runner->mIsFailureExpected_101 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandTest_101_SuccessResponse(void * context) + { + ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + delete runner->mOnFailureCallback_101; + delete runner->mOnSuccessCallback_101; + + if (runner->mIsFailureExpected_101 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } }; class Test_TC_OO_1_1 : public TestCommand diff --git a/scripts/tests/test_suites.sh b/scripts/tests/test_suites.sh index bcf045b75dba90..8c152e3240711a 100755 --- a/scripts/tests/test_suites.sh +++ b/scripts/tests/test_suites.sh @@ -112,7 +112,7 @@ for j in "${iter_array[@]}"; do # Prevent cleanup trying to kill a process we already killed. temp_background_pid=$background_pid background_pid=0 - kill -9 "$temp_background_pid" || true + kill -9 "$temp_background_pid" echo " ===== Test complete: $i" done echo " ===== Iteration $j completed" diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index 7c15e81b210207..b0981e1b8929b5 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -671,3 +671,10 @@ tests: optional: true arguments: value: 0 + + - label: "Send Test Command to unsupported endpoint" + command: "test" + endpoint: 200 + response: + # No cluster on that endpoint, so expect an error. + error: 1 diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index ddb961903667ea..ce8fe6ebc0c4a0 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2042,6 +2042,23 @@ - (void)testSendClusterTestCluster_000100_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestCluster_000101_Test +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster test:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_OO_1_1_000000_ReadAttribute { From b5bbee1e40713dd15588d0a6ec986a1b11e96c78 Mon Sep 17 00:00:00 2001 From: Timothy Maes Date: Thu, 8 Jul 2021 19:19:08 +0200 Subject: [PATCH 16/47] Enable ECDH derive secret with HW accelerated crypto engine (#8155) --- src/crypto/CHIPCryptoPALmbedTLS.cpp | 3 +-- third_party/qpg_sdk/repo | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index f377e4815e5df8..ceb7c5f5b978a6 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -581,8 +581,7 @@ CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, co CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, P256ECDHDerivedSecret & out_secret) const { -// TODO: Enable ECDH_derive_secret for Qorvo when their mbedTLS static libraries are updated -#if defined(MBEDTLS_ECDH_C) && !defined(QORVO_CRYPTO_ENGINE) +#if defined(MBEDTLS_ECDH_C) CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; size_t secret_length = (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(); diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index 357b234a3eb0fa..2e11f9c052cb57 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit 357b234a3eb0fa5ecece14ee3a10b565916403c0 +Subproject commit 2e11f9c052cb5758f318e56d344ca6d9b391b50b From 5943bde610c773c9b5848afc796bdb99327e9ada Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 8 Jul 2021 21:33:36 +0200 Subject: [PATCH 17/47] Zap add accessors helpers for attributes (#7183) * Add Attributes Accessors into src/app/common/gen * Update some ZCL definition types to use the types from the spec * Update gen/ folders --- src/app/common/gen/attributes/Accessors.cpp | 8221 +++++++++++++++++ src/app/common/gen/attributes/Accessors.h | 2197 +++++ src/app/common/gen/callback.h | 12 +- src/app/common/gen/client-command-macro.h | 12 +- src/app/common/templates/templates.json | 11 + src/app/zap-templates/common/StructHelper.js | 28 + .../common/attributes/Accessors.js | 56 + src/app/zap-templates/common/override.js | 2 + .../app/attributes/Accessors-src.zapt | 50 + .../templates/app/attributes/Accessors.zapt | 41 + .../templates/app/ids/Attributes.zapt | 6 +- .../chip/diagnostic-logs-cluster.xml | 2 +- .../zcl/data-model/silabs/ami.xml | 10 +- .../zcl/data-model/silabs/general.xml | 2 +- .../zcl/data-model/silabs/ha.xml | 242 +- 15 files changed, 10748 insertions(+), 144 deletions(-) create mode 100644 src/app/common/gen/attributes/Accessors.cpp create mode 100644 src/app/common/gen/attributes/Accessors.h create mode 100644 src/app/zap-templates/common/StructHelper.js create mode 100644 src/app/zap-templates/common/attributes/Accessors.js create mode 100644 src/app/zap-templates/templates/app/attributes/Accessors-src.zapt create mode 100644 src/app/zap-templates/templates/app/attributes/Accessors.zapt diff --git a/src/app/common/gen/attributes/Accessors.cpp b/src/app/common/gen/attributes/Accessors.cpp new file mode 100644 index 00000000000000..3378ea7c58a6d6 --- /dev/null +++ b/src/app/common/gen/attributes/Accessors.cpp @@ -0,0 +1,8221 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +/** + * @file + * This file contains definitions for accessors around clusters attributes. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace PowerConfiguration { +namespace Attributes { +EmberAfStatus GetMainsVoltage(chip::EndpointId endpoint, uint16_t * mainsVoltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltage, (uint8_t *) mainsVoltage, + sizeof(*mainsVoltage)); +} +EmberAfStatus SetMainsVoltage(chip::EndpointId endpoint, uint16_t mainsVoltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltage, (uint8_t *) &mainsVoltage, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMainsFrequency(chip::EndpointId endpoint, uint8_t * mainsFrequency) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsFrequency, (uint8_t *) mainsFrequency, + sizeof(*mainsFrequency)); +} +EmberAfStatus SetMainsFrequency(chip::EndpointId endpoint, uint8_t mainsFrequency) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsFrequency, (uint8_t *) &mainsFrequency, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMainsAlarmMask(chip::EndpointId endpoint, uint8_t * mainsAlarmMask) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsAlarmMask, (uint8_t *) mainsAlarmMask, + sizeof(*mainsAlarmMask)); +} +EmberAfStatus SetMainsAlarmMask(chip::EndpointId endpoint, uint8_t mainsAlarmMask) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsAlarmMask, (uint8_t *) &mainsAlarmMask, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMainsVoltageMinThreshold(chip::EndpointId endpoint, uint16_t * mainsVoltageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageMinThreshold, + (uint8_t *) mainsVoltageMinThreshold, sizeof(*mainsVoltageMinThreshold)); +} +EmberAfStatus SetMainsVoltageMinThreshold(chip::EndpointId endpoint, uint16_t mainsVoltageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageMinThreshold, + (uint8_t *) &mainsVoltageMinThreshold, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMainsVoltageMaxThreshold(chip::EndpointId endpoint, uint16_t * mainsVoltageMaxThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageMaxThreshold, + (uint8_t *) mainsVoltageMaxThreshold, sizeof(*mainsVoltageMaxThreshold)); +} +EmberAfStatus SetMainsVoltageMaxThreshold(chip::EndpointId endpoint, uint16_t mainsVoltageMaxThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageMaxThreshold, + (uint8_t *) &mainsVoltageMaxThreshold, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMainsVoltageDwellTrip(chip::EndpointId endpoint, uint16_t * mainsVoltageDwellTrip) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageDwellTrip, + (uint8_t *) mainsVoltageDwellTrip, sizeof(*mainsVoltageDwellTrip)); +} +EmberAfStatus SetMainsVoltageDwellTrip(chip::EndpointId endpoint, uint16_t mainsVoltageDwellTrip) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::MainsVoltageDwellTrip, + (uint8_t *) &mainsVoltageDwellTrip, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryVoltage(chip::EndpointId endpoint, uint8_t * batteryVoltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltage, (uint8_t *) batteryVoltage, + sizeof(*batteryVoltage)); +} +EmberAfStatus SetBatteryVoltage(chip::EndpointId endpoint, uint8_t batteryVoltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltage, (uint8_t *) &batteryVoltage, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryPercentageRemaining(chip::EndpointId endpoint, uint8_t * batteryPercentageRemaining) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageRemaining, + (uint8_t *) batteryPercentageRemaining, sizeof(*batteryPercentageRemaining)); +} +EmberAfStatus SetBatteryPercentageRemaining(chip::EndpointId endpoint, uint8_t batteryPercentageRemaining) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageRemaining, + (uint8_t *) &batteryPercentageRemaining, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatterySize(chip::EndpointId endpoint, uint8_t * batterySize) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatterySize, (uint8_t *) batterySize, + sizeof(*batterySize)); +} +EmberAfStatus SetBatterySize(chip::EndpointId endpoint, uint8_t batterySize) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatterySize, (uint8_t *) &batterySize, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryAhrRating(chip::EndpointId endpoint, uint16_t * batteryAhrRating) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAhrRating, (uint8_t *) batteryAhrRating, + sizeof(*batteryAhrRating)); +} +EmberAfStatus SetBatteryAhrRating(chip::EndpointId endpoint, uint16_t batteryAhrRating) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAhrRating, (uint8_t *) &batteryAhrRating, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryQuantity(chip::EndpointId endpoint, uint8_t * batteryQuantity) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryQuantity, (uint8_t *) batteryQuantity, + sizeof(*batteryQuantity)); +} +EmberAfStatus SetBatteryQuantity(chip::EndpointId endpoint, uint8_t batteryQuantity) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryQuantity, (uint8_t *) &batteryQuantity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryRatedVoltage(chip::EndpointId endpoint, uint8_t * batteryRatedVoltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryRatedVoltage, (uint8_t *) batteryRatedVoltage, + sizeof(*batteryRatedVoltage)); +} +EmberAfStatus SetBatteryRatedVoltage(chip::EndpointId endpoint, uint8_t batteryRatedVoltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryRatedVoltage, (uint8_t *) &batteryRatedVoltage, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryAlarmMask(chip::EndpointId endpoint, uint8_t * batteryAlarmMask) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAlarmMask, (uint8_t *) batteryAlarmMask, + sizeof(*batteryAlarmMask)); +} +EmberAfStatus SetBatteryAlarmMask(chip::EndpointId endpoint, uint8_t batteryAlarmMask) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAlarmMask, (uint8_t *) &batteryAlarmMask, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryVoltageMinThreshold(chip::EndpointId endpoint, uint8_t * batteryVoltageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageMinThreshold, + (uint8_t *) batteryVoltageMinThreshold, sizeof(*batteryVoltageMinThreshold)); +} +EmberAfStatus SetBatteryVoltageMinThreshold(chip::EndpointId endpoint, uint8_t batteryVoltageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageMinThreshold, + (uint8_t *) &batteryVoltageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryVoltageThreshold1(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold1, + (uint8_t *) batteryVoltageThreshold1, sizeof(*batteryVoltageThreshold1)); +} +EmberAfStatus SetBatteryVoltageThreshold1(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold1, + (uint8_t *) &batteryVoltageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryVoltageThreshold2(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold2, + (uint8_t *) batteryVoltageThreshold2, sizeof(*batteryVoltageThreshold2)); +} +EmberAfStatus SetBatteryVoltageThreshold2(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold2, + (uint8_t *) &batteryVoltageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryVoltageThreshold3(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold3, + (uint8_t *) batteryVoltageThreshold3, sizeof(*batteryVoltageThreshold3)); +} +EmberAfStatus SetBatteryVoltageThreshold3(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryVoltageThreshold3, + (uint8_t *) &batteryVoltageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryPercentageMinThreshold(chip::EndpointId endpoint, uint8_t * batteryPercentageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageMinThreshold, + (uint8_t *) batteryPercentageMinThreshold, sizeof(*batteryPercentageMinThreshold)); +} +EmberAfStatus SetBatteryPercentageMinThreshold(chip::EndpointId endpoint, uint8_t batteryPercentageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageMinThreshold, + (uint8_t *) &batteryPercentageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryPercentageThreshold1(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold1, + (uint8_t *) batteryPercentageThreshold1, sizeof(*batteryPercentageThreshold1)); +} +EmberAfStatus SetBatteryPercentageThreshold1(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold1, + (uint8_t *) &batteryPercentageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryPercentageThreshold2(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold2, + (uint8_t *) batteryPercentageThreshold2, sizeof(*batteryPercentageThreshold2)); +} +EmberAfStatus SetBatteryPercentageThreshold2(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold2, + (uint8_t *) &batteryPercentageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryPercentageThreshold3(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold3, + (uint8_t *) batteryPercentageThreshold3, sizeof(*batteryPercentageThreshold3)); +} +EmberAfStatus SetBatteryPercentageThreshold3(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryPercentageThreshold3, + (uint8_t *) &batteryPercentageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBatteryAlarmState(chip::EndpointId endpoint, uint32_t * batteryAlarmState) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAlarmState, (uint8_t *) batteryAlarmState, + sizeof(*batteryAlarmState)); +} +EmberAfStatus SetBatteryAlarmState(chip::EndpointId endpoint, uint32_t batteryAlarmState) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::BatteryAlarmState, (uint8_t *) &batteryAlarmState, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2Voltage(chip::EndpointId endpoint, uint8_t * battery2Voltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Voltage, (uint8_t *) battery2Voltage, + sizeof(*battery2Voltage)); +} +EmberAfStatus SetBattery2Voltage(chip::EndpointId endpoint, uint8_t battery2Voltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Voltage, (uint8_t *) &battery2Voltage, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2PercentageRemaining(chip::EndpointId endpoint, uint8_t * battery2PercentageRemaining) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageRemaining, + (uint8_t *) battery2PercentageRemaining, sizeof(*battery2PercentageRemaining)); +} +EmberAfStatus SetBattery2PercentageRemaining(chip::EndpointId endpoint, uint8_t battery2PercentageRemaining) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageRemaining, + (uint8_t *) &battery2PercentageRemaining, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2Size(chip::EndpointId endpoint, uint8_t * battery2Size) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Size, (uint8_t *) battery2Size, + sizeof(*battery2Size)); +} +EmberAfStatus SetBattery2Size(chip::EndpointId endpoint, uint8_t battery2Size) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Size, (uint8_t *) &battery2Size, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2AhrRating(chip::EndpointId endpoint, uint16_t * battery2AhrRating) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AhrRating, (uint8_t *) battery2AhrRating, + sizeof(*battery2AhrRating)); +} +EmberAfStatus SetBattery2AhrRating(chip::EndpointId endpoint, uint16_t battery2AhrRating) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AhrRating, (uint8_t *) &battery2AhrRating, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2Quantity(chip::EndpointId endpoint, uint8_t * battery2Quantity) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Quantity, (uint8_t *) battery2Quantity, + sizeof(*battery2Quantity)); +} +EmberAfStatus SetBattery2Quantity(chip::EndpointId endpoint, uint8_t battery2Quantity) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2Quantity, (uint8_t *) &battery2Quantity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2RatedVoltage(chip::EndpointId endpoint, uint8_t * battery2RatedVoltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2RatedVoltage, (uint8_t *) battery2RatedVoltage, + sizeof(*battery2RatedVoltage)); +} +EmberAfStatus SetBattery2RatedVoltage(chip::EndpointId endpoint, uint8_t battery2RatedVoltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2RatedVoltage, + (uint8_t *) &battery2RatedVoltage, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2AlarmMask(chip::EndpointId endpoint, uint8_t * battery2AlarmMask) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AlarmMask, (uint8_t *) battery2AlarmMask, + sizeof(*battery2AlarmMask)); +} +EmberAfStatus SetBattery2AlarmMask(chip::EndpointId endpoint, uint8_t battery2AlarmMask) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AlarmMask, (uint8_t *) &battery2AlarmMask, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2VoltageMinThreshold(chip::EndpointId endpoint, uint8_t * battery2VoltageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageMinThreshold, + (uint8_t *) battery2VoltageMinThreshold, sizeof(*battery2VoltageMinThreshold)); +} +EmberAfStatus SetBattery2VoltageMinThreshold(chip::EndpointId endpoint, uint8_t battery2VoltageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageMinThreshold, + (uint8_t *) &battery2VoltageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2VoltageThreshold1(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold1, + (uint8_t *) battery2VoltageThreshold1, sizeof(*battery2VoltageThreshold1)); +} +EmberAfStatus SetBattery2VoltageThreshold1(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold1, + (uint8_t *) &battery2VoltageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2VoltageThreshold2(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold2, + (uint8_t *) battery2VoltageThreshold2, sizeof(*battery2VoltageThreshold2)); +} +EmberAfStatus SetBattery2VoltageThreshold2(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold2, + (uint8_t *) &battery2VoltageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2VoltageThreshold3(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold3, + (uint8_t *) battery2VoltageThreshold3, sizeof(*battery2VoltageThreshold3)); +} +EmberAfStatus SetBattery2VoltageThreshold3(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2VoltageThreshold3, + (uint8_t *) &battery2VoltageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2PercentageMinThreshold(chip::EndpointId endpoint, uint8_t * battery2PercentageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageMinThreshold, + (uint8_t *) battery2PercentageMinThreshold, sizeof(*battery2PercentageMinThreshold)); +} +EmberAfStatus SetBattery2PercentageMinThreshold(chip::EndpointId endpoint, uint8_t battery2PercentageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageMinThreshold, + (uint8_t *) &battery2PercentageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2PercentageThreshold1(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold1, + (uint8_t *) battery2PercentageThreshold1, sizeof(*battery2PercentageThreshold1)); +} +EmberAfStatus SetBattery2PercentageThreshold1(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold1, + (uint8_t *) &battery2PercentageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2PercentageThreshold2(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold2, + (uint8_t *) battery2PercentageThreshold2, sizeof(*battery2PercentageThreshold2)); +} +EmberAfStatus SetBattery2PercentageThreshold2(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold2, + (uint8_t *) &battery2PercentageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2PercentageThreshold3(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold3, + (uint8_t *) battery2PercentageThreshold3, sizeof(*battery2PercentageThreshold3)); +} +EmberAfStatus SetBattery2PercentageThreshold3(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2PercentageThreshold3, + (uint8_t *) &battery2PercentageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery2AlarmState(chip::EndpointId endpoint, uint32_t * battery2AlarmState) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AlarmState, (uint8_t *) battery2AlarmState, + sizeof(*battery2AlarmState)); +} +EmberAfStatus SetBattery2AlarmState(chip::EndpointId endpoint, uint32_t battery2AlarmState) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery2AlarmState, (uint8_t *) &battery2AlarmState, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3Voltage(chip::EndpointId endpoint, uint8_t * battery3Voltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Voltage, (uint8_t *) battery3Voltage, + sizeof(*battery3Voltage)); +} +EmberAfStatus SetBattery3Voltage(chip::EndpointId endpoint, uint8_t battery3Voltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Voltage, (uint8_t *) &battery3Voltage, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3PercentageRemaining(chip::EndpointId endpoint, uint8_t * battery3PercentageRemaining) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageRemaining, + (uint8_t *) battery3PercentageRemaining, sizeof(*battery3PercentageRemaining)); +} +EmberAfStatus SetBattery3PercentageRemaining(chip::EndpointId endpoint, uint8_t battery3PercentageRemaining) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageRemaining, + (uint8_t *) &battery3PercentageRemaining, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3Size(chip::EndpointId endpoint, uint8_t * battery3Size) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Size, (uint8_t *) battery3Size, + sizeof(*battery3Size)); +} +EmberAfStatus SetBattery3Size(chip::EndpointId endpoint, uint8_t battery3Size) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Size, (uint8_t *) &battery3Size, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3AhrRating(chip::EndpointId endpoint, uint16_t * battery3AhrRating) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AhrRating, (uint8_t *) battery3AhrRating, + sizeof(*battery3AhrRating)); +} +EmberAfStatus SetBattery3AhrRating(chip::EndpointId endpoint, uint16_t battery3AhrRating) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AhrRating, (uint8_t *) &battery3AhrRating, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3Quantity(chip::EndpointId endpoint, uint8_t * battery3Quantity) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Quantity, (uint8_t *) battery3Quantity, + sizeof(*battery3Quantity)); +} +EmberAfStatus SetBattery3Quantity(chip::EndpointId endpoint, uint8_t battery3Quantity) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3Quantity, (uint8_t *) &battery3Quantity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3RatedVoltage(chip::EndpointId endpoint, uint8_t * battery3RatedVoltage) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3RatedVoltage, (uint8_t *) battery3RatedVoltage, + sizeof(*battery3RatedVoltage)); +} +EmberAfStatus SetBattery3RatedVoltage(chip::EndpointId endpoint, uint8_t battery3RatedVoltage) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3RatedVoltage, + (uint8_t *) &battery3RatedVoltage, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3AlarmMask(chip::EndpointId endpoint, uint8_t * battery3AlarmMask) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AlarmMask, (uint8_t *) battery3AlarmMask, + sizeof(*battery3AlarmMask)); +} +EmberAfStatus SetBattery3AlarmMask(chip::EndpointId endpoint, uint8_t battery3AlarmMask) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AlarmMask, (uint8_t *) &battery3AlarmMask, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3VoltageMinThreshold(chip::EndpointId endpoint, uint8_t * battery3VoltageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageMinThreshold, + (uint8_t *) battery3VoltageMinThreshold, sizeof(*battery3VoltageMinThreshold)); +} +EmberAfStatus SetBattery3VoltageMinThreshold(chip::EndpointId endpoint, uint8_t battery3VoltageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageMinThreshold, + (uint8_t *) &battery3VoltageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3VoltageThreshold1(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold1, + (uint8_t *) battery3VoltageThreshold1, sizeof(*battery3VoltageThreshold1)); +} +EmberAfStatus SetBattery3VoltageThreshold1(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold1, + (uint8_t *) &battery3VoltageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3VoltageThreshold2(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold2, + (uint8_t *) battery3VoltageThreshold2, sizeof(*battery3VoltageThreshold2)); +} +EmberAfStatus SetBattery3VoltageThreshold2(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold2, + (uint8_t *) &battery3VoltageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3VoltageThreshold3(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold3, + (uint8_t *) battery3VoltageThreshold3, sizeof(*battery3VoltageThreshold3)); +} +EmberAfStatus SetBattery3VoltageThreshold3(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3VoltageThreshold3, + (uint8_t *) &battery3VoltageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3PercentageMinThreshold(chip::EndpointId endpoint, uint8_t * battery3PercentageMinThreshold) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageMinThreshold, + (uint8_t *) battery3PercentageMinThreshold, sizeof(*battery3PercentageMinThreshold)); +} +EmberAfStatus SetBattery3PercentageMinThreshold(chip::EndpointId endpoint, uint8_t battery3PercentageMinThreshold) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageMinThreshold, + (uint8_t *) &battery3PercentageMinThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3PercentageThreshold1(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold1) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold1, + (uint8_t *) battery3PercentageThreshold1, sizeof(*battery3PercentageThreshold1)); +} +EmberAfStatus SetBattery3PercentageThreshold1(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold1) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold1, + (uint8_t *) &battery3PercentageThreshold1, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3PercentageThreshold2(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold2) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold2, + (uint8_t *) battery3PercentageThreshold2, sizeof(*battery3PercentageThreshold2)); +} +EmberAfStatus SetBattery3PercentageThreshold2(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold2) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold2, + (uint8_t *) &battery3PercentageThreshold2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3PercentageThreshold3(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold3) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold3, + (uint8_t *) battery3PercentageThreshold3, sizeof(*battery3PercentageThreshold3)); +} +EmberAfStatus SetBattery3PercentageThreshold3(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold3) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3PercentageThreshold3, + (uint8_t *) &battery3PercentageThreshold3, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBattery3AlarmState(chip::EndpointId endpoint, uint32_t * battery3AlarmState) +{ + return emberAfReadServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AlarmState, (uint8_t *) battery3AlarmState, + sizeof(*battery3AlarmState)); +} +EmberAfStatus SetBattery3AlarmState(chip::EndpointId endpoint, uint32_t battery3AlarmState) +{ + return emberAfWriteServerAttribute(endpoint, PowerConfiguration::Id, Ids::Battery3AlarmState, (uint8_t *) &battery3AlarmState, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace PowerConfiguration + +namespace DeviceTemperatureConfiguration { +namespace Attributes { +EmberAfStatus GetCurrentTemperature(chip::EndpointId endpoint, int16_t * currentTemperature) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::CurrentTemperature, + (uint8_t *) currentTemperature, sizeof(*currentTemperature)); +} +EmberAfStatus SetCurrentTemperature(chip::EndpointId endpoint, int16_t currentTemperature) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::CurrentTemperature, + (uint8_t *) ¤tTemperature, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinTempExperienced(chip::EndpointId endpoint, int16_t * minTempExperienced) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::MinTempExperienced, + (uint8_t *) minTempExperienced, sizeof(*minTempExperienced)); +} +EmberAfStatus SetMinTempExperienced(chip::EndpointId endpoint, int16_t minTempExperienced) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::MinTempExperienced, + (uint8_t *) &minTempExperienced, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxTempExperienced(chip::EndpointId endpoint, int16_t * maxTempExperienced) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::MaxTempExperienced, + (uint8_t *) maxTempExperienced, sizeof(*maxTempExperienced)); +} +EmberAfStatus SetMaxTempExperienced(chip::EndpointId endpoint, int16_t maxTempExperienced) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::MaxTempExperienced, + (uint8_t *) &maxTempExperienced, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOverTempTotalDwell(chip::EndpointId endpoint, uint16_t * overTempTotalDwell) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::OverTempTotalDwell, + (uint8_t *) overTempTotalDwell, sizeof(*overTempTotalDwell)); +} +EmberAfStatus SetOverTempTotalDwell(chip::EndpointId endpoint, uint16_t overTempTotalDwell) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::OverTempTotalDwell, + (uint8_t *) &overTempTotalDwell, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDeviceTempAlarmMask(chip::EndpointId endpoint, uint8_t * deviceTempAlarmMask) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::DeviceTempAlarmMask, + (uint8_t *) deviceTempAlarmMask, sizeof(*deviceTempAlarmMask)); +} +EmberAfStatus SetDeviceTempAlarmMask(chip::EndpointId endpoint, uint8_t deviceTempAlarmMask) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::DeviceTempAlarmMask, + (uint8_t *) &deviceTempAlarmMask, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLowTempThreshold(chip::EndpointId endpoint, int16_t * lowTempThreshold) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::LowTempThreshold, + (uint8_t *) lowTempThreshold, sizeof(*lowTempThreshold)); +} +EmberAfStatus SetLowTempThreshold(chip::EndpointId endpoint, int16_t lowTempThreshold) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::LowTempThreshold, + (uint8_t *) &lowTempThreshold, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHighTempThreshold(chip::EndpointId endpoint, int16_t * highTempThreshold) +{ + return emberAfReadServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::HighTempThreshold, + (uint8_t *) highTempThreshold, sizeof(*highTempThreshold)); +} +EmberAfStatus SetHighTempThreshold(chip::EndpointId endpoint, int16_t highTempThreshold) +{ + return emberAfWriteServerAttribute(endpoint, DeviceTemperatureConfiguration::Id, Ids::HighTempThreshold, + (uint8_t *) &highTempThreshold, ZCL_INT16S_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace DeviceTemperatureConfiguration + +namespace Identify { +namespace Attributes { +EmberAfStatus GetIdentifyTime(chip::EndpointId endpoint, uint16_t * identifyTime) +{ + return emberAfReadServerAttribute(endpoint, Identify::Id, Ids::IdentifyTime, (uint8_t *) identifyTime, sizeof(*identifyTime)); +} +EmberAfStatus SetIdentifyTime(chip::EndpointId endpoint, uint16_t identifyTime) +{ + return emberAfWriteServerAttribute(endpoint, Identify::Id, Ids::IdentifyTime, (uint8_t *) &identifyTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCommissionState(chip::EndpointId endpoint, uint8_t * commissionState) +{ + return emberAfReadServerAttribute(endpoint, Identify::Id, Ids::CommissionState, (uint8_t *) commissionState, + sizeof(*commissionState)); +} +EmberAfStatus SetCommissionState(chip::EndpointId endpoint, uint8_t commissionState) +{ + return emberAfWriteServerAttribute(endpoint, Identify::Id, Ids::CommissionState, (uint8_t *) &commissionState, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Identify + +namespace Groups { +namespace Attributes { +EmberAfStatus GetNameSupport(chip::EndpointId endpoint, uint8_t * nameSupport) +{ + return emberAfReadServerAttribute(endpoint, Groups::Id, Ids::NameSupport, (uint8_t *) nameSupport, sizeof(*nameSupport)); +} +EmberAfStatus SetNameSupport(chip::EndpointId endpoint, uint8_t nameSupport) +{ + return emberAfWriteServerAttribute(endpoint, Groups::Id, Ids::NameSupport, (uint8_t *) &nameSupport, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Groups + +namespace Scenes { +namespace Attributes { +EmberAfStatus GetSceneCount(chip::EndpointId endpoint, uint8_t * sceneCount) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::SceneCount, (uint8_t *) sceneCount, sizeof(*sceneCount)); +} +EmberAfStatus SetSceneCount(chip::EndpointId endpoint, uint8_t sceneCount) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::SceneCount, (uint8_t *) &sceneCount, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentScene(chip::EndpointId endpoint, uint8_t * currentScene) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::CurrentScene, (uint8_t *) currentScene, sizeof(*currentScene)); +} +EmberAfStatus SetCurrentScene(chip::EndpointId endpoint, uint8_t currentScene) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::CurrentScene, (uint8_t *) ¤tScene, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentGroup(chip::EndpointId endpoint, uint16_t * currentGroup) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::CurrentGroup, (uint8_t *) currentGroup, sizeof(*currentGroup)); +} +EmberAfStatus SetCurrentGroup(chip::EndpointId endpoint, uint16_t currentGroup) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::CurrentGroup, (uint8_t *) ¤tGroup, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSceneValid(chip::EndpointId endpoint, uint8_t * sceneValid) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::SceneValid, (uint8_t *) sceneValid, sizeof(*sceneValid)); +} +EmberAfStatus SetSceneValid(chip::EndpointId endpoint, uint8_t sceneValid) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::SceneValid, (uint8_t *) &sceneValid, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNameSupport(chip::EndpointId endpoint, uint8_t * nameSupport) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::NameSupport, (uint8_t *) nameSupport, sizeof(*nameSupport)); +} +EmberAfStatus SetNameSupport(chip::EndpointId endpoint, uint8_t nameSupport) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::NameSupport, (uint8_t *) &nameSupport, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLastConfiguredBy(chip::EndpointId endpoint, /* TYPE WARNING: unknown defaults to */ uint8_t ** lastConfiguredBy) +{ + return emberAfReadServerAttribute(endpoint, Scenes::Id, Ids::LastConfiguredBy, (uint8_t *) lastConfiguredBy, + sizeof(*lastConfiguredBy)); +} +EmberAfStatus SetLastConfiguredBy(chip::EndpointId endpoint, /* TYPE WARNING: unknown defaults to */ uint8_t * lastConfiguredBy) +{ + return emberAfWriteServerAttribute(endpoint, Scenes::Id, Ids::LastConfiguredBy, (uint8_t *) &lastConfiguredBy, + ZCL_EUI64_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Scenes + +namespace OnOff { +namespace Attributes { +EmberAfStatus GetOnOff(chip::EndpointId endpoint, uint8_t * onOff) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::OnOff, (uint8_t *) onOff, sizeof(*onOff)); +} +EmberAfStatus SetOnOff(chip::EndpointId endpoint, uint8_t onOff) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::OnOff, (uint8_t *) &onOff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSampleMfgSpecificAttribute0x00000x1002(chip::EndpointId endpoint, + uint16_t * sampleMfgSpecificAttribute0x00000x1002) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00000x1002, + (uint8_t *) sampleMfgSpecificAttribute0x00000x1002, + sizeof(*sampleMfgSpecificAttribute0x00000x1002)); +} +EmberAfStatus SetSampleMfgSpecificAttribute0x00000x1002(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00000x1002) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00000x1002, + (uint8_t *) &sampleMfgSpecificAttribute0x00000x1002, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSampleMfgSpecificAttribute0x00000x1049(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00000x1049) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00000x1049, + (uint8_t *) sampleMfgSpecificAttribute0x00000x1049, + sizeof(*sampleMfgSpecificAttribute0x00000x1049)); +} +EmberAfStatus SetSampleMfgSpecificAttribute0x00000x1049(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00000x1049) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00000x1049, + (uint8_t *) &sampleMfgSpecificAttribute0x00000x1049, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSampleMfgSpecificAttribute0x00010x1002(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00010x1002) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00010x1002, + (uint8_t *) sampleMfgSpecificAttribute0x00010x1002, + sizeof(*sampleMfgSpecificAttribute0x00010x1002)); +} +EmberAfStatus SetSampleMfgSpecificAttribute0x00010x1002(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00010x1002) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00010x1002, + (uint8_t *) &sampleMfgSpecificAttribute0x00010x1002, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSampleMfgSpecificAttribute0x00010x1040(chip::EndpointId endpoint, + uint16_t * sampleMfgSpecificAttribute0x00010x1040) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00010x1040, + (uint8_t *) sampleMfgSpecificAttribute0x00010x1040, + sizeof(*sampleMfgSpecificAttribute0x00010x1040)); +} +EmberAfStatus SetSampleMfgSpecificAttribute0x00010x1040(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00010x1040) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::SampleMfgSpecificAttribute0x00010x1040, + (uint8_t *) &sampleMfgSpecificAttribute0x00010x1040, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetGlobalSceneControl(chip::EndpointId endpoint, uint8_t * globalSceneControl) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::GlobalSceneControl, (uint8_t *) globalSceneControl, + sizeof(*globalSceneControl)); +} +EmberAfStatus SetGlobalSceneControl(chip::EndpointId endpoint, uint8_t globalSceneControl) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::GlobalSceneControl, (uint8_t *) &globalSceneControl, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOnTime(chip::EndpointId endpoint, uint16_t * onTime) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::OnTime, (uint8_t *) onTime, sizeof(*onTime)); +} +EmberAfStatus SetOnTime(chip::EndpointId endpoint, uint16_t onTime) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::OnTime, (uint8_t *) &onTime, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOffWaitTime(chip::EndpointId endpoint, uint16_t * offWaitTime) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::OffWaitTime, (uint8_t *) offWaitTime, sizeof(*offWaitTime)); +} +EmberAfStatus SetOffWaitTime(chip::EndpointId endpoint, uint16_t offWaitTime) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::OffWaitTime, (uint8_t *) &offWaitTime, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStartUpOnOff(chip::EndpointId endpoint, uint8_t * startUpOnOff) +{ + return emberAfReadServerAttribute(endpoint, OnOff::Id, Ids::StartUpOnOff, (uint8_t *) startUpOnOff, sizeof(*startUpOnOff)); +} +EmberAfStatus SetStartUpOnOff(chip::EndpointId endpoint, uint8_t startUpOnOff) +{ + return emberAfWriteServerAttribute(endpoint, OnOff::Id, Ids::StartUpOnOff, (uint8_t *) &startUpOnOff, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace OnOff + +namespace OnOffSwitchConfiguration { +namespace Attributes { +EmberAfStatus GetSwitchType(chip::EndpointId endpoint, uint8_t * switchType) +{ + return emberAfReadServerAttribute(endpoint, OnOffSwitchConfiguration::Id, Ids::SwitchType, (uint8_t *) switchType, + sizeof(*switchType)); +} +EmberAfStatus SetSwitchType(chip::EndpointId endpoint, uint8_t switchType) +{ + return emberAfWriteServerAttribute(endpoint, OnOffSwitchConfiguration::Id, Ids::SwitchType, (uint8_t *) &switchType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSwitchActions(chip::EndpointId endpoint, uint8_t * switchActions) +{ + return emberAfReadServerAttribute(endpoint, OnOffSwitchConfiguration::Id, Ids::SwitchActions, (uint8_t *) switchActions, + sizeof(*switchActions)); +} +EmberAfStatus SetSwitchActions(chip::EndpointId endpoint, uint8_t switchActions) +{ + return emberAfWriteServerAttribute(endpoint, OnOffSwitchConfiguration::Id, Ids::SwitchActions, (uint8_t *) &switchActions, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace OnOffSwitchConfiguration + +namespace LevelControl { +namespace Attributes { +EmberAfStatus GetCurrentLevel(chip::EndpointId endpoint, uint8_t * currentLevel) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::CurrentLevel, (uint8_t *) currentLevel, + sizeof(*currentLevel)); +} +EmberAfStatus SetCurrentLevel(chip::EndpointId endpoint, uint8_t currentLevel) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::CurrentLevel, (uint8_t *) ¤tLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::RemainingTime, (uint8_t *) remainingTime, + sizeof(*remainingTime)); +} +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::RemainingTime, (uint8_t *) &remainingTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOptions(chip::EndpointId endpoint, uint8_t * options) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::Options, (uint8_t *) options, sizeof(*options)); +} +EmberAfStatus SetOptions(chip::EndpointId endpoint, uint8_t options) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::Options, (uint8_t *) &options, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOnOffTransitionTime(chip::EndpointId endpoint, uint16_t * onOffTransitionTime) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::OnOffTransitionTime, (uint8_t *) onOffTransitionTime, + sizeof(*onOffTransitionTime)); +} +EmberAfStatus SetOnOffTransitionTime(chip::EndpointId endpoint, uint16_t onOffTransitionTime) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::OnOffTransitionTime, (uint8_t *) &onOffTransitionTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOnLevel(chip::EndpointId endpoint, uint8_t * onLevel) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::OnLevel, (uint8_t *) onLevel, sizeof(*onLevel)); +} +EmberAfStatus SetOnLevel(chip::EndpointId endpoint, uint8_t onLevel) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::OnLevel, (uint8_t *) &onLevel, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOnTransitionTime(chip::EndpointId endpoint, uint16_t * onTransitionTime) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::OnTransitionTime, (uint8_t *) onTransitionTime, + sizeof(*onTransitionTime)); +} +EmberAfStatus SetOnTransitionTime(chip::EndpointId endpoint, uint16_t onTransitionTime) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::OnTransitionTime, (uint8_t *) &onTransitionTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOffTransitionTime(chip::EndpointId endpoint, uint16_t * offTransitionTime) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::OffTransitionTime, (uint8_t *) offTransitionTime, + sizeof(*offTransitionTime)); +} +EmberAfStatus SetOffTransitionTime(chip::EndpointId endpoint, uint16_t offTransitionTime) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::OffTransitionTime, (uint8_t *) &offTransitionTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDefaultMoveRate(chip::EndpointId endpoint, uint8_t * defaultMoveRate) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::DefaultMoveRate, (uint8_t *) defaultMoveRate, + sizeof(*defaultMoveRate)); +} +EmberAfStatus SetDefaultMoveRate(chip::EndpointId endpoint, uint8_t defaultMoveRate) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::DefaultMoveRate, (uint8_t *) &defaultMoveRate, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStartUpCurrentLevel(chip::EndpointId endpoint, uint8_t * startUpCurrentLevel) +{ + return emberAfReadServerAttribute(endpoint, LevelControl::Id, Ids::StartUpCurrentLevel, (uint8_t *) startUpCurrentLevel, + sizeof(*startUpCurrentLevel)); +} +EmberAfStatus SetStartUpCurrentLevel(chip::EndpointId endpoint, uint8_t startUpCurrentLevel) +{ + return emberAfWriteServerAttribute(endpoint, LevelControl::Id, Ids::StartUpCurrentLevel, (uint8_t *) &startUpCurrentLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace LevelControl + +namespace Alarms { +namespace Attributes { +EmberAfStatus GetAlarmCount(chip::EndpointId endpoint, uint16_t * alarmCount) +{ + return emberAfReadServerAttribute(endpoint, Alarms::Id, Ids::AlarmCount, (uint8_t *) alarmCount, sizeof(*alarmCount)); +} +EmberAfStatus SetAlarmCount(chip::EndpointId endpoint, uint16_t alarmCount) +{ + return emberAfWriteServerAttribute(endpoint, Alarms::Id, Ids::AlarmCount, (uint8_t *) &alarmCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Alarms + +namespace Time { +namespace Attributes { +EmberAfStatus GetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** time) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::Time, (uint8_t *) time, sizeof(*time)); +} +EmberAfStatus SetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * time) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::Time, (uint8_t *) &time, ZCL_UTC_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTimeStatus(chip::EndpointId endpoint, uint8_t * timeStatus) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::TimeStatus, (uint8_t *) timeStatus, sizeof(*timeStatus)); +} +EmberAfStatus SetTimeStatus(chip::EndpointId endpoint, uint8_t timeStatus) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::TimeStatus, (uint8_t *) &timeStatus, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTimeZone(chip::EndpointId endpoint, int32_t * timeZone) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::TimeZone, (uint8_t *) timeZone, sizeof(*timeZone)); +} +EmberAfStatus SetTimeZone(chip::EndpointId endpoint, int32_t timeZone) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::TimeZone, (uint8_t *) &timeZone, ZCL_INT32S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDstStart(chip::EndpointId endpoint, uint32_t * dstStart) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::DstStart, (uint8_t *) dstStart, sizeof(*dstStart)); +} +EmberAfStatus SetDstStart(chip::EndpointId endpoint, uint32_t dstStart) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::DstStart, (uint8_t *) &dstStart, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDstEnd(chip::EndpointId endpoint, uint32_t * dstEnd) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::DstEnd, (uint8_t *) dstEnd, sizeof(*dstEnd)); +} +EmberAfStatus SetDstEnd(chip::EndpointId endpoint, uint32_t dstEnd) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::DstEnd, (uint8_t *) &dstEnd, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDstShift(chip::EndpointId endpoint, int32_t * dstShift) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::DstShift, (uint8_t *) dstShift, sizeof(*dstShift)); +} +EmberAfStatus SetDstShift(chip::EndpointId endpoint, int32_t dstShift) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::DstShift, (uint8_t *) &dstShift, ZCL_INT32S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStandardTime(chip::EndpointId endpoint, uint32_t * standardTime) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::StandardTime, (uint8_t *) standardTime, sizeof(*standardTime)); +} +EmberAfStatus SetStandardTime(chip::EndpointId endpoint, uint32_t standardTime) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::StandardTime, (uint8_t *) &standardTime, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLocalTime(chip::EndpointId endpoint, uint32_t * localTime) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::LocalTime, (uint8_t *) localTime, sizeof(*localTime)); +} +EmberAfStatus SetLocalTime(chip::EndpointId endpoint, uint32_t localTime) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::LocalTime, (uint8_t *) &localTime, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLastSetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** lastSetTime) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::LastSetTime, (uint8_t *) lastSetTime, sizeof(*lastSetTime)); +} +EmberAfStatus SetLastSetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * lastSetTime) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::LastSetTime, (uint8_t *) &lastSetTime, ZCL_UTC_ATTRIBUTE_TYPE); +} +EmberAfStatus GetValidUntilTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** validUntilTime) +{ + return emberAfReadServerAttribute(endpoint, Time::Id, Ids::ValidUntilTime, (uint8_t *) validUntilTime, sizeof(*validUntilTime)); +} +EmberAfStatus SetValidUntilTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * validUntilTime) +{ + return emberAfWriteServerAttribute(endpoint, Time::Id, Ids::ValidUntilTime, (uint8_t *) &validUntilTime, + ZCL_UTC_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Time + +namespace BinaryInputBasic { +namespace Attributes { +EmberAfStatus GetOutOfService(chip::EndpointId endpoint, uint8_t * outOfService) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::OutOfService, (uint8_t *) outOfService, + sizeof(*outOfService)); +} +EmberAfStatus SetOutOfService(chip::EndpointId endpoint, uint8_t outOfService) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::OutOfService, (uint8_t *) &outOfService, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPolarity(chip::EndpointId endpoint, uint8_t * polarity) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::Polarity, (uint8_t *) polarity, sizeof(*polarity)); +} +EmberAfStatus SetPolarity(chip::EndpointId endpoint, uint8_t polarity) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::Polarity, (uint8_t *) &polarity, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPresentValue(chip::EndpointId endpoint, uint8_t * presentValue) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::PresentValue, (uint8_t *) presentValue, + sizeof(*presentValue)); +} +EmberAfStatus SetPresentValue(chip::EndpointId endpoint, uint8_t presentValue) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::PresentValue, (uint8_t *) &presentValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReliability(chip::EndpointId endpoint, uint8_t * reliability) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::Reliability, (uint8_t *) reliability, + sizeof(*reliability)); +} +EmberAfStatus SetReliability(chip::EndpointId endpoint, uint8_t reliability) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::Reliability, (uint8_t *) &reliability, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStatusFlags(chip::EndpointId endpoint, uint8_t * statusFlags) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::StatusFlags, (uint8_t *) statusFlags, + sizeof(*statusFlags)); +} +EmberAfStatus SetStatusFlags(chip::EndpointId endpoint, uint8_t statusFlags) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::StatusFlags, (uint8_t *) &statusFlags, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApplicationType(chip::EndpointId endpoint, uint32_t * applicationType) +{ + return emberAfReadServerAttribute(endpoint, BinaryInputBasic::Id, Ids::ApplicationType, (uint8_t *) applicationType, + sizeof(*applicationType)); +} +EmberAfStatus SetApplicationType(chip::EndpointId endpoint, uint32_t applicationType) +{ + return emberAfWriteServerAttribute(endpoint, BinaryInputBasic::Id, Ids::ApplicationType, (uint8_t *) &applicationType, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BinaryInputBasic + +namespace PowerProfile { +namespace Attributes { +EmberAfStatus GetTotalProfileNum(chip::EndpointId endpoint, uint8_t * totalProfileNum) +{ + return emberAfReadServerAttribute(endpoint, PowerProfile::Id, Ids::TotalProfileNum, (uint8_t *) totalProfileNum, + sizeof(*totalProfileNum)); +} +EmberAfStatus SetTotalProfileNum(chip::EndpointId endpoint, uint8_t totalProfileNum) +{ + return emberAfWriteServerAttribute(endpoint, PowerProfile::Id, Ids::TotalProfileNum, (uint8_t *) &totalProfileNum, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMultipleScheduling(chip::EndpointId endpoint, uint8_t * multipleScheduling) +{ + return emberAfReadServerAttribute(endpoint, PowerProfile::Id, Ids::MultipleScheduling, (uint8_t *) multipleScheduling, + sizeof(*multipleScheduling)); +} +EmberAfStatus SetMultipleScheduling(chip::EndpointId endpoint, uint8_t multipleScheduling) +{ + return emberAfWriteServerAttribute(endpoint, PowerProfile::Id, Ids::MultipleScheduling, (uint8_t *) &multipleScheduling, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnergyFormatting(chip::EndpointId endpoint, uint8_t * energyFormatting) +{ + return emberAfReadServerAttribute(endpoint, PowerProfile::Id, Ids::EnergyFormatting, (uint8_t *) energyFormatting, + sizeof(*energyFormatting)); +} +EmberAfStatus SetEnergyFormatting(chip::EndpointId endpoint, uint8_t energyFormatting) +{ + return emberAfWriteServerAttribute(endpoint, PowerProfile::Id, Ids::EnergyFormatting, (uint8_t *) &energyFormatting, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnergyRemote(chip::EndpointId endpoint, uint8_t * energyRemote) +{ + return emberAfReadServerAttribute(endpoint, PowerProfile::Id, Ids::EnergyRemote, (uint8_t *) energyRemote, + sizeof(*energyRemote)); +} +EmberAfStatus SetEnergyRemote(chip::EndpointId endpoint, uint8_t energyRemote) +{ + return emberAfWriteServerAttribute(endpoint, PowerProfile::Id, Ids::EnergyRemote, (uint8_t *) &energyRemote, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetScheduleMode(chip::EndpointId endpoint, uint8_t * scheduleMode) +{ + return emberAfReadServerAttribute(endpoint, PowerProfile::Id, Ids::ScheduleMode, (uint8_t *) scheduleMode, + sizeof(*scheduleMode)); +} +EmberAfStatus SetScheduleMode(chip::EndpointId endpoint, uint8_t scheduleMode) +{ + return emberAfWriteServerAttribute(endpoint, PowerProfile::Id, Ids::ScheduleMode, (uint8_t *) &scheduleMode, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace PowerProfile + +namespace ApplianceControl { +namespace Attributes { +EmberAfStatus GetStartTime(chip::EndpointId endpoint, uint16_t * startTime) +{ + return emberAfReadServerAttribute(endpoint, ApplianceControl::Id, Ids::StartTime, (uint8_t *) startTime, sizeof(*startTime)); +} +EmberAfStatus SetStartTime(chip::EndpointId endpoint, uint16_t startTime) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceControl::Id, Ids::StartTime, (uint8_t *) &startTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetFinishTime(chip::EndpointId endpoint, uint16_t * finishTime) +{ + return emberAfReadServerAttribute(endpoint, ApplianceControl::Id, Ids::FinishTime, (uint8_t *) finishTime, sizeof(*finishTime)); +} +EmberAfStatus SetFinishTime(chip::EndpointId endpoint, uint16_t finishTime) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceControl::Id, Ids::FinishTime, (uint8_t *) &finishTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime) +{ + return emberAfReadServerAttribute(endpoint, ApplianceControl::Id, Ids::RemainingTime, (uint8_t *) remainingTime, + sizeof(*remainingTime)); +} +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceControl::Id, Ids::RemainingTime, (uint8_t *) &remainingTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ApplianceControl + +namespace Descriptor { +namespace Attributes { +} // namespace Attributes +} // namespace Descriptor + +namespace PollControl { +namespace Attributes { +EmberAfStatus GetCheckInInterval(chip::EndpointId endpoint, uint32_t * checkInInterval) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::CheckInInterval, (uint8_t *) checkInInterval, + sizeof(*checkInInterval)); +} +EmberAfStatus SetCheckInInterval(chip::EndpointId endpoint, uint32_t checkInInterval) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::CheckInInterval, (uint8_t *) &checkInInterval, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLongPollInterval(chip::EndpointId endpoint, uint32_t * longPollInterval) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::LongPollInterval, (uint8_t *) longPollInterval, + sizeof(*longPollInterval)); +} +EmberAfStatus SetLongPollInterval(chip::EndpointId endpoint, uint32_t longPollInterval) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::LongPollInterval, (uint8_t *) &longPollInterval, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetShortPollInterval(chip::EndpointId endpoint, uint16_t * shortPollInterval) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::ShortPollInterval, (uint8_t *) shortPollInterval, + sizeof(*shortPollInterval)); +} +EmberAfStatus SetShortPollInterval(chip::EndpointId endpoint, uint16_t shortPollInterval) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::ShortPollInterval, (uint8_t *) &shortPollInterval, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetFastPollTimeout(chip::EndpointId endpoint, uint16_t * fastPollTimeout) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::FastPollTimeout, (uint8_t *) fastPollTimeout, + sizeof(*fastPollTimeout)); +} +EmberAfStatus SetFastPollTimeout(chip::EndpointId endpoint, uint16_t fastPollTimeout) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::FastPollTimeout, (uint8_t *) &fastPollTimeout, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCheckInIntervalMin(chip::EndpointId endpoint, uint32_t * checkInIntervalMin) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::CheckInIntervalMin, (uint8_t *) checkInIntervalMin, + sizeof(*checkInIntervalMin)); +} +EmberAfStatus SetCheckInIntervalMin(chip::EndpointId endpoint, uint32_t checkInIntervalMin) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::CheckInIntervalMin, (uint8_t *) &checkInIntervalMin, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLongPollIntervalMin(chip::EndpointId endpoint, uint32_t * longPollIntervalMin) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::LongPollIntervalMin, (uint8_t *) longPollIntervalMin, + sizeof(*longPollIntervalMin)); +} +EmberAfStatus SetLongPollIntervalMin(chip::EndpointId endpoint, uint32_t longPollIntervalMin) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::LongPollIntervalMin, (uint8_t *) &longPollIntervalMin, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetFastPollTimeoutMax(chip::EndpointId endpoint, uint16_t * fastPollTimeoutMax) +{ + return emberAfReadServerAttribute(endpoint, PollControl::Id, Ids::FastPollTimeoutMax, (uint8_t *) fastPollTimeoutMax, + sizeof(*fastPollTimeoutMax)); +} +EmberAfStatus SetFastPollTimeoutMax(chip::EndpointId endpoint, uint16_t fastPollTimeoutMax) +{ + return emberAfWriteServerAttribute(endpoint, PollControl::Id, Ids::FastPollTimeoutMax, (uint8_t *) &fastPollTimeoutMax, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace PollControl + +namespace Basic { +namespace Attributes { +EmberAfStatus GetInteractionModelVersion(chip::EndpointId endpoint, uint16_t * interactionModelVersion) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::InteractionModelVersion, (uint8_t *) interactionModelVersion, + sizeof(*interactionModelVersion)); +} +EmberAfStatus SetInteractionModelVersion(chip::EndpointId endpoint, uint16_t interactionModelVersion) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::InteractionModelVersion, (uint8_t *) &interactionModelVersion, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetVendorID(chip::EndpointId endpoint, uint16_t * vendorID) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::VendorID, (uint8_t *) vendorID, sizeof(*vendorID)); +} +EmberAfStatus SetVendorID(chip::EndpointId endpoint, uint16_t vendorID) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::VendorID, (uint8_t *) &vendorID, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetProductID(chip::EndpointId endpoint, uint16_t * productID) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::ProductID, (uint8_t *) productID, sizeof(*productID)); +} +EmberAfStatus SetProductID(chip::EndpointId endpoint, uint16_t productID) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::ProductID, (uint8_t *) &productID, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHardwareVersion(chip::EndpointId endpoint, uint16_t * hardwareVersion) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::HardwareVersion, (uint8_t *) hardwareVersion, + sizeof(*hardwareVersion)); +} +EmberAfStatus SetHardwareVersion(chip::EndpointId endpoint, uint16_t hardwareVersion) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::HardwareVersion, (uint8_t *) &hardwareVersion, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSoftwareVersion(chip::EndpointId endpoint, uint32_t * softwareVersion) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::SoftwareVersion, (uint8_t *) softwareVersion, + sizeof(*softwareVersion)); +} +EmberAfStatus SetSoftwareVersion(chip::EndpointId endpoint, uint32_t softwareVersion) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::SoftwareVersion, (uint8_t *) &softwareVersion, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLocalConfigDisabled(chip::EndpointId endpoint, uint8_t * localConfigDisabled) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::LocalConfigDisabled, (uint8_t *) localConfigDisabled, + sizeof(*localConfigDisabled)); +} +EmberAfStatus SetLocalConfigDisabled(chip::EndpointId endpoint, uint8_t localConfigDisabled) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::LocalConfigDisabled, (uint8_t *) &localConfigDisabled, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReachable(chip::EndpointId endpoint, uint8_t * reachable) +{ + return emberAfReadServerAttribute(endpoint, Basic::Id, Ids::Reachable, (uint8_t *) reachable, sizeof(*reachable)); +} +EmberAfStatus SetReachable(chip::EndpointId endpoint, uint8_t reachable) +{ + return emberAfWriteServerAttribute(endpoint, Basic::Id, Ids::Reachable, (uint8_t *) &reachable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Basic + +namespace GeneralCommissioning { +namespace Attributes { +EmberAfStatus GetBreadcrumb(chip::EndpointId endpoint, uint64_t * breadcrumb) +{ + return emberAfReadServerAttribute(endpoint, GeneralCommissioning::Id, Ids::Breadcrumb, (uint8_t *) breadcrumb, + sizeof(*breadcrumb)); +} +EmberAfStatus SetBreadcrumb(chip::EndpointId endpoint, uint64_t breadcrumb) +{ + return emberAfWriteServerAttribute(endpoint, GeneralCommissioning::Id, Ids::Breadcrumb, (uint8_t *) &breadcrumb, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace GeneralCommissioning + +namespace GeneralDiagnostics { +namespace Attributes { +EmberAfStatus GetRebootCount(chip::EndpointId endpoint, uint16_t * rebootCount) +{ + return emberAfReadServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::RebootCount, (uint8_t *) rebootCount, + sizeof(*rebootCount)); +} +EmberAfStatus SetRebootCount(chip::EndpointId endpoint, uint16_t rebootCount) +{ + return emberAfWriteServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::RebootCount, (uint8_t *) &rebootCount, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUpTime(chip::EndpointId endpoint, uint64_t * upTime) +{ + return emberAfReadServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::UpTime, (uint8_t *) upTime, sizeof(*upTime)); +} +EmberAfStatus SetUpTime(chip::EndpointId endpoint, uint64_t upTime) +{ + return emberAfWriteServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::UpTime, (uint8_t *) &upTime, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTotalOperationalHours(chip::EndpointId endpoint, uint32_t * totalOperationalHours) +{ + return emberAfReadServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::TotalOperationalHours, + (uint8_t *) totalOperationalHours, sizeof(*totalOperationalHours)); +} +EmberAfStatus SetTotalOperationalHours(chip::EndpointId endpoint, uint32_t totalOperationalHours) +{ + return emberAfWriteServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::TotalOperationalHours, + (uint8_t *) &totalOperationalHours, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBootReasons(chip::EndpointId endpoint, uint8_t * bootReasons) +{ + return emberAfReadServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::BootReasons, (uint8_t *) bootReasons, + sizeof(*bootReasons)); +} +EmberAfStatus SetBootReasons(chip::EndpointId endpoint, uint8_t bootReasons) +{ + return emberAfWriteServerAttribute(endpoint, GeneralDiagnostics::Id, Ids::BootReasons, (uint8_t *) &bootReasons, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace GeneralDiagnostics + +namespace SoftwareDiagnostics { +namespace Attributes { +EmberAfStatus GetCurrentHeapFree(chip::EndpointId endpoint, uint64_t * currentHeapFree) +{ + return emberAfReadServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapFree, (uint8_t *) currentHeapFree, + sizeof(*currentHeapFree)); +} +EmberAfStatus SetCurrentHeapFree(chip::EndpointId endpoint, uint64_t currentHeapFree) +{ + return emberAfWriteServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapFree, (uint8_t *) ¤tHeapFree, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentHeapUsed(chip::EndpointId endpoint, uint64_t * currentHeapUsed) +{ + return emberAfReadServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapUsed, (uint8_t *) currentHeapUsed, + sizeof(*currentHeapUsed)); +} +EmberAfStatus SetCurrentHeapUsed(chip::EndpointId endpoint, uint64_t currentHeapUsed) +{ + return emberAfWriteServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapUsed, (uint8_t *) ¤tHeapUsed, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentHeapHighWatermark(chip::EndpointId endpoint, uint64_t * currentHeapHighWatermark) +{ + return emberAfReadServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapHighWatermark, + (uint8_t *) currentHeapHighWatermark, sizeof(*currentHeapHighWatermark)); +} +EmberAfStatus SetCurrentHeapHighWatermark(chip::EndpointId endpoint, uint64_t currentHeapHighWatermark) +{ + return emberAfWriteServerAttribute(endpoint, SoftwareDiagnostics::Id, Ids::CurrentHeapHighWatermark, + (uint8_t *) ¤tHeapHighWatermark, ZCL_INT64U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SoftwareDiagnostics + +namespace ThreadNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetChannel(chip::EndpointId endpoint, uint8_t * channel) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Channel, (uint8_t *) channel, sizeof(*channel)); +} +EmberAfStatus SetChannel(chip::EndpointId endpoint, uint8_t channel) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Channel, (uint8_t *) &channel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRoutingRole(chip::EndpointId endpoint, uint8_t * routingRole) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RoutingRole, (uint8_t *) routingRole, + sizeof(*routingRole)); +} +EmberAfStatus SetRoutingRole(chip::EndpointId endpoint, uint8_t routingRole) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RoutingRole, (uint8_t *) &routingRole, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPanId(chip::EndpointId endpoint, uint16_t * panId) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PanId, (uint8_t *) panId, sizeof(*panId)); +} +EmberAfStatus SetPanId(chip::EndpointId endpoint, uint16_t panId) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PanId, (uint8_t *) &panId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetExtendedPanId(chip::EndpointId endpoint, uint64_t * extendedPanId) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ExtendedPanId, (uint8_t *) extendedPanId, + sizeof(*extendedPanId)); +} +EmberAfStatus SetExtendedPanId(chip::EndpointId endpoint, uint64_t extendedPanId) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ExtendedPanId, (uint8_t *) &extendedPanId, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) overrunCount, + sizeof(*overrunCount)); +} +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) &overrunCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPartitionId(chip::EndpointId endpoint, uint32_t * partitionId) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PartitionId, (uint8_t *) partitionId, + sizeof(*partitionId)); +} +EmberAfStatus SetPartitionId(chip::EndpointId endpoint, uint32_t partitionId) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PartitionId, (uint8_t *) &partitionId, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetWeighting(chip::EndpointId endpoint, uint8_t * weighting) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Weighting, (uint8_t *) weighting, + sizeof(*weighting)); +} +EmberAfStatus SetWeighting(chip::EndpointId endpoint, uint8_t weighting) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Weighting, (uint8_t *) &weighting, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDataVersion(chip::EndpointId endpoint, uint8_t * dataVersion) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::DataVersion, (uint8_t *) dataVersion, + sizeof(*dataVersion)); +} +EmberAfStatus SetDataVersion(chip::EndpointId endpoint, uint8_t dataVersion) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::DataVersion, (uint8_t *) &dataVersion, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStableDataVersion(chip::EndpointId endpoint, uint8_t * stableDataVersion) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::StableDataVersion, (uint8_t *) stableDataVersion, + sizeof(*stableDataVersion)); +} +EmberAfStatus SetStableDataVersion(chip::EndpointId endpoint, uint8_t stableDataVersion) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::StableDataVersion, + (uint8_t *) &stableDataVersion, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLeaderRouterId(chip::EndpointId endpoint, uint8_t * leaderRouterId) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::LeaderRouterId, (uint8_t *) leaderRouterId, + sizeof(*leaderRouterId)); +} +EmberAfStatus SetLeaderRouterId(chip::EndpointId endpoint, uint8_t leaderRouterId) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::LeaderRouterId, (uint8_t *) &leaderRouterId, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDetachedRoleCount(chip::EndpointId endpoint, uint16_t * detachedRoleCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::DetachedRoleCount, (uint8_t *) detachedRoleCount, + sizeof(*detachedRoleCount)); +} +EmberAfStatus SetDetachedRoleCount(chip::EndpointId endpoint, uint16_t detachedRoleCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::DetachedRoleCount, + (uint8_t *) &detachedRoleCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetChildRoleCount(chip::EndpointId endpoint, uint16_t * childRoleCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ChildRoleCount, (uint8_t *) childRoleCount, + sizeof(*childRoleCount)); +} +EmberAfStatus SetChildRoleCount(chip::EndpointId endpoint, uint16_t childRoleCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ChildRoleCount, (uint8_t *) &childRoleCount, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRouterRoleCount(chip::EndpointId endpoint, uint16_t * routerRoleCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RouterRoleCount, (uint8_t *) routerRoleCount, + sizeof(*routerRoleCount)); +} +EmberAfStatus SetRouterRoleCount(chip::EndpointId endpoint, uint16_t routerRoleCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RouterRoleCount, (uint8_t *) &routerRoleCount, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLeaderRoleCount(chip::EndpointId endpoint, uint16_t * leaderRoleCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::LeaderRoleCount, (uint8_t *) leaderRoleCount, + sizeof(*leaderRoleCount)); +} +EmberAfStatus SetLeaderRoleCount(chip::EndpointId endpoint, uint16_t leaderRoleCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::LeaderRoleCount, (uint8_t *) &leaderRoleCount, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAttachAttemptCount(chip::EndpointId endpoint, uint16_t * attachAttemptCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::AttachAttemptCount, + (uint8_t *) attachAttemptCount, sizeof(*attachAttemptCount)); +} +EmberAfStatus SetAttachAttemptCount(chip::EndpointId endpoint, uint16_t attachAttemptCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::AttachAttemptCount, + (uint8_t *) &attachAttemptCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPartitionIdChangeCount(chip::EndpointId endpoint, uint16_t * partitionIdChangeCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PartitionIdChangeCount, + (uint8_t *) partitionIdChangeCount, sizeof(*partitionIdChangeCount)); +} +EmberAfStatus SetPartitionIdChangeCount(chip::EndpointId endpoint, uint16_t partitionIdChangeCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PartitionIdChangeCount, + (uint8_t *) &partitionIdChangeCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBetterPartitionAttachAttemptCount(chip::EndpointId endpoint, uint16_t * betterPartitionAttachAttemptCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::BetterPartitionAttachAttemptCount, + (uint8_t *) betterPartitionAttachAttemptCount, sizeof(*betterPartitionAttachAttemptCount)); +} +EmberAfStatus SetBetterPartitionAttachAttemptCount(chip::EndpointId endpoint, uint16_t betterPartitionAttachAttemptCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::BetterPartitionAttachAttemptCount, + (uint8_t *) &betterPartitionAttachAttemptCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetParentChangeCount(chip::EndpointId endpoint, uint16_t * parentChangeCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ParentChangeCount, (uint8_t *) parentChangeCount, + sizeof(*parentChangeCount)); +} +EmberAfStatus SetParentChangeCount(chip::EndpointId endpoint, uint16_t parentChangeCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ParentChangeCount, + (uint8_t *) &parentChangeCount, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxTotalCount(chip::EndpointId endpoint, uint32_t * txTotalCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxTotalCount, (uint8_t *) txTotalCount, + sizeof(*txTotalCount)); +} +EmberAfStatus SetTxTotalCount(chip::EndpointId endpoint, uint32_t txTotalCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxTotalCount, (uint8_t *) &txTotalCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxUnicastCount(chip::EndpointId endpoint, uint32_t * txUnicastCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxUnicastCount, (uint8_t *) txUnicastCount, + sizeof(*txUnicastCount)); +} +EmberAfStatus SetTxUnicastCount(chip::EndpointId endpoint, uint32_t txUnicastCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxUnicastCount, (uint8_t *) &txUnicastCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxBroadcastCount(chip::EndpointId endpoint, uint32_t * txBroadcastCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBroadcastCount, (uint8_t *) txBroadcastCount, + sizeof(*txBroadcastCount)); +} +EmberAfStatus SetTxBroadcastCount(chip::EndpointId endpoint, uint32_t txBroadcastCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBroadcastCount, (uint8_t *) &txBroadcastCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxAckRequestedCount(chip::EndpointId endpoint, uint32_t * txAckRequestedCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxAckRequestedCount, + (uint8_t *) txAckRequestedCount, sizeof(*txAckRequestedCount)); +} +EmberAfStatus SetTxAckRequestedCount(chip::EndpointId endpoint, uint32_t txAckRequestedCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxAckRequestedCount, + (uint8_t *) &txAckRequestedCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxAckedCount(chip::EndpointId endpoint, uint32_t * txAckedCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxAckedCount, (uint8_t *) txAckedCount, + sizeof(*txAckedCount)); +} +EmberAfStatus SetTxAckedCount(chip::EndpointId endpoint, uint32_t txAckedCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxAckedCount, (uint8_t *) &txAckedCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxNoAckRequestedCount(chip::EndpointId endpoint, uint32_t * txNoAckRequestedCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxNoAckRequestedCount, + (uint8_t *) txNoAckRequestedCount, sizeof(*txNoAckRequestedCount)); +} +EmberAfStatus SetTxNoAckRequestedCount(chip::EndpointId endpoint, uint32_t txNoAckRequestedCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxNoAckRequestedCount, + (uint8_t *) &txNoAckRequestedCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxDataCount(chip::EndpointId endpoint, uint32_t * txDataCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDataCount, (uint8_t *) txDataCount, + sizeof(*txDataCount)); +} +EmberAfStatus SetTxDataCount(chip::EndpointId endpoint, uint32_t txDataCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDataCount, (uint8_t *) &txDataCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxDataPollCount(chip::EndpointId endpoint, uint32_t * txDataPollCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDataPollCount, (uint8_t *) txDataPollCount, + sizeof(*txDataPollCount)); +} +EmberAfStatus SetTxDataPollCount(chip::EndpointId endpoint, uint32_t txDataPollCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDataPollCount, (uint8_t *) &txDataPollCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxBeaconCount(chip::EndpointId endpoint, uint32_t * txBeaconCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBeaconCount, (uint8_t *) txBeaconCount, + sizeof(*txBeaconCount)); +} +EmberAfStatus SetTxBeaconCount(chip::EndpointId endpoint, uint32_t txBeaconCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBeaconCount, (uint8_t *) &txBeaconCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxBeaconRequestCount(chip::EndpointId endpoint, uint32_t * txBeaconRequestCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBeaconRequestCount, + (uint8_t *) txBeaconRequestCount, sizeof(*txBeaconRequestCount)); +} +EmberAfStatus SetTxBeaconRequestCount(chip::EndpointId endpoint, uint32_t txBeaconRequestCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxBeaconRequestCount, + (uint8_t *) &txBeaconRequestCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxOtherCount(chip::EndpointId endpoint, uint32_t * txOtherCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxOtherCount, (uint8_t *) txOtherCount, + sizeof(*txOtherCount)); +} +EmberAfStatus SetTxOtherCount(chip::EndpointId endpoint, uint32_t txOtherCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxOtherCount, (uint8_t *) &txOtherCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxRetryCount(chip::EndpointId endpoint, uint32_t * txRetryCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxRetryCount, (uint8_t *) txRetryCount, + sizeof(*txRetryCount)); +} +EmberAfStatus SetTxRetryCount(chip::EndpointId endpoint, uint32_t txRetryCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxRetryCount, (uint8_t *) &txRetryCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxDirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t * txDirectMaxRetryExpiryCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDirectMaxRetryExpiryCount, + (uint8_t *) txDirectMaxRetryExpiryCount, sizeof(*txDirectMaxRetryExpiryCount)); +} +EmberAfStatus SetTxDirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t txDirectMaxRetryExpiryCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxDirectMaxRetryExpiryCount, + (uint8_t *) &txDirectMaxRetryExpiryCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxIndirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t * txIndirectMaxRetryExpiryCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxIndirectMaxRetryExpiryCount, + (uint8_t *) txIndirectMaxRetryExpiryCount, sizeof(*txIndirectMaxRetryExpiryCount)); +} +EmberAfStatus SetTxIndirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t txIndirectMaxRetryExpiryCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxIndirectMaxRetryExpiryCount, + (uint8_t *) &txIndirectMaxRetryExpiryCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxErrCcaCount(chip::EndpointId endpoint, uint32_t * txErrCcaCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrCcaCount, (uint8_t *) txErrCcaCount, + sizeof(*txErrCcaCount)); +} +EmberAfStatus SetTxErrCcaCount(chip::EndpointId endpoint, uint32_t txErrCcaCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrCcaCount, (uint8_t *) &txErrCcaCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxErrAbortCount(chip::EndpointId endpoint, uint32_t * txErrAbortCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrAbortCount, (uint8_t *) txErrAbortCount, + sizeof(*txErrAbortCount)); +} +EmberAfStatus SetTxErrAbortCount(chip::EndpointId endpoint, uint32_t txErrAbortCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrAbortCount, (uint8_t *) &txErrAbortCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxErrBusyChannelCount(chip::EndpointId endpoint, uint32_t * txErrBusyChannelCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrBusyChannelCount, + (uint8_t *) txErrBusyChannelCount, sizeof(*txErrBusyChannelCount)); +} +EmberAfStatus SetTxErrBusyChannelCount(chip::EndpointId endpoint, uint32_t txErrBusyChannelCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::TxErrBusyChannelCount, + (uint8_t *) &txErrBusyChannelCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxTotalCount(chip::EndpointId endpoint, uint32_t * rxTotalCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxTotalCount, (uint8_t *) rxTotalCount, + sizeof(*rxTotalCount)); +} +EmberAfStatus SetRxTotalCount(chip::EndpointId endpoint, uint32_t rxTotalCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxTotalCount, (uint8_t *) &rxTotalCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxUnicastCount(chip::EndpointId endpoint, uint32_t * rxUnicastCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxUnicastCount, (uint8_t *) rxUnicastCount, + sizeof(*rxUnicastCount)); +} +EmberAfStatus SetRxUnicastCount(chip::EndpointId endpoint, uint32_t rxUnicastCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxUnicastCount, (uint8_t *) &rxUnicastCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxBroadcastCount(chip::EndpointId endpoint, uint32_t * rxBroadcastCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBroadcastCount, (uint8_t *) rxBroadcastCount, + sizeof(*rxBroadcastCount)); +} +EmberAfStatus SetRxBroadcastCount(chip::EndpointId endpoint, uint32_t rxBroadcastCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBroadcastCount, (uint8_t *) &rxBroadcastCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxDataCount(chip::EndpointId endpoint, uint32_t * rxDataCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDataCount, (uint8_t *) rxDataCount, + sizeof(*rxDataCount)); +} +EmberAfStatus SetRxDataCount(chip::EndpointId endpoint, uint32_t rxDataCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDataCount, (uint8_t *) &rxDataCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxDataPollCount(chip::EndpointId endpoint, uint32_t * rxDataPollCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDataPollCount, (uint8_t *) rxDataPollCount, + sizeof(*rxDataPollCount)); +} +EmberAfStatus SetRxDataPollCount(chip::EndpointId endpoint, uint32_t rxDataPollCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDataPollCount, (uint8_t *) &rxDataPollCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxBeaconCount(chip::EndpointId endpoint, uint32_t * rxBeaconCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBeaconCount, (uint8_t *) rxBeaconCount, + sizeof(*rxBeaconCount)); +} +EmberAfStatus SetRxBeaconCount(chip::EndpointId endpoint, uint32_t rxBeaconCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBeaconCount, (uint8_t *) &rxBeaconCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxBeaconRequestCount(chip::EndpointId endpoint, uint32_t * rxBeaconRequestCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBeaconRequestCount, + (uint8_t *) rxBeaconRequestCount, sizeof(*rxBeaconRequestCount)); +} +EmberAfStatus SetRxBeaconRequestCount(chip::EndpointId endpoint, uint32_t rxBeaconRequestCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxBeaconRequestCount, + (uint8_t *) &rxBeaconRequestCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxOtherCount(chip::EndpointId endpoint, uint32_t * rxOtherCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxOtherCount, (uint8_t *) rxOtherCount, + sizeof(*rxOtherCount)); +} +EmberAfStatus SetRxOtherCount(chip::EndpointId endpoint, uint32_t rxOtherCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxOtherCount, (uint8_t *) &rxOtherCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxAddressFilteredCount(chip::EndpointId endpoint, uint32_t * rxAddressFilteredCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxAddressFilteredCount, + (uint8_t *) rxAddressFilteredCount, sizeof(*rxAddressFilteredCount)); +} +EmberAfStatus SetRxAddressFilteredCount(chip::EndpointId endpoint, uint32_t rxAddressFilteredCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxAddressFilteredCount, + (uint8_t *) &rxAddressFilteredCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxDestAddrFilteredCount(chip::EndpointId endpoint, uint32_t * rxDestAddrFilteredCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDestAddrFilteredCount, + (uint8_t *) rxDestAddrFilteredCount, sizeof(*rxDestAddrFilteredCount)); +} +EmberAfStatus SetRxDestAddrFilteredCount(chip::EndpointId endpoint, uint32_t rxDestAddrFilteredCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDestAddrFilteredCount, + (uint8_t *) &rxDestAddrFilteredCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxDuplicatedCount(chip::EndpointId endpoint, uint32_t * rxDuplicatedCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDuplicatedCount, (uint8_t *) rxDuplicatedCount, + sizeof(*rxDuplicatedCount)); +} +EmberAfStatus SetRxDuplicatedCount(chip::EndpointId endpoint, uint32_t rxDuplicatedCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxDuplicatedCount, + (uint8_t *) &rxDuplicatedCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrNoFrameCount(chip::EndpointId endpoint, uint32_t * rxErrNoFrameCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrNoFrameCount, (uint8_t *) rxErrNoFrameCount, + sizeof(*rxErrNoFrameCount)); +} +EmberAfStatus SetRxErrNoFrameCount(chip::EndpointId endpoint, uint32_t rxErrNoFrameCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrNoFrameCount, + (uint8_t *) &rxErrNoFrameCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrUnknownNeighborCount(chip::EndpointId endpoint, uint32_t * rxErrUnknownNeighborCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrUnknownNeighborCount, + (uint8_t *) rxErrUnknownNeighborCount, sizeof(*rxErrUnknownNeighborCount)); +} +EmberAfStatus SetRxErrUnknownNeighborCount(chip::EndpointId endpoint, uint32_t rxErrUnknownNeighborCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrUnknownNeighborCount, + (uint8_t *) &rxErrUnknownNeighborCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrInvalidSrcAddrCount(chip::EndpointId endpoint, uint32_t * rxErrInvalidSrcAddrCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrInvalidSrcAddrCount, + (uint8_t *) rxErrInvalidSrcAddrCount, sizeof(*rxErrInvalidSrcAddrCount)); +} +EmberAfStatus SetRxErrInvalidSrcAddrCount(chip::EndpointId endpoint, uint32_t rxErrInvalidSrcAddrCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrInvalidSrcAddrCount, + (uint8_t *) &rxErrInvalidSrcAddrCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrSecCount(chip::EndpointId endpoint, uint32_t * rxErrSecCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrSecCount, (uint8_t *) rxErrSecCount, + sizeof(*rxErrSecCount)); +} +EmberAfStatus SetRxErrSecCount(chip::EndpointId endpoint, uint32_t rxErrSecCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrSecCount, (uint8_t *) &rxErrSecCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrFcsCount(chip::EndpointId endpoint, uint32_t * rxErrFcsCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrFcsCount, (uint8_t *) rxErrFcsCount, + sizeof(*rxErrFcsCount)); +} +EmberAfStatus SetRxErrFcsCount(chip::EndpointId endpoint, uint32_t rxErrFcsCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrFcsCount, (uint8_t *) &rxErrFcsCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRxErrOtherCount(chip::EndpointId endpoint, uint32_t * rxErrOtherCount) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrOtherCount, (uint8_t *) rxErrOtherCount, + sizeof(*rxErrOtherCount)); +} +EmberAfStatus SetRxErrOtherCount(chip::EndpointId endpoint, uint32_t rxErrOtherCount) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::RxErrOtherCount, (uint8_t *) &rxErrOtherCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActiveTimestamp(chip::EndpointId endpoint, uint64_t * activeTimestamp) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ActiveTimestamp, (uint8_t *) activeTimestamp, + sizeof(*activeTimestamp)); +} +EmberAfStatus SetActiveTimestamp(chip::EndpointId endpoint, uint64_t activeTimestamp) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ActiveTimestamp, (uint8_t *) &activeTimestamp, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPendingTimestamp(chip::EndpointId endpoint, uint64_t * pendingTimestamp) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PendingTimestamp, (uint8_t *) pendingTimestamp, + sizeof(*pendingTimestamp)); +} +EmberAfStatus SetPendingTimestamp(chip::EndpointId endpoint, uint64_t pendingTimestamp) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::PendingTimestamp, (uint8_t *) &pendingTimestamp, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDelay(chip::EndpointId endpoint, uint32_t * delay) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Delay, (uint8_t *) delay, sizeof(*delay)); +} +EmberAfStatus SetDelay(chip::EndpointId endpoint, uint32_t delay) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::Delay, (uint8_t *) &delay, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetChannelMask(chip::EndpointId endpoint, uint8_t * channelMask) +{ + return emberAfReadServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ChannelMask, (uint8_t *) channelMask, + sizeof(*channelMask)); +} +EmberAfStatus SetChannelMask(chip::EndpointId endpoint, uint8_t channelMask) +{ + return emberAfWriteServerAttribute(endpoint, ThreadNetworkDiagnostics::Id, Ids::ChannelMask, (uint8_t *) &channelMask, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ThreadNetworkDiagnostics + +namespace WiFiNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetSecurityType(chip::EndpointId endpoint, uint8_t * securityType) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::SecurityType, (uint8_t *) securityType, + sizeof(*securityType)); +} +EmberAfStatus SetSecurityType(chip::EndpointId endpoint, uint8_t securityType) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::SecurityType, (uint8_t *) &securityType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetWiFiVersion(chip::EndpointId endpoint, uint8_t * wiFiVersion) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::WiFiVersion, (uint8_t *) wiFiVersion, + sizeof(*wiFiVersion)); +} +EmberAfStatus SetWiFiVersion(chip::EndpointId endpoint, uint8_t wiFiVersion) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::WiFiVersion, (uint8_t *) &wiFiVersion, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetChannelNumber(chip::EndpointId endpoint, uint16_t * channelNumber) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::ChannelNumber, (uint8_t *) channelNumber, + sizeof(*channelNumber)); +} +EmberAfStatus SetChannelNumber(chip::EndpointId endpoint, uint16_t channelNumber) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::ChannelNumber, (uint8_t *) &channelNumber, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRssi(chip::EndpointId endpoint, int8_t * rssi) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::Rssi, (uint8_t *) rssi, sizeof(*rssi)); +} +EmberAfStatus SetRssi(chip::EndpointId endpoint, int8_t rssi) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::Rssi, (uint8_t *) &rssi, + ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBeaconLostCount(chip::EndpointId endpoint, uint32_t * beaconLostCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::BeaconLostCount, (uint8_t *) beaconLostCount, + sizeof(*beaconLostCount)); +} +EmberAfStatus SetBeaconLostCount(chip::EndpointId endpoint, uint32_t beaconLostCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::BeaconLostCount, (uint8_t *) &beaconLostCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBeaconRxCount(chip::EndpointId endpoint, uint32_t * beaconRxCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::BeaconRxCount, (uint8_t *) beaconRxCount, + sizeof(*beaconRxCount)); +} +EmberAfStatus SetBeaconRxCount(chip::EndpointId endpoint, uint32_t beaconRxCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::BeaconRxCount, (uint8_t *) &beaconRxCount, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketMulticastRxCount(chip::EndpointId endpoint, uint32_t * packetMulticastRxCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketMulticastRxCount, + (uint8_t *) packetMulticastRxCount, sizeof(*packetMulticastRxCount)); +} +EmberAfStatus SetPacketMulticastRxCount(chip::EndpointId endpoint, uint32_t packetMulticastRxCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketMulticastRxCount, + (uint8_t *) &packetMulticastRxCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketMulticastTxCount(chip::EndpointId endpoint, uint32_t * packetMulticastTxCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketMulticastTxCount, + (uint8_t *) packetMulticastTxCount, sizeof(*packetMulticastTxCount)); +} +EmberAfStatus SetPacketMulticastTxCount(chip::EndpointId endpoint, uint32_t packetMulticastTxCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketMulticastTxCount, + (uint8_t *) &packetMulticastTxCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketUnicastRxCount(chip::EndpointId endpoint, uint32_t * packetUnicastRxCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketUnicastRxCount, + (uint8_t *) packetUnicastRxCount, sizeof(*packetUnicastRxCount)); +} +EmberAfStatus SetPacketUnicastRxCount(chip::EndpointId endpoint, uint32_t packetUnicastRxCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketUnicastRxCount, + (uint8_t *) &packetUnicastRxCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketUnicastTxCount(chip::EndpointId endpoint, uint32_t * packetUnicastTxCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketUnicastTxCount, + (uint8_t *) packetUnicastTxCount, sizeof(*packetUnicastTxCount)); +} +EmberAfStatus SetPacketUnicastTxCount(chip::EndpointId endpoint, uint32_t packetUnicastTxCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::PacketUnicastTxCount, + (uint8_t *) &packetUnicastTxCount, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentMaxRate(chip::EndpointId endpoint, uint64_t * currentMaxRate) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::CurrentMaxRate, (uint8_t *) currentMaxRate, + sizeof(*currentMaxRate)); +} +EmberAfStatus SetCurrentMaxRate(chip::EndpointId endpoint, uint64_t currentMaxRate) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::CurrentMaxRate, (uint8_t *) ¤tMaxRate, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount) +{ + return emberAfReadServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) overrunCount, + sizeof(*overrunCount)); +} +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount) +{ + return emberAfWriteServerAttribute(endpoint, WiFiNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) &overrunCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace WiFiNetworkDiagnostics + +namespace EthernetNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetPHYRate(chip::EndpointId endpoint, uint8_t * pHYRate) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PHYRate, (uint8_t *) pHYRate, + sizeof(*pHYRate)); +} +EmberAfStatus SetPHYRate(chip::EndpointId endpoint, uint8_t pHYRate) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PHYRate, (uint8_t *) &pHYRate, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetFullDuplex(chip::EndpointId endpoint, uint8_t * fullDuplex) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::FullDuplex, (uint8_t *) fullDuplex, + sizeof(*fullDuplex)); +} +EmberAfStatus SetFullDuplex(chip::EndpointId endpoint, uint8_t fullDuplex) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::FullDuplex, (uint8_t *) &fullDuplex, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketRxCount(chip::EndpointId endpoint, uint64_t * packetRxCount) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PacketRxCount, (uint8_t *) packetRxCount, + sizeof(*packetRxCount)); +} +EmberAfStatus SetPacketRxCount(chip::EndpointId endpoint, uint64_t packetRxCount) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PacketRxCount, (uint8_t *) &packetRxCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPacketTxCount(chip::EndpointId endpoint, uint64_t * packetTxCount) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PacketTxCount, (uint8_t *) packetTxCount, + sizeof(*packetTxCount)); +} +EmberAfStatus SetPacketTxCount(chip::EndpointId endpoint, uint64_t packetTxCount) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::PacketTxCount, (uint8_t *) &packetTxCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTxErrCount(chip::EndpointId endpoint, uint64_t * txErrCount) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::TxErrCount, (uint8_t *) txErrCount, + sizeof(*txErrCount)); +} +EmberAfStatus SetTxErrCount(chip::EndpointId endpoint, uint64_t txErrCount) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::TxErrCount, (uint8_t *) &txErrCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCollisionCount(chip::EndpointId endpoint, uint64_t * collisionCount) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::CollisionCount, (uint8_t *) collisionCount, + sizeof(*collisionCount)); +} +EmberAfStatus SetCollisionCount(chip::EndpointId endpoint, uint64_t collisionCount) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::CollisionCount, (uint8_t *) &collisionCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) overrunCount, + sizeof(*overrunCount)); +} +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::OverrunCount, (uint8_t *) &overrunCount, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCarrierDetect(chip::EndpointId endpoint, uint8_t * carrierDetect) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::CarrierDetect, (uint8_t *) carrierDetect, + sizeof(*carrierDetect)); +} +EmberAfStatus SetCarrierDetect(chip::EndpointId endpoint, uint8_t carrierDetect) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::CarrierDetect, (uint8_t *) &carrierDetect, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTimeSinceReset(chip::EndpointId endpoint, uint64_t * timeSinceReset) +{ + return emberAfReadServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::TimeSinceReset, (uint8_t *) timeSinceReset, + sizeof(*timeSinceReset)); +} +EmberAfStatus SetTimeSinceReset(chip::EndpointId endpoint, uint64_t timeSinceReset) +{ + return emberAfWriteServerAttribute(endpoint, EthernetNetworkDiagnostics::Id, Ids::TimeSinceReset, (uint8_t *) &timeSinceReset, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace EthernetNetworkDiagnostics + +namespace BridgedDeviceBasic { +namespace Attributes { +EmberAfStatus GetVendorID(chip::EndpointId endpoint, uint16_t * vendorID) +{ + return emberAfReadServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::VendorID, (uint8_t *) vendorID, sizeof(*vendorID)); +} +EmberAfStatus SetVendorID(chip::EndpointId endpoint, uint16_t vendorID) +{ + return emberAfWriteServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::VendorID, (uint8_t *) &vendorID, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHardwareVersion(chip::EndpointId endpoint, uint16_t * hardwareVersion) +{ + return emberAfReadServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::HardwareVersion, (uint8_t *) hardwareVersion, + sizeof(*hardwareVersion)); +} +EmberAfStatus SetHardwareVersion(chip::EndpointId endpoint, uint16_t hardwareVersion) +{ + return emberAfWriteServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::HardwareVersion, (uint8_t *) &hardwareVersion, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSoftwareVersion(chip::EndpointId endpoint, uint32_t * softwareVersion) +{ + return emberAfReadServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::SoftwareVersion, (uint8_t *) softwareVersion, + sizeof(*softwareVersion)); +} +EmberAfStatus SetSoftwareVersion(chip::EndpointId endpoint, uint32_t softwareVersion) +{ + return emberAfWriteServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::SoftwareVersion, (uint8_t *) &softwareVersion, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReachable(chip::EndpointId endpoint, uint8_t * reachable) +{ + return emberAfReadServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::Reachable, (uint8_t *) reachable, sizeof(*reachable)); +} +EmberAfStatus SetReachable(chip::EndpointId endpoint, uint8_t reachable) +{ + return emberAfWriteServerAttribute(endpoint, BridgedDeviceBasic::Id, Ids::Reachable, (uint8_t *) &reachable, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BridgedDeviceBasic + +namespace Switch { +namespace Attributes { +EmberAfStatus GetNumberOfPositions(chip::EndpointId endpoint, uint8_t * numberOfPositions) +{ + return emberAfReadServerAttribute(endpoint, Switch::Id, Ids::NumberOfPositions, (uint8_t *) numberOfPositions, + sizeof(*numberOfPositions)); +} +EmberAfStatus SetNumberOfPositions(chip::EndpointId endpoint, uint8_t numberOfPositions) +{ + return emberAfWriteServerAttribute(endpoint, Switch::Id, Ids::NumberOfPositions, (uint8_t *) &numberOfPositions, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPosition(chip::EndpointId endpoint, uint8_t * currentPosition) +{ + return emberAfReadServerAttribute(endpoint, Switch::Id, Ids::CurrentPosition, (uint8_t *) currentPosition, + sizeof(*currentPosition)); +} +EmberAfStatus SetCurrentPosition(chip::EndpointId endpoint, uint8_t currentPosition) +{ + return emberAfWriteServerAttribute(endpoint, Switch::Id, Ids::CurrentPosition, (uint8_t *) ¤tPosition, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMultiPressMax(chip::EndpointId endpoint, uint8_t * multiPressMax) +{ + return emberAfReadServerAttribute(endpoint, Switch::Id, Ids::MultiPressMax, (uint8_t *) multiPressMax, sizeof(*multiPressMax)); +} +EmberAfStatus SetMultiPressMax(chip::EndpointId endpoint, uint8_t multiPressMax) +{ + return emberAfWriteServerAttribute(endpoint, Switch::Id, Ids::MultiPressMax, (uint8_t *) &multiPressMax, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Switch + +namespace OperationalCredentials { +namespace Attributes { +} // namespace Attributes +} // namespace OperationalCredentials + +namespace FixedLabel { +namespace Attributes { +} // namespace Attributes +} // namespace FixedLabel + +namespace ShadeConfiguration { +namespace Attributes { +EmberAfStatus GetPhysicalClosedLimit(chip::EndpointId endpoint, uint16_t * physicalClosedLimit) +{ + return emberAfReadServerAttribute(endpoint, ShadeConfiguration::Id, Ids::PhysicalClosedLimit, (uint8_t *) physicalClosedLimit, + sizeof(*physicalClosedLimit)); +} +EmberAfStatus SetPhysicalClosedLimit(chip::EndpointId endpoint, uint16_t physicalClosedLimit) +{ + return emberAfWriteServerAttribute(endpoint, ShadeConfiguration::Id, Ids::PhysicalClosedLimit, (uint8_t *) &physicalClosedLimit, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMotorStepSize(chip::EndpointId endpoint, uint8_t * motorStepSize) +{ + return emberAfReadServerAttribute(endpoint, ShadeConfiguration::Id, Ids::MotorStepSize, (uint8_t *) motorStepSize, + sizeof(*motorStepSize)); +} +EmberAfStatus SetMotorStepSize(chip::EndpointId endpoint, uint8_t motorStepSize) +{ + return emberAfWriteServerAttribute(endpoint, ShadeConfiguration::Id, Ids::MotorStepSize, (uint8_t *) &motorStepSize, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStatus(chip::EndpointId endpoint, uint8_t * status) +{ + return emberAfReadServerAttribute(endpoint, ShadeConfiguration::Id, Ids::Status, (uint8_t *) status, sizeof(*status)); +} +EmberAfStatus SetStatus(chip::EndpointId endpoint, uint8_t status) +{ + return emberAfWriteServerAttribute(endpoint, ShadeConfiguration::Id, Ids::Status, (uint8_t *) &status, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetClosedLimit(chip::EndpointId endpoint, uint16_t * closedLimit) +{ + return emberAfReadServerAttribute(endpoint, ShadeConfiguration::Id, Ids::ClosedLimit, (uint8_t *) closedLimit, + sizeof(*closedLimit)); +} +EmberAfStatus SetClosedLimit(chip::EndpointId endpoint, uint16_t closedLimit) +{ + return emberAfWriteServerAttribute(endpoint, ShadeConfiguration::Id, Ids::ClosedLimit, (uint8_t *) &closedLimit, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMode(chip::EndpointId endpoint, uint8_t * mode) +{ + return emberAfReadServerAttribute(endpoint, ShadeConfiguration::Id, Ids::Mode, (uint8_t *) mode, sizeof(*mode)); +} +EmberAfStatus SetMode(chip::EndpointId endpoint, uint8_t mode) +{ + return emberAfWriteServerAttribute(endpoint, ShadeConfiguration::Id, Ids::Mode, (uint8_t *) &mode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ShadeConfiguration + +namespace DoorLock { +namespace Attributes { +EmberAfStatus GetLockState(chip::EndpointId endpoint, uint8_t * lockState) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::LockState, (uint8_t *) lockState, sizeof(*lockState)); +} +EmberAfStatus SetLockState(chip::EndpointId endpoint, uint8_t lockState) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::LockState, (uint8_t *) &lockState, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLockType(chip::EndpointId endpoint, uint8_t * lockType) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::LockType, (uint8_t *) lockType, sizeof(*lockType)); +} +EmberAfStatus SetLockType(chip::EndpointId endpoint, uint8_t lockType) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::LockType, (uint8_t *) &lockType, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActuatorEnabled(chip::EndpointId endpoint, uint8_t * actuatorEnabled) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::ActuatorEnabled, (uint8_t *) actuatorEnabled, + sizeof(*actuatorEnabled)); +} +EmberAfStatus SetActuatorEnabled(chip::EndpointId endpoint, uint8_t actuatorEnabled) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::ActuatorEnabled, (uint8_t *) &actuatorEnabled, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDoorState(chip::EndpointId endpoint, uint8_t * doorState) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::DoorState, (uint8_t *) doorState, sizeof(*doorState)); +} +EmberAfStatus SetDoorState(chip::EndpointId endpoint, uint8_t doorState) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::DoorState, (uint8_t *) &doorState, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDoorOpenEvents(chip::EndpointId endpoint, uint32_t * doorOpenEvents) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::DoorOpenEvents, (uint8_t *) doorOpenEvents, + sizeof(*doorOpenEvents)); +} +EmberAfStatus SetDoorOpenEvents(chip::EndpointId endpoint, uint32_t doorOpenEvents) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::DoorOpenEvents, (uint8_t *) &doorOpenEvents, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDoorClosedEvents(chip::EndpointId endpoint, uint32_t * doorClosedEvents) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::DoorClosedEvents, (uint8_t *) doorClosedEvents, + sizeof(*doorClosedEvents)); +} +EmberAfStatus SetDoorClosedEvents(chip::EndpointId endpoint, uint32_t doorClosedEvents) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::DoorClosedEvents, (uint8_t *) &doorClosedEvents, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOpenPeriod(chip::EndpointId endpoint, uint16_t * openPeriod) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::OpenPeriod, (uint8_t *) openPeriod, sizeof(*openPeriod)); +} +EmberAfStatus SetOpenPeriod(chip::EndpointId endpoint, uint16_t openPeriod) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::OpenPeriod, (uint8_t *) &openPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumLockRecordsSupported(chip::EndpointId endpoint, uint16_t * numLockRecordsSupported) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumLockRecordsSupported, (uint8_t *) numLockRecordsSupported, + sizeof(*numLockRecordsSupported)); +} +EmberAfStatus SetNumLockRecordsSupported(chip::EndpointId endpoint, uint16_t numLockRecordsSupported) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumLockRecordsSupported, (uint8_t *) &numLockRecordsSupported, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumTotalUsersSupported(chip::EndpointId endpoint, uint16_t * numTotalUsersSupported) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumTotalUsersSupported, (uint8_t *) numTotalUsersSupported, + sizeof(*numTotalUsersSupported)); +} +EmberAfStatus SetNumTotalUsersSupported(chip::EndpointId endpoint, uint16_t numTotalUsersSupported) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumTotalUsersSupported, (uint8_t *) &numTotalUsersSupported, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumPinUsersSupported(chip::EndpointId endpoint, uint16_t * numPinUsersSupported) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumPinUsersSupported, (uint8_t *) numPinUsersSupported, + sizeof(*numPinUsersSupported)); +} +EmberAfStatus SetNumPinUsersSupported(chip::EndpointId endpoint, uint16_t numPinUsersSupported) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumPinUsersSupported, (uint8_t *) &numPinUsersSupported, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumRfidUsersSupported(chip::EndpointId endpoint, uint16_t * numRfidUsersSupported) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumRfidUsersSupported, (uint8_t *) numRfidUsersSupported, + sizeof(*numRfidUsersSupported)); +} +EmberAfStatus SetNumRfidUsersSupported(chip::EndpointId endpoint, uint16_t numRfidUsersSupported) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumRfidUsersSupported, (uint8_t *) &numRfidUsersSupported, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumWeekdaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t * numWeekdaySchedulesSupportedPerUser) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumWeekdaySchedulesSupportedPerUser, + (uint8_t *) numWeekdaySchedulesSupportedPerUser, + sizeof(*numWeekdaySchedulesSupportedPerUser)); +} +EmberAfStatus SetNumWeekdaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numWeekdaySchedulesSupportedPerUser) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumWeekdaySchedulesSupportedPerUser, + (uint8_t *) &numWeekdaySchedulesSupportedPerUser, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumYeardaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t * numYeardaySchedulesSupportedPerUser) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumYeardaySchedulesSupportedPerUser, + (uint8_t *) numYeardaySchedulesSupportedPerUser, + sizeof(*numYeardaySchedulesSupportedPerUser)); +} +EmberAfStatus SetNumYeardaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numYeardaySchedulesSupportedPerUser) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumYeardaySchedulesSupportedPerUser, + (uint8_t *) &numYeardaySchedulesSupportedPerUser, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumHolidaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t * numHolidaySchedulesSupportedPerUser) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::NumHolidaySchedulesSupportedPerUser, + (uint8_t *) numHolidaySchedulesSupportedPerUser, + sizeof(*numHolidaySchedulesSupportedPerUser)); +} +EmberAfStatus SetNumHolidaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numHolidaySchedulesSupportedPerUser) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::NumHolidaySchedulesSupportedPerUser, + (uint8_t *) &numHolidaySchedulesSupportedPerUser, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxPinLength(chip::EndpointId endpoint, uint8_t * maxPinLength) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::MaxPinLength, (uint8_t *) maxPinLength, sizeof(*maxPinLength)); +} +EmberAfStatus SetMaxPinLength(chip::EndpointId endpoint, uint8_t maxPinLength) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::MaxPinLength, (uint8_t *) &maxPinLength, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinPinLength(chip::EndpointId endpoint, uint8_t * minPinLength) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::MinPinLength, (uint8_t *) minPinLength, sizeof(*minPinLength)); +} +EmberAfStatus SetMinPinLength(chip::EndpointId endpoint, uint8_t minPinLength) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::MinPinLength, (uint8_t *) &minPinLength, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxRfidCodeLength(chip::EndpointId endpoint, uint8_t * maxRfidCodeLength) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::MaxRfidCodeLength, (uint8_t *) maxRfidCodeLength, + sizeof(*maxRfidCodeLength)); +} +EmberAfStatus SetMaxRfidCodeLength(chip::EndpointId endpoint, uint8_t maxRfidCodeLength) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::MaxRfidCodeLength, (uint8_t *) &maxRfidCodeLength, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinRfidCodeLength(chip::EndpointId endpoint, uint8_t * minRfidCodeLength) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::MinRfidCodeLength, (uint8_t *) minRfidCodeLength, + sizeof(*minRfidCodeLength)); +} +EmberAfStatus SetMinRfidCodeLength(chip::EndpointId endpoint, uint8_t minRfidCodeLength) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::MinRfidCodeLength, (uint8_t *) &minRfidCodeLength, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnableLogging(chip::EndpointId endpoint, uint8_t * enableLogging) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::EnableLogging, (uint8_t *) enableLogging, + sizeof(*enableLogging)); +} +EmberAfStatus SetEnableLogging(chip::EndpointId endpoint, uint8_t enableLogging) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::EnableLogging, (uint8_t *) &enableLogging, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLedSettings(chip::EndpointId endpoint, uint8_t * ledSettings) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::LedSettings, (uint8_t *) ledSettings, sizeof(*ledSettings)); +} +EmberAfStatus SetLedSettings(chip::EndpointId endpoint, uint8_t ledSettings) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::LedSettings, (uint8_t *) &ledSettings, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAutoRelockTime(chip::EndpointId endpoint, uint32_t * autoRelockTime) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::AutoRelockTime, (uint8_t *) autoRelockTime, + sizeof(*autoRelockTime)); +} +EmberAfStatus SetAutoRelockTime(chip::EndpointId endpoint, uint32_t autoRelockTime) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::AutoRelockTime, (uint8_t *) &autoRelockTime, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSoundVolume(chip::EndpointId endpoint, uint8_t * soundVolume) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::SoundVolume, (uint8_t *) soundVolume, sizeof(*soundVolume)); +} +EmberAfStatus SetSoundVolume(chip::EndpointId endpoint, uint8_t soundVolume) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::SoundVolume, (uint8_t *) &soundVolume, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOperatingMode(chip::EndpointId endpoint, uint8_t * operatingMode) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::OperatingMode, (uint8_t *) operatingMode, + sizeof(*operatingMode)); +} +EmberAfStatus SetOperatingMode(chip::EndpointId endpoint, uint8_t operatingMode) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::OperatingMode, (uint8_t *) &operatingMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSupportedOperatingModes(chip::EndpointId endpoint, uint16_t * supportedOperatingModes) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::SupportedOperatingModes, (uint8_t *) supportedOperatingModes, + sizeof(*supportedOperatingModes)); +} +EmberAfStatus SetSupportedOperatingModes(chip::EndpointId endpoint, uint16_t supportedOperatingModes) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::SupportedOperatingModes, (uint8_t *) &supportedOperatingModes, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDefaultConfigurationRegister(chip::EndpointId endpoint, uint16_t * defaultConfigurationRegister) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::DefaultConfigurationRegister, + (uint8_t *) defaultConfigurationRegister, sizeof(*defaultConfigurationRegister)); +} +EmberAfStatus SetDefaultConfigurationRegister(chip::EndpointId endpoint, uint16_t defaultConfigurationRegister) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::DefaultConfigurationRegister, + (uint8_t *) &defaultConfigurationRegister, ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnableLocalProgramming(chip::EndpointId endpoint, uint8_t * enableLocalProgramming) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::EnableLocalProgramming, (uint8_t *) enableLocalProgramming, + sizeof(*enableLocalProgramming)); +} +EmberAfStatus SetEnableLocalProgramming(chip::EndpointId endpoint, uint8_t enableLocalProgramming) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::EnableLocalProgramming, (uint8_t *) &enableLocalProgramming, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnableOneTouchLocking(chip::EndpointId endpoint, uint8_t * enableOneTouchLocking) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::EnableOneTouchLocking, (uint8_t *) enableOneTouchLocking, + sizeof(*enableOneTouchLocking)); +} +EmberAfStatus SetEnableOneTouchLocking(chip::EndpointId endpoint, uint8_t enableOneTouchLocking) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::EnableOneTouchLocking, (uint8_t *) &enableOneTouchLocking, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnableInsideStatusLed(chip::EndpointId endpoint, uint8_t * enableInsideStatusLed) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::EnableInsideStatusLed, (uint8_t *) enableInsideStatusLed, + sizeof(*enableInsideStatusLed)); +} +EmberAfStatus SetEnableInsideStatusLed(chip::EndpointId endpoint, uint8_t enableInsideStatusLed) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::EnableInsideStatusLed, (uint8_t *) &enableInsideStatusLed, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnablePrivacyModeButton(chip::EndpointId endpoint, uint8_t * enablePrivacyModeButton) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::EnablePrivacyModeButton, (uint8_t *) enablePrivacyModeButton, + sizeof(*enablePrivacyModeButton)); +} +EmberAfStatus SetEnablePrivacyModeButton(chip::EndpointId endpoint, uint8_t enablePrivacyModeButton) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::EnablePrivacyModeButton, (uint8_t *) &enablePrivacyModeButton, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetWrongCodeEntryLimit(chip::EndpointId endpoint, uint8_t * wrongCodeEntryLimit) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::WrongCodeEntryLimit, (uint8_t *) wrongCodeEntryLimit, + sizeof(*wrongCodeEntryLimit)); +} +EmberAfStatus SetWrongCodeEntryLimit(chip::EndpointId endpoint, uint8_t wrongCodeEntryLimit) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::WrongCodeEntryLimit, (uint8_t *) &wrongCodeEntryLimit, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUserCodeTemporaryDisableTime(chip::EndpointId endpoint, uint8_t * userCodeTemporaryDisableTime) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::UserCodeTemporaryDisableTime, + (uint8_t *) userCodeTemporaryDisableTime, sizeof(*userCodeTemporaryDisableTime)); +} +EmberAfStatus SetUserCodeTemporaryDisableTime(chip::EndpointId endpoint, uint8_t userCodeTemporaryDisableTime) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::UserCodeTemporaryDisableTime, + (uint8_t *) &userCodeTemporaryDisableTime, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSendPinOverTheAir(chip::EndpointId endpoint, uint8_t * sendPinOverTheAir) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::SendPinOverTheAir, (uint8_t *) sendPinOverTheAir, + sizeof(*sendPinOverTheAir)); +} +EmberAfStatus SetSendPinOverTheAir(chip::EndpointId endpoint, uint8_t sendPinOverTheAir) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::SendPinOverTheAir, (uint8_t *) &sendPinOverTheAir, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRequirePinForRfOperation(chip::EndpointId endpoint, uint8_t * requirePinForRfOperation) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::RequirePinForRfOperation, (uint8_t *) requirePinForRfOperation, + sizeof(*requirePinForRfOperation)); +} +EmberAfStatus SetRequirePinForRfOperation(chip::EndpointId endpoint, uint8_t requirePinForRfOperation) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::RequirePinForRfOperation, (uint8_t *) &requirePinForRfOperation, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetZigbeeSecurityLevel(chip::EndpointId endpoint, uint8_t * zigbeeSecurityLevel) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::ZigbeeSecurityLevel, (uint8_t *) zigbeeSecurityLevel, + sizeof(*zigbeeSecurityLevel)); +} +EmberAfStatus SetZigbeeSecurityLevel(chip::EndpointId endpoint, uint8_t zigbeeSecurityLevel) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::ZigbeeSecurityLevel, (uint8_t *) &zigbeeSecurityLevel, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint16_t * alarmMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::AlarmMask, (uint8_t *) alarmMask, sizeof(*alarmMask)); +} +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint16_t alarmMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::AlarmMask, (uint8_t *) &alarmMask, ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetKeypadOperationEventMask(chip::EndpointId endpoint, uint16_t * keypadOperationEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::KeypadOperationEventMask, (uint8_t *) keypadOperationEventMask, + sizeof(*keypadOperationEventMask)); +} +EmberAfStatus SetKeypadOperationEventMask(chip::EndpointId endpoint, uint16_t keypadOperationEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::KeypadOperationEventMask, (uint8_t *) &keypadOperationEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRfOperationEventMask(chip::EndpointId endpoint, uint16_t * rfOperationEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::RfOperationEventMask, (uint8_t *) rfOperationEventMask, + sizeof(*rfOperationEventMask)); +} +EmberAfStatus SetRfOperationEventMask(chip::EndpointId endpoint, uint16_t rfOperationEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::RfOperationEventMask, (uint8_t *) &rfOperationEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetManualOperationEventMask(chip::EndpointId endpoint, uint16_t * manualOperationEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::ManualOperationEventMask, (uint8_t *) manualOperationEventMask, + sizeof(*manualOperationEventMask)); +} +EmberAfStatus SetManualOperationEventMask(chip::EndpointId endpoint, uint16_t manualOperationEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::ManualOperationEventMask, (uint8_t *) &manualOperationEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRfidOperationEventMask(chip::EndpointId endpoint, uint16_t * rfidOperationEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::RfidOperationEventMask, (uint8_t *) rfidOperationEventMask, + sizeof(*rfidOperationEventMask)); +} +EmberAfStatus SetRfidOperationEventMask(chip::EndpointId endpoint, uint16_t rfidOperationEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::RfidOperationEventMask, (uint8_t *) &rfidOperationEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetKeypadProgrammingEventMask(chip::EndpointId endpoint, uint16_t * keypadProgrammingEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::KeypadProgrammingEventMask, + (uint8_t *) keypadProgrammingEventMask, sizeof(*keypadProgrammingEventMask)); +} +EmberAfStatus SetKeypadProgrammingEventMask(chip::EndpointId endpoint, uint16_t keypadProgrammingEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::KeypadProgrammingEventMask, + (uint8_t *) &keypadProgrammingEventMask, ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRfProgrammingEventMask(chip::EndpointId endpoint, uint16_t * rfProgrammingEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::RfProgrammingEventMask, (uint8_t *) rfProgrammingEventMask, + sizeof(*rfProgrammingEventMask)); +} +EmberAfStatus SetRfProgrammingEventMask(chip::EndpointId endpoint, uint16_t rfProgrammingEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::RfProgrammingEventMask, (uint8_t *) &rfProgrammingEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRfidProgrammingEventMask(chip::EndpointId endpoint, uint16_t * rfidProgrammingEventMask) +{ + return emberAfReadServerAttribute(endpoint, DoorLock::Id, Ids::RfidProgrammingEventMask, (uint8_t *) rfidProgrammingEventMask, + sizeof(*rfidProgrammingEventMask)); +} +EmberAfStatus SetRfidProgrammingEventMask(chip::EndpointId endpoint, uint16_t rfidProgrammingEventMask) +{ + return emberAfWriteServerAttribute(endpoint, DoorLock::Id, Ids::RfidProgrammingEventMask, (uint8_t *) &rfidProgrammingEventMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace DoorLock + +namespace WindowCovering { +namespace Attributes { +EmberAfStatus GetType(chip::EndpointId endpoint, uint8_t * type) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::Type, (uint8_t *) type, sizeof(*type)); +} +EmberAfStatus SetType(chip::EndpointId endpoint, uint8_t type) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::Type, (uint8_t *) &type, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalClosedLimitLift(chip::EndpointId endpoint, uint16_t * physicalClosedLimitLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::PhysicalClosedLimitLift, + (uint8_t *) physicalClosedLimitLift, sizeof(*physicalClosedLimitLift)); +} +EmberAfStatus SetPhysicalClosedLimitLift(chip::EndpointId endpoint, uint16_t physicalClosedLimitLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::PhysicalClosedLimitLift, + (uint8_t *) &physicalClosedLimitLift, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalClosedLimitTilt(chip::EndpointId endpoint, uint16_t * physicalClosedLimitTilt) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::PhysicalClosedLimitTilt, + (uint8_t *) physicalClosedLimitTilt, sizeof(*physicalClosedLimitTilt)); +} +EmberAfStatus SetPhysicalClosedLimitTilt(chip::EndpointId endpoint, uint16_t physicalClosedLimitTilt) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::PhysicalClosedLimitTilt, + (uint8_t *) &physicalClosedLimitTilt, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionLift(chip::EndpointId endpoint, uint16_t * currentPositionLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLift, (uint8_t *) currentPositionLift, + sizeof(*currentPositionLift)); +} +EmberAfStatus SetCurrentPositionLift(chip::EndpointId endpoint, uint16_t currentPositionLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLift, (uint8_t *) ¤tPositionLift, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionTilt(chip::EndpointId endpoint, uint16_t * currentPositionTilt) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTilt, (uint8_t *) currentPositionTilt, + sizeof(*currentPositionTilt)); +} +EmberAfStatus SetCurrentPositionTilt(chip::EndpointId endpoint, uint16_t currentPositionTilt) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTilt, (uint8_t *) ¤tPositionTilt, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfActuationsLift(chip::EndpointId endpoint, uint16_t * numberOfActuationsLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::NumberOfActuationsLift, (uint8_t *) numberOfActuationsLift, + sizeof(*numberOfActuationsLift)); +} +EmberAfStatus SetNumberOfActuationsLift(chip::EndpointId endpoint, uint16_t numberOfActuationsLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::NumberOfActuationsLift, + (uint8_t *) &numberOfActuationsLift, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfActuationsTilt(chip::EndpointId endpoint, uint16_t * numberOfActuationsTilt) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::NumberOfActuationsTilt, (uint8_t *) numberOfActuationsTilt, + sizeof(*numberOfActuationsTilt)); +} +EmberAfStatus SetNumberOfActuationsTilt(chip::EndpointId endpoint, uint16_t numberOfActuationsTilt) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::NumberOfActuationsTilt, + (uint8_t *) &numberOfActuationsTilt, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetConfigStatus(chip::EndpointId endpoint, uint8_t * configStatus) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::ConfigStatus, (uint8_t *) configStatus, + sizeof(*configStatus)); +} +EmberAfStatus SetConfigStatus(chip::EndpointId endpoint, uint8_t configStatus) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::ConfigStatus, (uint8_t *) &configStatus, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionLiftPercentage(chip::EndpointId endpoint, uint8_t * currentPositionLiftPercentage) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLiftPercentage, + (uint8_t *) currentPositionLiftPercentage, sizeof(*currentPositionLiftPercentage)); +} +EmberAfStatus SetCurrentPositionLiftPercentage(chip::EndpointId endpoint, uint8_t currentPositionLiftPercentage) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLiftPercentage, + (uint8_t *) ¤tPositionLiftPercentage, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionTiltPercentage(chip::EndpointId endpoint, uint8_t * currentPositionTiltPercentage) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTiltPercentage, + (uint8_t *) currentPositionTiltPercentage, sizeof(*currentPositionTiltPercentage)); +} +EmberAfStatus SetCurrentPositionTiltPercentage(chip::EndpointId endpoint, uint8_t currentPositionTiltPercentage) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTiltPercentage, + (uint8_t *) ¤tPositionTiltPercentage, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOperationalStatus(chip::EndpointId endpoint, uint8_t * operationalStatus) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::OperationalStatus, (uint8_t *) operationalStatus, + sizeof(*operationalStatus)); +} +EmberAfStatus SetOperationalStatus(chip::EndpointId endpoint, uint8_t operationalStatus) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::OperationalStatus, (uint8_t *) &operationalStatus, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTargetPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t * targetPositionLiftPercent100ths) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::TargetPositionLiftPercent100ths, + (uint8_t *) targetPositionLiftPercent100ths, sizeof(*targetPositionLiftPercent100ths)); +} +EmberAfStatus SetTargetPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t targetPositionLiftPercent100ths) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::TargetPositionLiftPercent100ths, + (uint8_t *) &targetPositionLiftPercent100ths, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTargetPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t * targetPositionTiltPercent100ths) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::TargetPositionTiltPercent100ths, + (uint8_t *) targetPositionTiltPercent100ths, sizeof(*targetPositionTiltPercent100ths)); +} +EmberAfStatus SetTargetPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t targetPositionTiltPercent100ths) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::TargetPositionTiltPercent100ths, + (uint8_t *) &targetPositionTiltPercent100ths, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEndProductType(chip::EndpointId endpoint, uint8_t * endProductType) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::EndProductType, (uint8_t *) endProductType, + sizeof(*endProductType)); +} +EmberAfStatus SetEndProductType(chip::EndpointId endpoint, uint8_t endProductType) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::EndProductType, (uint8_t *) &endProductType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t * currentPositionLiftPercent100ths) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLiftPercent100ths, + (uint8_t *) currentPositionLiftPercent100ths, sizeof(*currentPositionLiftPercent100ths)); +} +EmberAfStatus SetCurrentPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t currentPositionLiftPercent100ths) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionLiftPercent100ths, + (uint8_t *) ¤tPositionLiftPercent100ths, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t * currentPositionTiltPercent100ths) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTiltPercent100ths, + (uint8_t *) currentPositionTiltPercent100ths, sizeof(*currentPositionTiltPercent100ths)); +} +EmberAfStatus SetCurrentPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t currentPositionTiltPercent100ths) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::CurrentPositionTiltPercent100ths, + (uint8_t *) ¤tPositionTiltPercent100ths, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstalledOpenLimitLift(chip::EndpointId endpoint, uint16_t * installedOpenLimitLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledOpenLimitLift, (uint8_t *) installedOpenLimitLift, + sizeof(*installedOpenLimitLift)); +} +EmberAfStatus SetInstalledOpenLimitLift(chip::EndpointId endpoint, uint16_t installedOpenLimitLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledOpenLimitLift, + (uint8_t *) &installedOpenLimitLift, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstalledClosedLimitLift(chip::EndpointId endpoint, uint16_t * installedClosedLimitLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledClosedLimitLift, + (uint8_t *) installedClosedLimitLift, sizeof(*installedClosedLimitLift)); +} +EmberAfStatus SetInstalledClosedLimitLift(chip::EndpointId endpoint, uint16_t installedClosedLimitLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledClosedLimitLift, + (uint8_t *) &installedClosedLimitLift, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstalledOpenLimitTilt(chip::EndpointId endpoint, uint16_t * installedOpenLimitTilt) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledOpenLimitTilt, (uint8_t *) installedOpenLimitTilt, + sizeof(*installedOpenLimitTilt)); +} +EmberAfStatus SetInstalledOpenLimitTilt(chip::EndpointId endpoint, uint16_t installedOpenLimitTilt) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledOpenLimitTilt, + (uint8_t *) &installedOpenLimitTilt, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstalledClosedLimitTilt(chip::EndpointId endpoint, uint16_t * installedClosedLimitTilt) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledClosedLimitTilt, + (uint8_t *) installedClosedLimitTilt, sizeof(*installedClosedLimitTilt)); +} +EmberAfStatus SetInstalledClosedLimitTilt(chip::EndpointId endpoint, uint16_t installedClosedLimitTilt) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::InstalledClosedLimitTilt, + (uint8_t *) &installedClosedLimitTilt, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetVelocityLift(chip::EndpointId endpoint, uint16_t * velocityLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::VelocityLift, (uint8_t *) velocityLift, + sizeof(*velocityLift)); +} +EmberAfStatus SetVelocityLift(chip::EndpointId endpoint, uint16_t velocityLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::VelocityLift, (uint8_t *) &velocityLift, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAccelerationTimeLift(chip::EndpointId endpoint, uint16_t * accelerationTimeLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::AccelerationTimeLift, (uint8_t *) accelerationTimeLift, + sizeof(*accelerationTimeLift)); +} +EmberAfStatus SetAccelerationTimeLift(chip::EndpointId endpoint, uint16_t accelerationTimeLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::AccelerationTimeLift, (uint8_t *) &accelerationTimeLift, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDecelerationTimeLift(chip::EndpointId endpoint, uint16_t * decelerationTimeLift) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::DecelerationTimeLift, (uint8_t *) decelerationTimeLift, + sizeof(*decelerationTimeLift)); +} +EmberAfStatus SetDecelerationTimeLift(chip::EndpointId endpoint, uint16_t decelerationTimeLift) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::DecelerationTimeLift, (uint8_t *) &decelerationTimeLift, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMode(chip::EndpointId endpoint, uint8_t * mode) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::Mode, (uint8_t *) mode, sizeof(*mode)); +} +EmberAfStatus SetMode(chip::EndpointId endpoint, uint8_t mode) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::Mode, (uint8_t *) &mode, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSafetyStatus(chip::EndpointId endpoint, uint16_t * safetyStatus) +{ + return emberAfReadServerAttribute(endpoint, WindowCovering::Id, Ids::SafetyStatus, (uint8_t *) safetyStatus, + sizeof(*safetyStatus)); +} +EmberAfStatus SetSafetyStatus(chip::EndpointId endpoint, uint16_t safetyStatus) +{ + return emberAfWriteServerAttribute(endpoint, WindowCovering::Id, Ids::SafetyStatus, (uint8_t *) &safetyStatus, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace WindowCovering + +namespace BarrierControl { +namespace Attributes { +EmberAfStatus GetBarrierMovingState(chip::EndpointId endpoint, uint8_t * barrierMovingState) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierMovingState, (uint8_t *) barrierMovingState, + sizeof(*barrierMovingState)); +} +EmberAfStatus SetBarrierMovingState(chip::EndpointId endpoint, uint8_t barrierMovingState) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierMovingState, (uint8_t *) &barrierMovingState, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierSafetyStatus(chip::EndpointId endpoint, uint16_t * barrierSafetyStatus) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierSafetyStatus, (uint8_t *) barrierSafetyStatus, + sizeof(*barrierSafetyStatus)); +} +EmberAfStatus SetBarrierSafetyStatus(chip::EndpointId endpoint, uint16_t barrierSafetyStatus) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierSafetyStatus, (uint8_t *) &barrierSafetyStatus, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierCapabilities(chip::EndpointId endpoint, uint8_t * barrierCapabilities) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCapabilities, (uint8_t *) barrierCapabilities, + sizeof(*barrierCapabilities)); +} +EmberAfStatus SetBarrierCapabilities(chip::EndpointId endpoint, uint8_t barrierCapabilities) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCapabilities, (uint8_t *) &barrierCapabilities, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierOpenEvents(chip::EndpointId endpoint, uint16_t * barrierOpenEvents) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierOpenEvents, (uint8_t *) barrierOpenEvents, + sizeof(*barrierOpenEvents)); +} +EmberAfStatus SetBarrierOpenEvents(chip::EndpointId endpoint, uint16_t barrierOpenEvents) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierOpenEvents, (uint8_t *) &barrierOpenEvents, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierCloseEvents(chip::EndpointId endpoint, uint16_t * barrierCloseEvents) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCloseEvents, (uint8_t *) barrierCloseEvents, + sizeof(*barrierCloseEvents)); +} +EmberAfStatus SetBarrierCloseEvents(chip::EndpointId endpoint, uint16_t barrierCloseEvents) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCloseEvents, (uint8_t *) &barrierCloseEvents, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierCommandOpenEvents(chip::EndpointId endpoint, uint16_t * barrierCommandOpenEvents) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCommandOpenEvents, + (uint8_t *) barrierCommandOpenEvents, sizeof(*barrierCommandOpenEvents)); +} +EmberAfStatus SetBarrierCommandOpenEvents(chip::EndpointId endpoint, uint16_t barrierCommandOpenEvents) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCommandOpenEvents, + (uint8_t *) &barrierCommandOpenEvents, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierCommandCloseEvents(chip::EndpointId endpoint, uint16_t * barrierCommandCloseEvents) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCommandCloseEvents, + (uint8_t *) barrierCommandCloseEvents, sizeof(*barrierCommandCloseEvents)); +} +EmberAfStatus SetBarrierCommandCloseEvents(chip::EndpointId endpoint, uint16_t barrierCommandCloseEvents) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierCommandCloseEvents, + (uint8_t *) &barrierCommandCloseEvents, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierOpenPeriod(chip::EndpointId endpoint, uint16_t * barrierOpenPeriod) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierOpenPeriod, (uint8_t *) barrierOpenPeriod, + sizeof(*barrierOpenPeriod)); +} +EmberAfStatus SetBarrierOpenPeriod(chip::EndpointId endpoint, uint16_t barrierOpenPeriod) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierOpenPeriod, (uint8_t *) &barrierOpenPeriod, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierClosePeriod(chip::EndpointId endpoint, uint16_t * barrierClosePeriod) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierClosePeriod, (uint8_t *) barrierClosePeriod, + sizeof(*barrierClosePeriod)); +} +EmberAfStatus SetBarrierClosePeriod(chip::EndpointId endpoint, uint16_t barrierClosePeriod) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierClosePeriod, (uint8_t *) &barrierClosePeriod, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBarrierPosition(chip::EndpointId endpoint, uint8_t * barrierPosition) +{ + return emberAfReadServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierPosition, (uint8_t *) barrierPosition, + sizeof(*barrierPosition)); +} +EmberAfStatus SetBarrierPosition(chip::EndpointId endpoint, uint8_t barrierPosition) +{ + return emberAfWriteServerAttribute(endpoint, BarrierControl::Id, Ids::BarrierPosition, (uint8_t *) &barrierPosition, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BarrierControl + +namespace PumpConfigurationAndControl { +namespace Attributes { +EmberAfStatus GetMaxPressure(chip::EndpointId endpoint, int16_t * maxPressure) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxPressure, (uint8_t *) maxPressure, + sizeof(*maxPressure)); +} +EmberAfStatus SetMaxPressure(chip::EndpointId endpoint, int16_t maxPressure) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxPressure, (uint8_t *) &maxPressure, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxSpeed(chip::EndpointId endpoint, uint16_t * maxSpeed) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxSpeed, (uint8_t *) maxSpeed, + sizeof(*maxSpeed)); +} +EmberAfStatus SetMaxSpeed(chip::EndpointId endpoint, uint16_t maxSpeed) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxSpeed, (uint8_t *) &maxSpeed, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxFlow(chip::EndpointId endpoint, uint16_t * maxFlow) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxFlow, (uint8_t *) maxFlow, + sizeof(*maxFlow)); +} +EmberAfStatus SetMaxFlow(chip::EndpointId endpoint, uint16_t maxFlow) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxFlow, (uint8_t *) &maxFlow, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinConstPressure(chip::EndpointId endpoint, int16_t * minConstPressure) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstPressure, + (uint8_t *) minConstPressure, sizeof(*minConstPressure)); +} +EmberAfStatus SetMinConstPressure(chip::EndpointId endpoint, int16_t minConstPressure) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstPressure, + (uint8_t *) &minConstPressure, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxConstPressure(chip::EndpointId endpoint, int16_t * maxConstPressure) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstPressure, + (uint8_t *) maxConstPressure, sizeof(*maxConstPressure)); +} +EmberAfStatus SetMaxConstPressure(chip::EndpointId endpoint, int16_t maxConstPressure) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstPressure, + (uint8_t *) &maxConstPressure, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinCompPressure(chip::EndpointId endpoint, int16_t * minCompPressure) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinCompPressure, (uint8_t *) minCompPressure, + sizeof(*minCompPressure)); +} +EmberAfStatus SetMinCompPressure(chip::EndpointId endpoint, int16_t minCompPressure) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinCompPressure, + (uint8_t *) &minCompPressure, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxCompPressure(chip::EndpointId endpoint, int16_t * maxCompPressure) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxCompPressure, (uint8_t *) maxCompPressure, + sizeof(*maxCompPressure)); +} +EmberAfStatus SetMaxCompPressure(chip::EndpointId endpoint, int16_t maxCompPressure) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxCompPressure, + (uint8_t *) &maxCompPressure, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinConstSpeed(chip::EndpointId endpoint, uint16_t * minConstSpeed) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstSpeed, (uint8_t *) minConstSpeed, + sizeof(*minConstSpeed)); +} +EmberAfStatus SetMinConstSpeed(chip::EndpointId endpoint, uint16_t minConstSpeed) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstSpeed, (uint8_t *) &minConstSpeed, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxConstSpeed(chip::EndpointId endpoint, uint16_t * maxConstSpeed) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstSpeed, (uint8_t *) maxConstSpeed, + sizeof(*maxConstSpeed)); +} +EmberAfStatus SetMaxConstSpeed(chip::EndpointId endpoint, uint16_t maxConstSpeed) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstSpeed, (uint8_t *) &maxConstSpeed, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinConstFlow(chip::EndpointId endpoint, uint16_t * minConstFlow) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstFlow, (uint8_t *) minConstFlow, + sizeof(*minConstFlow)); +} +EmberAfStatus SetMinConstFlow(chip::EndpointId endpoint, uint16_t minConstFlow) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstFlow, (uint8_t *) &minConstFlow, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxConstFlow(chip::EndpointId endpoint, uint16_t * maxConstFlow) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstFlow, (uint8_t *) maxConstFlow, + sizeof(*maxConstFlow)); +} +EmberAfStatus SetMaxConstFlow(chip::EndpointId endpoint, uint16_t maxConstFlow) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstFlow, (uint8_t *) &maxConstFlow, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinConstTemp(chip::EndpointId endpoint, int16_t * minConstTemp) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstTemp, (uint8_t *) minConstTemp, + sizeof(*minConstTemp)); +} +EmberAfStatus SetMinConstTemp(chip::EndpointId endpoint, int16_t minConstTemp) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MinConstTemp, (uint8_t *) &minConstTemp, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxConstTemp(chip::EndpointId endpoint, int16_t * maxConstTemp) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstTemp, (uint8_t *) maxConstTemp, + sizeof(*maxConstTemp)); +} +EmberAfStatus SetMaxConstTemp(chip::EndpointId endpoint, int16_t maxConstTemp) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::MaxConstTemp, (uint8_t *) &maxConstTemp, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPumpStatus(chip::EndpointId endpoint, uint16_t * pumpStatus) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::PumpStatus, (uint8_t *) pumpStatus, + sizeof(*pumpStatus)); +} +EmberAfStatus SetPumpStatus(chip::EndpointId endpoint, uint16_t pumpStatus) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::PumpStatus, (uint8_t *) &pumpStatus, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEffectiveOperationMode(chip::EndpointId endpoint, uint8_t * effectiveOperationMode) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::EffectiveOperationMode, + (uint8_t *) effectiveOperationMode, sizeof(*effectiveOperationMode)); +} +EmberAfStatus SetEffectiveOperationMode(chip::EndpointId endpoint, uint8_t effectiveOperationMode) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::EffectiveOperationMode, + (uint8_t *) &effectiveOperationMode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEffectiveControlMode(chip::EndpointId endpoint, uint8_t * effectiveControlMode) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::EffectiveControlMode, + (uint8_t *) effectiveControlMode, sizeof(*effectiveControlMode)); +} +EmberAfStatus SetEffectiveControlMode(chip::EndpointId endpoint, uint8_t effectiveControlMode) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::EffectiveControlMode, + (uint8_t *) &effectiveControlMode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCapacity(chip::EndpointId endpoint, int16_t * capacity) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::Capacity, (uint8_t *) capacity, + sizeof(*capacity)); +} +EmberAfStatus SetCapacity(chip::EndpointId endpoint, int16_t capacity) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::Capacity, (uint8_t *) &capacity, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSpeed(chip::EndpointId endpoint, uint16_t * speed) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::Speed, (uint8_t *) speed, sizeof(*speed)); +} +EmberAfStatus SetSpeed(chip::EndpointId endpoint, uint16_t speed) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::Speed, (uint8_t *) &speed, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLifetimeEnergyConsumed(chip::EndpointId endpoint, uint32_t * lifetimeEnergyConsumed) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::LifetimeEnergyConsumed, + (uint8_t *) lifetimeEnergyConsumed, sizeof(*lifetimeEnergyConsumed)); +} +EmberAfStatus SetLifetimeEnergyConsumed(chip::EndpointId endpoint, uint32_t lifetimeEnergyConsumed) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::LifetimeEnergyConsumed, + (uint8_t *) &lifetimeEnergyConsumed, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOperationMode(chip::EndpointId endpoint, uint8_t * operationMode) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::OperationMode, (uint8_t *) operationMode, + sizeof(*operationMode)); +} +EmberAfStatus SetOperationMode(chip::EndpointId endpoint, uint8_t operationMode) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::OperationMode, (uint8_t *) &operationMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetControlMode(chip::EndpointId endpoint, uint8_t * controlMode) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::ControlMode, (uint8_t *) controlMode, + sizeof(*controlMode)); +} +EmberAfStatus SetControlMode(chip::EndpointId endpoint, uint8_t controlMode) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::ControlMode, (uint8_t *) &controlMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint16_t * alarmMask) +{ + return emberAfReadServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::AlarmMask, (uint8_t *) alarmMask, + sizeof(*alarmMask)); +} +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint16_t alarmMask) +{ + return emberAfWriteServerAttribute(endpoint, PumpConfigurationAndControl::Id, Ids::AlarmMask, (uint8_t *) &alarmMask, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace PumpConfigurationAndControl + +namespace Thermostat { +namespace Attributes { +EmberAfStatus GetLocalTemperature(chip::EndpointId endpoint, int16_t * localTemperature) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::LocalTemperature, (uint8_t *) localTemperature, + sizeof(*localTemperature)); +} +EmberAfStatus SetLocalTemperature(chip::EndpointId endpoint, int16_t localTemperature) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::LocalTemperature, (uint8_t *) &localTemperature, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOutdoorTemperature(chip::EndpointId endpoint, int16_t * outdoorTemperature) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::OutdoorTemperature, (uint8_t *) outdoorTemperature, + sizeof(*outdoorTemperature)); +} +EmberAfStatus SetOutdoorTemperature(chip::EndpointId endpoint, int16_t outdoorTemperature) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::OutdoorTemperature, (uint8_t *) &outdoorTemperature, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOccupancy(chip::EndpointId endpoint, uint8_t * occupancy) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::Occupancy, (uint8_t *) occupancy, sizeof(*occupancy)); +} +EmberAfStatus SetOccupancy(chip::EndpointId endpoint, uint8_t occupancy) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::Occupancy, (uint8_t *) &occupancy, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAbsMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t * absMinHeatSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AbsMinHeatSetpointLimit, (uint8_t *) absMinHeatSetpointLimit, + sizeof(*absMinHeatSetpointLimit)); +} +EmberAfStatus SetAbsMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t absMinHeatSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AbsMinHeatSetpointLimit, (uint8_t *) &absMinHeatSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAbsMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t * absMaxHeatSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AbsMaxHeatSetpointLimit, (uint8_t *) absMaxHeatSetpointLimit, + sizeof(*absMaxHeatSetpointLimit)); +} +EmberAfStatus SetAbsMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t absMaxHeatSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AbsMaxHeatSetpointLimit, (uint8_t *) &absMaxHeatSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAbsMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t * absMinCoolSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AbsMinCoolSetpointLimit, (uint8_t *) absMinCoolSetpointLimit, + sizeof(*absMinCoolSetpointLimit)); +} +EmberAfStatus SetAbsMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t absMinCoolSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AbsMinCoolSetpointLimit, (uint8_t *) &absMinCoolSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAbsMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t * absMaxCoolSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AbsMaxCoolSetpointLimit, (uint8_t *) absMaxCoolSetpointLimit, + sizeof(*absMaxCoolSetpointLimit)); +} +EmberAfStatus SetAbsMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t absMaxCoolSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AbsMaxCoolSetpointLimit, (uint8_t *) &absMaxCoolSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPiCoolingDemand(chip::EndpointId endpoint, uint8_t * piCoolingDemand) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::PiCoolingDemand, (uint8_t *) piCoolingDemand, + sizeof(*piCoolingDemand)); +} +EmberAfStatus SetPiCoolingDemand(chip::EndpointId endpoint, uint8_t piCoolingDemand) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::PiCoolingDemand, (uint8_t *) &piCoolingDemand, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPiHeatingDemand(chip::EndpointId endpoint, uint8_t * piHeatingDemand) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::PiHeatingDemand, (uint8_t *) piHeatingDemand, + sizeof(*piHeatingDemand)); +} +EmberAfStatus SetPiHeatingDemand(chip::EndpointId endpoint, uint8_t piHeatingDemand) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::PiHeatingDemand, (uint8_t *) &piHeatingDemand, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHvacSystemTypeConfiguration(chip::EndpointId endpoint, uint8_t * hvacSystemTypeConfiguration) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::HvacSystemTypeConfiguration, + (uint8_t *) hvacSystemTypeConfiguration, sizeof(*hvacSystemTypeConfiguration)); +} +EmberAfStatus SetHvacSystemTypeConfiguration(chip::EndpointId endpoint, uint8_t hvacSystemTypeConfiguration) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::HvacSystemTypeConfiguration, + (uint8_t *) &hvacSystemTypeConfiguration, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLocalTemperatureCalibration(chip::EndpointId endpoint, int8_t * localTemperatureCalibration) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::LocalTemperatureCalibration, + (uint8_t *) localTemperatureCalibration, sizeof(*localTemperatureCalibration)); +} +EmberAfStatus SetLocalTemperatureCalibration(chip::EndpointId endpoint, int8_t localTemperatureCalibration) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::LocalTemperatureCalibration, + (uint8_t *) &localTemperatureCalibration, ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t * occupiedCoolingSetpoint) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::OccupiedCoolingSetpoint, (uint8_t *) occupiedCoolingSetpoint, + sizeof(*occupiedCoolingSetpoint)); +} +EmberAfStatus SetOccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t occupiedCoolingSetpoint) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::OccupiedCoolingSetpoint, (uint8_t *) &occupiedCoolingSetpoint, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t * occupiedHeatingSetpoint) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::OccupiedHeatingSetpoint, (uint8_t *) occupiedHeatingSetpoint, + sizeof(*occupiedHeatingSetpoint)); +} +EmberAfStatus SetOccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t occupiedHeatingSetpoint) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::OccupiedHeatingSetpoint, (uint8_t *) &occupiedHeatingSetpoint, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUnoccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t * unoccupiedCoolingSetpoint) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::UnoccupiedCoolingSetpoint, + (uint8_t *) unoccupiedCoolingSetpoint, sizeof(*unoccupiedCoolingSetpoint)); +} +EmberAfStatus SetUnoccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t unoccupiedCoolingSetpoint) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::UnoccupiedCoolingSetpoint, + (uint8_t *) &unoccupiedCoolingSetpoint, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUnoccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t * unoccupiedHeatingSetpoint) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::UnoccupiedHeatingSetpoint, + (uint8_t *) unoccupiedHeatingSetpoint, sizeof(*unoccupiedHeatingSetpoint)); +} +EmberAfStatus SetUnoccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t unoccupiedHeatingSetpoint) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::UnoccupiedHeatingSetpoint, + (uint8_t *) &unoccupiedHeatingSetpoint, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t * minHeatSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::MinHeatSetpointLimit, (uint8_t *) minHeatSetpointLimit, + sizeof(*minHeatSetpointLimit)); +} +EmberAfStatus SetMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t minHeatSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::MinHeatSetpointLimit, (uint8_t *) &minHeatSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t * maxHeatSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::MaxHeatSetpointLimit, (uint8_t *) maxHeatSetpointLimit, + sizeof(*maxHeatSetpointLimit)); +} +EmberAfStatus SetMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t maxHeatSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::MaxHeatSetpointLimit, (uint8_t *) &maxHeatSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t * minCoolSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::MinCoolSetpointLimit, (uint8_t *) minCoolSetpointLimit, + sizeof(*minCoolSetpointLimit)); +} +EmberAfStatus SetMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t minCoolSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::MinCoolSetpointLimit, (uint8_t *) &minCoolSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t * maxCoolSetpointLimit) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::MaxCoolSetpointLimit, (uint8_t *) maxCoolSetpointLimit, + sizeof(*maxCoolSetpointLimit)); +} +EmberAfStatus SetMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t maxCoolSetpointLimit) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::MaxCoolSetpointLimit, (uint8_t *) &maxCoolSetpointLimit, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinSetpointDeadBand(chip::EndpointId endpoint, int8_t * minSetpointDeadBand) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::MinSetpointDeadBand, (uint8_t *) minSetpointDeadBand, + sizeof(*minSetpointDeadBand)); +} +EmberAfStatus SetMinSetpointDeadBand(chip::EndpointId endpoint, int8_t minSetpointDeadBand) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::MinSetpointDeadBand, (uint8_t *) &minSetpointDeadBand, + ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRemoteSensing(chip::EndpointId endpoint, uint8_t * remoteSensing) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::RemoteSensing, (uint8_t *) remoteSensing, + sizeof(*remoteSensing)); +} +EmberAfStatus SetRemoteSensing(chip::EndpointId endpoint, uint8_t remoteSensing) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::RemoteSensing, (uint8_t *) &remoteSensing, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetControlSequenceOfOperation(chip::EndpointId endpoint, uint8_t * controlSequenceOfOperation) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::ControlSequenceOfOperation, + (uint8_t *) controlSequenceOfOperation, sizeof(*controlSequenceOfOperation)); +} +EmberAfStatus SetControlSequenceOfOperation(chip::EndpointId endpoint, uint8_t controlSequenceOfOperation) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::ControlSequenceOfOperation, + (uint8_t *) &controlSequenceOfOperation, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSystemMode(chip::EndpointId endpoint, uint8_t * systemMode) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::SystemMode, (uint8_t *) systemMode, sizeof(*systemMode)); +} +EmberAfStatus SetSystemMode(chip::EndpointId endpoint, uint8_t systemMode) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::SystemMode, (uint8_t *) &systemMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint8_t * alarmMask) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AlarmMask, (uint8_t *) alarmMask, sizeof(*alarmMask)); +} +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint8_t alarmMask) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AlarmMask, (uint8_t *) &alarmMask, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetThermostatRunningMode(chip::EndpointId endpoint, uint8_t * thermostatRunningMode) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::ThermostatRunningMode, (uint8_t *) thermostatRunningMode, + sizeof(*thermostatRunningMode)); +} +EmberAfStatus SetThermostatRunningMode(chip::EndpointId endpoint, uint8_t thermostatRunningMode) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::ThermostatRunningMode, (uint8_t *) &thermostatRunningMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStartOfWeek(chip::EndpointId endpoint, uint8_t * startOfWeek) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::StartOfWeek, (uint8_t *) startOfWeek, sizeof(*startOfWeek)); +} +EmberAfStatus SetStartOfWeek(chip::EndpointId endpoint, uint8_t startOfWeek) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::StartOfWeek, (uint8_t *) &startOfWeek, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfWeeklyTransitions(chip::EndpointId endpoint, uint8_t * numberOfWeeklyTransitions) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::NumberOfWeeklyTransitions, + (uint8_t *) numberOfWeeklyTransitions, sizeof(*numberOfWeeklyTransitions)); +} +EmberAfStatus SetNumberOfWeeklyTransitions(chip::EndpointId endpoint, uint8_t numberOfWeeklyTransitions) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::NumberOfWeeklyTransitions, + (uint8_t *) &numberOfWeeklyTransitions, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfDailyTransitions(chip::EndpointId endpoint, uint8_t * numberOfDailyTransitions) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::NumberOfDailyTransitions, (uint8_t *) numberOfDailyTransitions, + sizeof(*numberOfDailyTransitions)); +} +EmberAfStatus SetNumberOfDailyTransitions(chip::EndpointId endpoint, uint8_t numberOfDailyTransitions) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::NumberOfDailyTransitions, + (uint8_t *) &numberOfDailyTransitions, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTemperatureSetpointHold(chip::EndpointId endpoint, uint8_t * temperatureSetpointHold) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::TemperatureSetpointHold, (uint8_t *) temperatureSetpointHold, + sizeof(*temperatureSetpointHold)); +} +EmberAfStatus SetTemperatureSetpointHold(chip::EndpointId endpoint, uint8_t temperatureSetpointHold) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::TemperatureSetpointHold, (uint8_t *) &temperatureSetpointHold, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTemperatureSetpointHoldDuration(chip::EndpointId endpoint, uint16_t * temperatureSetpointHoldDuration) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::TemperatureSetpointHoldDuration, + (uint8_t *) temperatureSetpointHoldDuration, sizeof(*temperatureSetpointHoldDuration)); +} +EmberAfStatus SetTemperatureSetpointHoldDuration(chip::EndpointId endpoint, uint16_t temperatureSetpointHoldDuration) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::TemperatureSetpointHoldDuration, + (uint8_t *) &temperatureSetpointHoldDuration, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetThermostatProgrammingOperationMode(chip::EndpointId endpoint, uint8_t * thermostatProgrammingOperationMode) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::ThermostatProgrammingOperationMode, + (uint8_t *) thermostatProgrammingOperationMode, sizeof(*thermostatProgrammingOperationMode)); +} +EmberAfStatus SetThermostatProgrammingOperationMode(chip::EndpointId endpoint, uint8_t thermostatProgrammingOperationMode) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::ThermostatProgrammingOperationMode, + (uint8_t *) &thermostatProgrammingOperationMode, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHvacRelayState(chip::EndpointId endpoint, uint16_t * hvacRelayState) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::HvacRelayState, (uint8_t *) hvacRelayState, + sizeof(*hvacRelayState)); +} +EmberAfStatus SetHvacRelayState(chip::EndpointId endpoint, uint16_t hvacRelayState) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::HvacRelayState, (uint8_t *) &hvacRelayState, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSetpointChangeSource(chip::EndpointId endpoint, uint8_t * setpointChangeSource) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeSource, (uint8_t *) setpointChangeSource, + sizeof(*setpointChangeSource)); +} +EmberAfStatus SetSetpointChangeSource(chip::EndpointId endpoint, uint8_t setpointChangeSource) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeSource, (uint8_t *) &setpointChangeSource, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSetpointChangeAmount(chip::EndpointId endpoint, int16_t * setpointChangeAmount) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeAmount, (uint8_t *) setpointChangeAmount, + sizeof(*setpointChangeAmount)); +} +EmberAfStatus SetSetpointChangeAmount(chip::EndpointId endpoint, int16_t setpointChangeAmount) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeAmount, (uint8_t *) &setpointChangeAmount, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSetpointChangeSourceTimestamp(chip::EndpointId endpoint, + /* TYPE WARNING: utc defaults to */ uint8_t ** setpointChangeSourceTimestamp) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeSourceTimestamp, + (uint8_t *) setpointChangeSourceTimestamp, sizeof(*setpointChangeSourceTimestamp)); +} +EmberAfStatus SetSetpointChangeSourceTimestamp(chip::EndpointId endpoint, + /* TYPE WARNING: utc defaults to */ uint8_t * setpointChangeSourceTimestamp) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::SetpointChangeSourceTimestamp, + (uint8_t *) &setpointChangeSourceTimestamp, ZCL_UTC_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcType(chip::EndpointId endpoint, uint8_t * acType) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcType, (uint8_t *) acType, sizeof(*acType)); +} +EmberAfStatus SetAcType(chip::EndpointId endpoint, uint8_t acType) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcType, (uint8_t *) &acType, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCapacity(chip::EndpointId endpoint, uint16_t * acCapacity) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcCapacity, (uint8_t *) acCapacity, sizeof(*acCapacity)); +} +EmberAfStatus SetAcCapacity(chip::EndpointId endpoint, uint16_t acCapacity) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcCapacity, (uint8_t *) &acCapacity, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcRefrigerantType(chip::EndpointId endpoint, uint8_t * acRefrigerantType) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcRefrigerantType, (uint8_t *) acRefrigerantType, + sizeof(*acRefrigerantType)); +} +EmberAfStatus SetAcRefrigerantType(chip::EndpointId endpoint, uint8_t acRefrigerantType) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcRefrigerantType, (uint8_t *) &acRefrigerantType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCompressor(chip::EndpointId endpoint, uint8_t * acCompressor) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcCompressor, (uint8_t *) acCompressor, sizeof(*acCompressor)); +} +EmberAfStatus SetAcCompressor(chip::EndpointId endpoint, uint8_t acCompressor) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcCompressor, (uint8_t *) &acCompressor, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcErrorCode(chip::EndpointId endpoint, uint32_t * acErrorCode) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcErrorCode, (uint8_t *) acErrorCode, sizeof(*acErrorCode)); +} +EmberAfStatus SetAcErrorCode(chip::EndpointId endpoint, uint32_t acErrorCode) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcErrorCode, (uint8_t *) &acErrorCode, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcLouverPosition(chip::EndpointId endpoint, uint8_t * acLouverPosition) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcLouverPosition, (uint8_t *) acLouverPosition, + sizeof(*acLouverPosition)); +} +EmberAfStatus SetAcLouverPosition(chip::EndpointId endpoint, uint8_t acLouverPosition) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcLouverPosition, (uint8_t *) &acLouverPosition, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCoilTemperature(chip::EndpointId endpoint, int16_t * acCoilTemperature) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcCoilTemperature, (uint8_t *) acCoilTemperature, + sizeof(*acCoilTemperature)); +} +EmberAfStatus SetAcCoilTemperature(chip::EndpointId endpoint, int16_t acCoilTemperature) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcCoilTemperature, (uint8_t *) &acCoilTemperature, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCapacityFormat(chip::EndpointId endpoint, uint8_t * acCapacityFormat) +{ + return emberAfReadServerAttribute(endpoint, Thermostat::Id, Ids::AcCapacityFormat, (uint8_t *) acCapacityFormat, + sizeof(*acCapacityFormat)); +} +EmberAfStatus SetAcCapacityFormat(chip::EndpointId endpoint, uint8_t acCapacityFormat) +{ + return emberAfWriteServerAttribute(endpoint, Thermostat::Id, Ids::AcCapacityFormat, (uint8_t *) &acCapacityFormat, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace Thermostat + +namespace FanControl { +namespace Attributes { +EmberAfStatus GetFanMode(chip::EndpointId endpoint, uint8_t * fanMode) +{ + return emberAfReadServerAttribute(endpoint, FanControl::Id, Ids::FanMode, (uint8_t *) fanMode, sizeof(*fanMode)); +} +EmberAfStatus SetFanMode(chip::EndpointId endpoint, uint8_t fanMode) +{ + return emberAfWriteServerAttribute(endpoint, FanControl::Id, Ids::FanMode, (uint8_t *) &fanMode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetFanModeSequence(chip::EndpointId endpoint, uint8_t * fanModeSequence) +{ + return emberAfReadServerAttribute(endpoint, FanControl::Id, Ids::FanModeSequence, (uint8_t *) fanModeSequence, + sizeof(*fanModeSequence)); +} +EmberAfStatus SetFanModeSequence(chip::EndpointId endpoint, uint8_t fanModeSequence) +{ + return emberAfWriteServerAttribute(endpoint, FanControl::Id, Ids::FanModeSequence, (uint8_t *) &fanModeSequence, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace FanControl + +namespace DehumidificationControl { +namespace Attributes { +EmberAfStatus GetRelativeHumidity(chip::EndpointId endpoint, uint8_t * relativeHumidity) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidity, (uint8_t *) relativeHumidity, + sizeof(*relativeHumidity)); +} +EmberAfStatus SetRelativeHumidity(chip::EndpointId endpoint, uint8_t relativeHumidity) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidity, (uint8_t *) &relativeHumidity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDehumidificationCooling(chip::EndpointId endpoint, uint8_t * dehumidificationCooling) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationCooling, + (uint8_t *) dehumidificationCooling, sizeof(*dehumidificationCooling)); +} +EmberAfStatus SetDehumidificationCooling(chip::EndpointId endpoint, uint8_t dehumidificationCooling) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationCooling, + (uint8_t *) &dehumidificationCooling, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRhDehumidificationSetpoint(chip::EndpointId endpoint, uint8_t * rhDehumidificationSetpoint) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::RhDehumidificationSetpoint, + (uint8_t *) rhDehumidificationSetpoint, sizeof(*rhDehumidificationSetpoint)); +} +EmberAfStatus SetRhDehumidificationSetpoint(chip::EndpointId endpoint, uint8_t rhDehumidificationSetpoint) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::RhDehumidificationSetpoint, + (uint8_t *) &rhDehumidificationSetpoint, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRelativeHumidityMode(chip::EndpointId endpoint, uint8_t * relativeHumidityMode) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidityMode, + (uint8_t *) relativeHumidityMode, sizeof(*relativeHumidityMode)); +} +EmberAfStatus SetRelativeHumidityMode(chip::EndpointId endpoint, uint8_t relativeHumidityMode) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidityMode, + (uint8_t *) &relativeHumidityMode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDehumidificationLockout(chip::EndpointId endpoint, uint8_t * dehumidificationLockout) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationLockout, + (uint8_t *) dehumidificationLockout, sizeof(*dehumidificationLockout)); +} +EmberAfStatus SetDehumidificationLockout(chip::EndpointId endpoint, uint8_t dehumidificationLockout) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationLockout, + (uint8_t *) &dehumidificationLockout, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDehumidificationHysteresis(chip::EndpointId endpoint, uint8_t * dehumidificationHysteresis) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationHysteresis, + (uint8_t *) dehumidificationHysteresis, sizeof(*dehumidificationHysteresis)); +} +EmberAfStatus SetDehumidificationHysteresis(chip::EndpointId endpoint, uint8_t dehumidificationHysteresis) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationHysteresis, + (uint8_t *) &dehumidificationHysteresis, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDehumidificationMaxCool(chip::EndpointId endpoint, uint8_t * dehumidificationMaxCool) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationMaxCool, + (uint8_t *) dehumidificationMaxCool, sizeof(*dehumidificationMaxCool)); +} +EmberAfStatus SetDehumidificationMaxCool(chip::EndpointId endpoint, uint8_t dehumidificationMaxCool) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::DehumidificationMaxCool, + (uint8_t *) &dehumidificationMaxCool, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRelativeHumidityDisplay(chip::EndpointId endpoint, uint8_t * relativeHumidityDisplay) +{ + return emberAfReadServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidityDisplay, + (uint8_t *) relativeHumidityDisplay, sizeof(*relativeHumidityDisplay)); +} +EmberAfStatus SetRelativeHumidityDisplay(chip::EndpointId endpoint, uint8_t relativeHumidityDisplay) +{ + return emberAfWriteServerAttribute(endpoint, DehumidificationControl::Id, Ids::RelativeHumidityDisplay, + (uint8_t *) &relativeHumidityDisplay, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace DehumidificationControl + +namespace ThermostatUserInterfaceConfiguration { +namespace Attributes { +EmberAfStatus GetTemperatureDisplayMode(chip::EndpointId endpoint, uint8_t * temperatureDisplayMode) +{ + return emberAfReadServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::TemperatureDisplayMode, + (uint8_t *) temperatureDisplayMode, sizeof(*temperatureDisplayMode)); +} +EmberAfStatus SetTemperatureDisplayMode(chip::EndpointId endpoint, uint8_t temperatureDisplayMode) +{ + return emberAfWriteServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::TemperatureDisplayMode, + (uint8_t *) &temperatureDisplayMode, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetKeypadLockout(chip::EndpointId endpoint, uint8_t * keypadLockout) +{ + return emberAfReadServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::KeypadLockout, + (uint8_t *) keypadLockout, sizeof(*keypadLockout)); +} +EmberAfStatus SetKeypadLockout(chip::EndpointId endpoint, uint8_t keypadLockout) +{ + return emberAfWriteServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::KeypadLockout, + (uint8_t *) &keypadLockout, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetScheduleProgrammingVisibility(chip::EndpointId endpoint, uint8_t * scheduleProgrammingVisibility) +{ + return emberAfReadServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::ScheduleProgrammingVisibility, + (uint8_t *) scheduleProgrammingVisibility, sizeof(*scheduleProgrammingVisibility)); +} +EmberAfStatus SetScheduleProgrammingVisibility(chip::EndpointId endpoint, uint8_t scheduleProgrammingVisibility) +{ + return emberAfWriteServerAttribute(endpoint, ThermostatUserInterfaceConfiguration::Id, Ids::ScheduleProgrammingVisibility, + (uint8_t *) &scheduleProgrammingVisibility, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ThermostatUserInterfaceConfiguration + +namespace ColorControl { +namespace Attributes { +EmberAfStatus GetCurrentHue(chip::EndpointId endpoint, uint8_t * currentHue) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::CurrentHue, (uint8_t *) currentHue, sizeof(*currentHue)); +} +EmberAfStatus SetCurrentHue(chip::EndpointId endpoint, uint8_t currentHue) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::CurrentHue, (uint8_t *) ¤tHue, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentSaturation(chip::EndpointId endpoint, uint8_t * currentSaturation) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::CurrentSaturation, (uint8_t *) currentSaturation, + sizeof(*currentSaturation)); +} +EmberAfStatus SetCurrentSaturation(chip::EndpointId endpoint, uint8_t currentSaturation) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::CurrentSaturation, (uint8_t *) ¤tSaturation, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::RemainingTime, (uint8_t *) remainingTime, + sizeof(*remainingTime)); +} +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::RemainingTime, (uint8_t *) &remainingTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentX(chip::EndpointId endpoint, uint16_t * currentX) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::CurrentX, (uint8_t *) currentX, sizeof(*currentX)); +} +EmberAfStatus SetCurrentX(chip::EndpointId endpoint, uint16_t currentX) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::CurrentX, (uint8_t *) ¤tX, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentY(chip::EndpointId endpoint, uint16_t * currentY) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::CurrentY, (uint8_t *) currentY, sizeof(*currentY)); +} +EmberAfStatus SetCurrentY(chip::EndpointId endpoint, uint16_t currentY) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::CurrentY, (uint8_t *) ¤tY, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDriftCompensation(chip::EndpointId endpoint, uint8_t * driftCompensation) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::DriftCompensation, (uint8_t *) driftCompensation, + sizeof(*driftCompensation)); +} +EmberAfStatus SetDriftCompensation(chip::EndpointId endpoint, uint8_t driftCompensation) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::DriftCompensation, (uint8_t *) &driftCompensation, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorTemperature(chip::EndpointId endpoint, uint16_t * colorTemperature) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorTemperature, (uint8_t *) colorTemperature, + sizeof(*colorTemperature)); +} +EmberAfStatus SetColorTemperature(chip::EndpointId endpoint, uint16_t colorTemperature) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorTemperature, (uint8_t *) &colorTemperature, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorMode(chip::EndpointId endpoint, uint8_t * colorMode) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorMode, (uint8_t *) colorMode, sizeof(*colorMode)); +} +EmberAfStatus SetColorMode(chip::EndpointId endpoint, uint8_t colorMode) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorMode, (uint8_t *) &colorMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorControlOptions(chip::EndpointId endpoint, uint8_t * colorControlOptions) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorControlOptions, (uint8_t *) colorControlOptions, + sizeof(*colorControlOptions)); +} +EmberAfStatus SetColorControlOptions(chip::EndpointId endpoint, uint8_t colorControlOptions) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorControlOptions, (uint8_t *) &colorControlOptions, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfPrimaries(chip::EndpointId endpoint, uint8_t * numberOfPrimaries) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::NumberOfPrimaries, (uint8_t *) numberOfPrimaries, + sizeof(*numberOfPrimaries)); +} +EmberAfStatus SetNumberOfPrimaries(chip::EndpointId endpoint, uint8_t numberOfPrimaries) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::NumberOfPrimaries, (uint8_t *) &numberOfPrimaries, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary1X(chip::EndpointId endpoint, uint16_t * primary1X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary1X, (uint8_t *) primary1X, sizeof(*primary1X)); +} +EmberAfStatus SetPrimary1X(chip::EndpointId endpoint, uint16_t primary1X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary1X, (uint8_t *) &primary1X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary1Y(chip::EndpointId endpoint, uint16_t * primary1Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary1Y, (uint8_t *) primary1Y, sizeof(*primary1Y)); +} +EmberAfStatus SetPrimary1Y(chip::EndpointId endpoint, uint16_t primary1Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary1Y, (uint8_t *) &primary1Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary1Intensity(chip::EndpointId endpoint, uint8_t * primary1Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary1Intensity, (uint8_t *) primary1Intensity, + sizeof(*primary1Intensity)); +} +EmberAfStatus SetPrimary1Intensity(chip::EndpointId endpoint, uint8_t primary1Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary1Intensity, (uint8_t *) &primary1Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary2X(chip::EndpointId endpoint, uint16_t * primary2X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary2X, (uint8_t *) primary2X, sizeof(*primary2X)); +} +EmberAfStatus SetPrimary2X(chip::EndpointId endpoint, uint16_t primary2X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary2X, (uint8_t *) &primary2X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary2Y(chip::EndpointId endpoint, uint16_t * primary2Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary2Y, (uint8_t *) primary2Y, sizeof(*primary2Y)); +} +EmberAfStatus SetPrimary2Y(chip::EndpointId endpoint, uint16_t primary2Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary2Y, (uint8_t *) &primary2Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary2Intensity(chip::EndpointId endpoint, uint8_t * primary2Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary2Intensity, (uint8_t *) primary2Intensity, + sizeof(*primary2Intensity)); +} +EmberAfStatus SetPrimary2Intensity(chip::EndpointId endpoint, uint8_t primary2Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary2Intensity, (uint8_t *) &primary2Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary3X(chip::EndpointId endpoint, uint16_t * primary3X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary3X, (uint8_t *) primary3X, sizeof(*primary3X)); +} +EmberAfStatus SetPrimary3X(chip::EndpointId endpoint, uint16_t primary3X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary3X, (uint8_t *) &primary3X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary3Y(chip::EndpointId endpoint, uint16_t * primary3Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary3Y, (uint8_t *) primary3Y, sizeof(*primary3Y)); +} +EmberAfStatus SetPrimary3Y(chip::EndpointId endpoint, uint16_t primary3Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary3Y, (uint8_t *) &primary3Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary3Intensity(chip::EndpointId endpoint, uint8_t * primary3Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary3Intensity, (uint8_t *) primary3Intensity, + sizeof(*primary3Intensity)); +} +EmberAfStatus SetPrimary3Intensity(chip::EndpointId endpoint, uint8_t primary3Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary3Intensity, (uint8_t *) &primary3Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary4X(chip::EndpointId endpoint, uint16_t * primary4X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary4X, (uint8_t *) primary4X, sizeof(*primary4X)); +} +EmberAfStatus SetPrimary4X(chip::EndpointId endpoint, uint16_t primary4X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary4X, (uint8_t *) &primary4X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary4Y(chip::EndpointId endpoint, uint16_t * primary4Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary4Y, (uint8_t *) primary4Y, sizeof(*primary4Y)); +} +EmberAfStatus SetPrimary4Y(chip::EndpointId endpoint, uint16_t primary4Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary4Y, (uint8_t *) &primary4Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary4Intensity(chip::EndpointId endpoint, uint8_t * primary4Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary4Intensity, (uint8_t *) primary4Intensity, + sizeof(*primary4Intensity)); +} +EmberAfStatus SetPrimary4Intensity(chip::EndpointId endpoint, uint8_t primary4Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary4Intensity, (uint8_t *) &primary4Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary5X(chip::EndpointId endpoint, uint16_t * primary5X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary5X, (uint8_t *) primary5X, sizeof(*primary5X)); +} +EmberAfStatus SetPrimary5X(chip::EndpointId endpoint, uint16_t primary5X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary5X, (uint8_t *) &primary5X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary5Y(chip::EndpointId endpoint, uint16_t * primary5Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary5Y, (uint8_t *) primary5Y, sizeof(*primary5Y)); +} +EmberAfStatus SetPrimary5Y(chip::EndpointId endpoint, uint16_t primary5Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary5Y, (uint8_t *) &primary5Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary5Intensity(chip::EndpointId endpoint, uint8_t * primary5Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary5Intensity, (uint8_t *) primary5Intensity, + sizeof(*primary5Intensity)); +} +EmberAfStatus SetPrimary5Intensity(chip::EndpointId endpoint, uint8_t primary5Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary5Intensity, (uint8_t *) &primary5Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary6X(chip::EndpointId endpoint, uint16_t * primary6X) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary6X, (uint8_t *) primary6X, sizeof(*primary6X)); +} +EmberAfStatus SetPrimary6X(chip::EndpointId endpoint, uint16_t primary6X) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary6X, (uint8_t *) &primary6X, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary6Y(chip::EndpointId endpoint, uint16_t * primary6Y) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary6Y, (uint8_t *) primary6Y, sizeof(*primary6Y)); +} +EmberAfStatus SetPrimary6Y(chip::EndpointId endpoint, uint16_t primary6Y) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary6Y, (uint8_t *) &primary6Y, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPrimary6Intensity(chip::EndpointId endpoint, uint8_t * primary6Intensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::Primary6Intensity, (uint8_t *) primary6Intensity, + sizeof(*primary6Intensity)); +} +EmberAfStatus SetPrimary6Intensity(chip::EndpointId endpoint, uint8_t primary6Intensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::Primary6Intensity, (uint8_t *) &primary6Intensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetWhitePointX(chip::EndpointId endpoint, uint16_t * whitePointX) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::WhitePointX, (uint8_t *) whitePointX, sizeof(*whitePointX)); +} +EmberAfStatus SetWhitePointX(chip::EndpointId endpoint, uint16_t whitePointX) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::WhitePointX, (uint8_t *) &whitePointX, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetWhitePointY(chip::EndpointId endpoint, uint16_t * whitePointY) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::WhitePointY, (uint8_t *) whitePointY, sizeof(*whitePointY)); +} +EmberAfStatus SetWhitePointY(chip::EndpointId endpoint, uint16_t whitePointY) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::WhitePointY, (uint8_t *) &whitePointY, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointRX(chip::EndpointId endpoint, uint16_t * colorPointRX) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRX, (uint8_t *) colorPointRX, + sizeof(*colorPointRX)); +} +EmberAfStatus SetColorPointRX(chip::EndpointId endpoint, uint16_t colorPointRX) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRX, (uint8_t *) &colorPointRX, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointRY(chip::EndpointId endpoint, uint16_t * colorPointRY) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRY, (uint8_t *) colorPointRY, + sizeof(*colorPointRY)); +} +EmberAfStatus SetColorPointRY(chip::EndpointId endpoint, uint16_t colorPointRY) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRY, (uint8_t *) &colorPointRY, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointRIntensity(chip::EndpointId endpoint, uint8_t * colorPointRIntensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRIntensity, (uint8_t *) colorPointRIntensity, + sizeof(*colorPointRIntensity)); +} +EmberAfStatus SetColorPointRIntensity(chip::EndpointId endpoint, uint8_t colorPointRIntensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointRIntensity, (uint8_t *) &colorPointRIntensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointGX(chip::EndpointId endpoint, uint16_t * colorPointGX) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGX, (uint8_t *) colorPointGX, + sizeof(*colorPointGX)); +} +EmberAfStatus SetColorPointGX(chip::EndpointId endpoint, uint16_t colorPointGX) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGX, (uint8_t *) &colorPointGX, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointGY(chip::EndpointId endpoint, uint16_t * colorPointGY) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGY, (uint8_t *) colorPointGY, + sizeof(*colorPointGY)); +} +EmberAfStatus SetColorPointGY(chip::EndpointId endpoint, uint16_t colorPointGY) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGY, (uint8_t *) &colorPointGY, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointGIntensity(chip::EndpointId endpoint, uint8_t * colorPointGIntensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGIntensity, (uint8_t *) colorPointGIntensity, + sizeof(*colorPointGIntensity)); +} +EmberAfStatus SetColorPointGIntensity(chip::EndpointId endpoint, uint8_t colorPointGIntensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointGIntensity, (uint8_t *) &colorPointGIntensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointBX(chip::EndpointId endpoint, uint16_t * colorPointBX) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBX, (uint8_t *) colorPointBX, + sizeof(*colorPointBX)); +} +EmberAfStatus SetColorPointBX(chip::EndpointId endpoint, uint16_t colorPointBX) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBX, (uint8_t *) &colorPointBX, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointBY(chip::EndpointId endpoint, uint16_t * colorPointBY) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBY, (uint8_t *) colorPointBY, + sizeof(*colorPointBY)); +} +EmberAfStatus SetColorPointBY(chip::EndpointId endpoint, uint16_t colorPointBY) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBY, (uint8_t *) &colorPointBY, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorPointBIntensity(chip::EndpointId endpoint, uint8_t * colorPointBIntensity) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBIntensity, (uint8_t *) colorPointBIntensity, + sizeof(*colorPointBIntensity)); +} +EmberAfStatus SetColorPointBIntensity(chip::EndpointId endpoint, uint8_t colorPointBIntensity) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorPointBIntensity, (uint8_t *) &colorPointBIntensity, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnhancedCurrentHue(chip::EndpointId endpoint, uint16_t * enhancedCurrentHue) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::EnhancedCurrentHue, (uint8_t *) enhancedCurrentHue, + sizeof(*enhancedCurrentHue)); +} +EmberAfStatus SetEnhancedCurrentHue(chip::EndpointId endpoint, uint16_t enhancedCurrentHue) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::EnhancedCurrentHue, (uint8_t *) &enhancedCurrentHue, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnhancedColorMode(chip::EndpointId endpoint, uint8_t * enhancedColorMode) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::EnhancedColorMode, (uint8_t *) enhancedColorMode, + sizeof(*enhancedColorMode)); +} +EmberAfStatus SetEnhancedColorMode(chip::EndpointId endpoint, uint8_t enhancedColorMode) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::EnhancedColorMode, (uint8_t *) &enhancedColorMode, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorLoopActive(chip::EndpointId endpoint, uint8_t * colorLoopActive) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopActive, (uint8_t *) colorLoopActive, + sizeof(*colorLoopActive)); +} +EmberAfStatus SetColorLoopActive(chip::EndpointId endpoint, uint8_t colorLoopActive) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopActive, (uint8_t *) &colorLoopActive, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorLoopDirection(chip::EndpointId endpoint, uint8_t * colorLoopDirection) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopDirection, (uint8_t *) colorLoopDirection, + sizeof(*colorLoopDirection)); +} +EmberAfStatus SetColorLoopDirection(chip::EndpointId endpoint, uint8_t colorLoopDirection) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopDirection, (uint8_t *) &colorLoopDirection, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorLoopTime(chip::EndpointId endpoint, uint16_t * colorLoopTime) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopTime, (uint8_t *) colorLoopTime, + sizeof(*colorLoopTime)); +} +EmberAfStatus SetColorLoopTime(chip::EndpointId endpoint, uint16_t colorLoopTime) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopTime, (uint8_t *) &colorLoopTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorLoopStartEnhancedHue(chip::EndpointId endpoint, uint16_t * colorLoopStartEnhancedHue) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopStartEnhancedHue, + (uint8_t *) colorLoopStartEnhancedHue, sizeof(*colorLoopStartEnhancedHue)); +} +EmberAfStatus SetColorLoopStartEnhancedHue(chip::EndpointId endpoint, uint16_t colorLoopStartEnhancedHue) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopStartEnhancedHue, + (uint8_t *) &colorLoopStartEnhancedHue, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorLoopStoredEnhancedHue(chip::EndpointId endpoint, uint16_t * colorLoopStoredEnhancedHue) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopStoredEnhancedHue, + (uint8_t *) colorLoopStoredEnhancedHue, sizeof(*colorLoopStoredEnhancedHue)); +} +EmberAfStatus SetColorLoopStoredEnhancedHue(chip::EndpointId endpoint, uint16_t colorLoopStoredEnhancedHue) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorLoopStoredEnhancedHue, + (uint8_t *) &colorLoopStoredEnhancedHue, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorCapabilities(chip::EndpointId endpoint, uint16_t * colorCapabilities) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorCapabilities, (uint8_t *) colorCapabilities, + sizeof(*colorCapabilities)); +} +EmberAfStatus SetColorCapabilities(chip::EndpointId endpoint, uint16_t colorCapabilities) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorCapabilities, (uint8_t *) &colorCapabilities, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorTempPhysicalMin(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMin) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorTempPhysicalMin, (uint8_t *) colorTempPhysicalMin, + sizeof(*colorTempPhysicalMin)); +} +EmberAfStatus SetColorTempPhysicalMin(chip::EndpointId endpoint, uint16_t colorTempPhysicalMin) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorTempPhysicalMin, (uint8_t *) &colorTempPhysicalMin, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetColorTempPhysicalMax(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMax) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::ColorTempPhysicalMax, (uint8_t *) colorTempPhysicalMax, + sizeof(*colorTempPhysicalMax)); +} +EmberAfStatus SetColorTempPhysicalMax(chip::EndpointId endpoint, uint16_t colorTempPhysicalMax) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::ColorTempPhysicalMax, (uint8_t *) &colorTempPhysicalMax, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCoupleColorTempToLevelMinMireds(chip::EndpointId endpoint, uint16_t * coupleColorTempToLevelMinMireds) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::CoupleColorTempToLevelMinMireds, + (uint8_t *) coupleColorTempToLevelMinMireds, sizeof(*coupleColorTempToLevelMinMireds)); +} +EmberAfStatus SetCoupleColorTempToLevelMinMireds(chip::EndpointId endpoint, uint16_t coupleColorTempToLevelMinMireds) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::CoupleColorTempToLevelMinMireds, + (uint8_t *) &coupleColorTempToLevelMinMireds, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStartUpColorTemperatureMireds(chip::EndpointId endpoint, uint16_t * startUpColorTemperatureMireds) +{ + return emberAfReadServerAttribute(endpoint, ColorControl::Id, Ids::StartUpColorTemperatureMireds, + (uint8_t *) startUpColorTemperatureMireds, sizeof(*startUpColorTemperatureMireds)); +} +EmberAfStatus SetStartUpColorTemperatureMireds(chip::EndpointId endpoint, uint16_t startUpColorTemperatureMireds) +{ + return emberAfWriteServerAttribute(endpoint, ColorControl::Id, Ids::StartUpColorTemperatureMireds, + (uint8_t *) &startUpColorTemperatureMireds, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ColorControl + +namespace BallastConfiguration { +namespace Attributes { +EmberAfStatus GetPhysicalMinLevel(chip::EndpointId endpoint, uint8_t * physicalMinLevel) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::PhysicalMinLevel, (uint8_t *) physicalMinLevel, + sizeof(*physicalMinLevel)); +} +EmberAfStatus SetPhysicalMinLevel(chip::EndpointId endpoint, uint8_t physicalMinLevel) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::PhysicalMinLevel, (uint8_t *) &physicalMinLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalMaxLevel(chip::EndpointId endpoint, uint8_t * physicalMaxLevel) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::PhysicalMaxLevel, (uint8_t *) physicalMaxLevel, + sizeof(*physicalMaxLevel)); +} +EmberAfStatus SetPhysicalMaxLevel(chip::EndpointId endpoint, uint8_t physicalMaxLevel) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::PhysicalMaxLevel, (uint8_t *) &physicalMaxLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBallastStatus(chip::EndpointId endpoint, uint8_t * ballastStatus) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::BallastStatus, (uint8_t *) ballastStatus, + sizeof(*ballastStatus)); +} +EmberAfStatus SetBallastStatus(chip::EndpointId endpoint, uint8_t ballastStatus) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::BallastStatus, (uint8_t *) &ballastStatus, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinLevel(chip::EndpointId endpoint, uint8_t * minLevel) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::MinLevel, (uint8_t *) minLevel, sizeof(*minLevel)); +} +EmberAfStatus SetMinLevel(chip::EndpointId endpoint, uint8_t minLevel) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::MinLevel, (uint8_t *) &minLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxLevel(chip::EndpointId endpoint, uint8_t * maxLevel) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::MaxLevel, (uint8_t *) maxLevel, sizeof(*maxLevel)); +} +EmberAfStatus SetMaxLevel(chip::EndpointId endpoint, uint8_t maxLevel) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::MaxLevel, (uint8_t *) &maxLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerOnLevel(chip::EndpointId endpoint, uint8_t * powerOnLevel) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::PowerOnLevel, (uint8_t *) powerOnLevel, + sizeof(*powerOnLevel)); +} +EmberAfStatus SetPowerOnLevel(chip::EndpointId endpoint, uint8_t powerOnLevel) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::PowerOnLevel, (uint8_t *) &powerOnLevel, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerOnFadeTime(chip::EndpointId endpoint, uint16_t * powerOnFadeTime) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::PowerOnFadeTime, (uint8_t *) powerOnFadeTime, + sizeof(*powerOnFadeTime)); +} +EmberAfStatus SetPowerOnFadeTime(chip::EndpointId endpoint, uint16_t powerOnFadeTime) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::PowerOnFadeTime, (uint8_t *) &powerOnFadeTime, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetIntrinsicBallastFactor(chip::EndpointId endpoint, uint8_t * intrinsicBallastFactor) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::IntrinsicBallastFactor, + (uint8_t *) intrinsicBallastFactor, sizeof(*intrinsicBallastFactor)); +} +EmberAfStatus SetIntrinsicBallastFactor(chip::EndpointId endpoint, uint8_t intrinsicBallastFactor) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::IntrinsicBallastFactor, + (uint8_t *) &intrinsicBallastFactor, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBallastFactorAdjustment(chip::EndpointId endpoint, uint8_t * ballastFactorAdjustment) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::BallastFactorAdjustment, + (uint8_t *) ballastFactorAdjustment, sizeof(*ballastFactorAdjustment)); +} +EmberAfStatus SetBallastFactorAdjustment(chip::EndpointId endpoint, uint8_t ballastFactorAdjustment) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::BallastFactorAdjustment, + (uint8_t *) &ballastFactorAdjustment, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLampQuality(chip::EndpointId endpoint, uint8_t * lampQuality) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::LampQuality, (uint8_t *) lampQuality, + sizeof(*lampQuality)); +} +EmberAfStatus SetLampQuality(chip::EndpointId endpoint, uint8_t lampQuality) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::LampQuality, (uint8_t *) &lampQuality, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLampAlarmMode(chip::EndpointId endpoint, uint8_t * lampAlarmMode) +{ + return emberAfReadServerAttribute(endpoint, BallastConfiguration::Id, Ids::LampAlarmMode, (uint8_t *) lampAlarmMode, + sizeof(*lampAlarmMode)); +} +EmberAfStatus SetLampAlarmMode(chip::EndpointId endpoint, uint8_t lampAlarmMode) +{ + return emberAfWriteServerAttribute(endpoint, BallastConfiguration::Id, Ids::LampAlarmMode, (uint8_t *) &lampAlarmMode, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BallastConfiguration + +namespace IlluminanceMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, uint16_t * measuredValue) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, uint16_t measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, uint16_t * minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) minMeasuredValue, + sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, uint16_t minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) &minMeasuredValue, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t * maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) maxMeasuredValue, + sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) &maxMeasuredValue, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLightSensorType(chip::EndpointId endpoint, uint8_t * lightSensorType) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::LightSensorType, (uint8_t *) lightSensorType, + sizeof(*lightSensorType)); +} +EmberAfStatus SetLightSensorType(chip::EndpointId endpoint, uint8_t lightSensorType) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceMeasurement::Id, Ids::LightSensorType, (uint8_t *) &lightSensorType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace IlluminanceMeasurement + +namespace IlluminanceLevelSensing { +namespace Attributes { +EmberAfStatus GetLevelStatus(chip::EndpointId endpoint, uint8_t * levelStatus) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::LevelStatus, (uint8_t *) levelStatus, + sizeof(*levelStatus)); +} +EmberAfStatus SetLevelStatus(chip::EndpointId endpoint, uint8_t levelStatus) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::LevelStatus, (uint8_t *) &levelStatus, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLightSensorType(chip::EndpointId endpoint, uint8_t * lightSensorType) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::LightSensorType, (uint8_t *) lightSensorType, + sizeof(*lightSensorType)); +} +EmberAfStatus SetLightSensorType(chip::EndpointId endpoint, uint8_t lightSensorType) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::LightSensorType, (uint8_t *) &lightSensorType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetIlluminanceLevelTarget(chip::EndpointId endpoint, uint16_t * illuminanceLevelTarget) +{ + return emberAfReadServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::IlluminanceLevelTarget, + (uint8_t *) illuminanceLevelTarget, sizeof(*illuminanceLevelTarget)); +} +EmberAfStatus SetIlluminanceLevelTarget(chip::EndpointId endpoint, uint16_t illuminanceLevelTarget) +{ + return emberAfWriteServerAttribute(endpoint, IlluminanceLevelSensing::Id, Ids::IlluminanceLevelTarget, + (uint8_t *) &illuminanceLevelTarget, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace IlluminanceLevelSensing + +namespace TemperatureMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue) +{ + return emberAfReadServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) minMeasuredValue, + sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) &minMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) maxMeasuredValue, + sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) &maxMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance) +{ + return emberAfReadServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance) +{ + return emberAfWriteServerAttribute(endpoint, TemperatureMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TemperatureMeasurement + +namespace PressureMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) minMeasuredValue, + sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) &minMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) maxMeasuredValue, + sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) &maxMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetScaledValue(chip::EndpointId endpoint, int16_t * scaledValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledValue, (uint8_t *) scaledValue, + sizeof(*scaledValue)); +} +EmberAfStatus SetScaledValue(chip::EndpointId endpoint, int16_t scaledValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledValue, (uint8_t *) &scaledValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinScaledValue(chip::EndpointId endpoint, int16_t * minScaledValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::MinScaledValue, (uint8_t *) minScaledValue, + sizeof(*minScaledValue)); +} +EmberAfStatus SetMinScaledValue(chip::EndpointId endpoint, int16_t minScaledValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MinScaledValue, (uint8_t *) &minScaledValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxScaledValue(chip::EndpointId endpoint, int16_t * maxScaledValue) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::MaxScaledValue, (uint8_t *) maxScaledValue, + sizeof(*maxScaledValue)); +} +EmberAfStatus SetMaxScaledValue(chip::EndpointId endpoint, int16_t maxScaledValue) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MaxScaledValue, (uint8_t *) &maxScaledValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, int16_t * scaledTolerance) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledTolerance, (uint8_t *) scaledTolerance, + sizeof(*scaledTolerance)); +} +EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, int16_t scaledTolerance) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledTolerance, (uint8_t *) &scaledTolerance, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetScale(chip::EndpointId endpoint, int8_t * scale) +{ + return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::Scale, (uint8_t *) scale, sizeof(*scale)); +} +EmberAfStatus SetScale(chip::EndpointId endpoint, int8_t scale) +{ + return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::Scale, (uint8_t *) &scale, ZCL_INT8S_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace PressureMeasurement + +namespace FlowMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue) +{ + return emberAfReadServerAttribute(endpoint, FlowMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FlowMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FlowMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) minMeasuredValue, + sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FlowMeasurement::Id, Ids::MinMeasuredValue, (uint8_t *) &minMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FlowMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) maxMeasuredValue, + sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FlowMeasurement::Id, Ids::MaxMeasuredValue, (uint8_t *) &maxMeasuredValue, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance) +{ + return emberAfReadServerAttribute(endpoint, FlowMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance) +{ + return emberAfWriteServerAttribute(endpoint, FlowMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace FlowMeasurement + +namespace RelativeHumidityMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, uint16_t * measuredValue) +{ + return emberAfReadServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, uint16_t measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, uint16_t * minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, uint16_t minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t * maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance) +{ + return emberAfReadServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance) +{ + return emberAfWriteServerAttribute(endpoint, RelativeHumidityMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace RelativeHumidityMeasurement + +namespace OccupancySensing { +namespace Attributes { +EmberAfStatus GetOccupancy(chip::EndpointId endpoint, uint8_t * occupancy) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::Occupancy, (uint8_t *) occupancy, sizeof(*occupancy)); +} +EmberAfStatus SetOccupancy(chip::EndpointId endpoint, uint8_t occupancy) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::Occupancy, (uint8_t *) &occupancy, + ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOccupancySensorType(chip::EndpointId endpoint, uint8_t * occupancySensorType) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::OccupancySensorType, (uint8_t *) occupancySensorType, + sizeof(*occupancySensorType)); +} +EmberAfStatus SetOccupancySensorType(chip::EndpointId endpoint, uint8_t occupancySensorType) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::OccupancySensorType, (uint8_t *) &occupancySensorType, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOccupancySensorTypeBitmap(chip::EndpointId endpoint, uint8_t * occupancySensorTypeBitmap) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::OccupancySensorTypeBitmap, + (uint8_t *) occupancySensorTypeBitmap, sizeof(*occupancySensorTypeBitmap)); +} +EmberAfStatus SetOccupancySensorTypeBitmap(chip::EndpointId endpoint, uint8_t occupancySensorTypeBitmap) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::OccupancySensorTypeBitmap, + (uint8_t *) &occupancySensorTypeBitmap, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPirOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t * pirOccupiedToUnoccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PirOccupiedToUnoccupiedDelay, + (uint8_t *) pirOccupiedToUnoccupiedDelay, sizeof(*pirOccupiedToUnoccupiedDelay)); +} +EmberAfStatus SetPirOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t pirOccupiedToUnoccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PirOccupiedToUnoccupiedDelay, + (uint8_t *) &pirOccupiedToUnoccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPirUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t * pirUnoccupiedToOccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PirUnoccupiedToOccupiedDelay, + (uint8_t *) pirUnoccupiedToOccupiedDelay, sizeof(*pirUnoccupiedToOccupiedDelay)); +} +EmberAfStatus SetPirUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t pirUnoccupiedToOccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PirUnoccupiedToOccupiedDelay, + (uint8_t *) &pirUnoccupiedToOccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPirUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, uint8_t * pirUnoccupiedToOccupiedThreshold) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PirUnoccupiedToOccupiedThreshold, + (uint8_t *) pirUnoccupiedToOccupiedThreshold, sizeof(*pirUnoccupiedToOccupiedThreshold)); +} +EmberAfStatus SetPirUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, uint8_t pirUnoccupiedToOccupiedThreshold) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PirUnoccupiedToOccupiedThreshold, + (uint8_t *) &pirUnoccupiedToOccupiedThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUltrasonicOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t * ultrasonicOccupiedToUnoccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicOccupiedToUnoccupiedDelay, + (uint8_t *) ultrasonicOccupiedToUnoccupiedDelay, + sizeof(*ultrasonicOccupiedToUnoccupiedDelay)); +} +EmberAfStatus SetUltrasonicOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t ultrasonicOccupiedToUnoccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicOccupiedToUnoccupiedDelay, + (uint8_t *) &ultrasonicOccupiedToUnoccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUltrasonicUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t * ultrasonicUnoccupiedToOccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicUnoccupiedToOccupiedDelay, + (uint8_t *) ultrasonicUnoccupiedToOccupiedDelay, + sizeof(*ultrasonicUnoccupiedToOccupiedDelay)); +} +EmberAfStatus SetUltrasonicUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t ultrasonicUnoccupiedToOccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicUnoccupiedToOccupiedDelay, + (uint8_t *) &ultrasonicUnoccupiedToOccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUltrasonicUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t * ultrasonicUnoccupiedToOccupiedThreshold) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicUnoccupiedToOccupiedThreshold, + (uint8_t *) ultrasonicUnoccupiedToOccupiedThreshold, + sizeof(*ultrasonicUnoccupiedToOccupiedThreshold)); +} +EmberAfStatus SetUltrasonicUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, uint8_t ultrasonicUnoccupiedToOccupiedThreshold) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::UltrasonicUnoccupiedToOccupiedThreshold, + (uint8_t *) &ultrasonicUnoccupiedToOccupiedThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalContactOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, + uint16_t * physicalContactOccupiedToUnoccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactOccupiedToUnoccupiedDelay, + (uint8_t *) physicalContactOccupiedToUnoccupiedDelay, + sizeof(*physicalContactOccupiedToUnoccupiedDelay)); +} +EmberAfStatus SetPhysicalContactOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, + uint16_t physicalContactOccupiedToUnoccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactOccupiedToUnoccupiedDelay, + (uint8_t *) &physicalContactOccupiedToUnoccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalContactUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, + uint16_t * physicalContactUnoccupiedToOccupiedDelay) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactUnoccupiedToOccupiedDelay, + (uint8_t *) physicalContactUnoccupiedToOccupiedDelay, + sizeof(*physicalContactUnoccupiedToOccupiedDelay)); +} +EmberAfStatus SetPhysicalContactUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, + uint16_t physicalContactUnoccupiedToOccupiedDelay) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactUnoccupiedToOccupiedDelay, + (uint8_t *) &physicalContactUnoccupiedToOccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhysicalContactUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t * physicalContactUnoccupiedToOccupiedThreshold) +{ + return emberAfReadServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactUnoccupiedToOccupiedThreshold, + (uint8_t *) physicalContactUnoccupiedToOccupiedThreshold, + sizeof(*physicalContactUnoccupiedToOccupiedThreshold)); +} +EmberAfStatus SetPhysicalContactUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t physicalContactUnoccupiedToOccupiedThreshold) +{ + return emberAfWriteServerAttribute(endpoint, OccupancySensing::Id, Ids::PhysicalContactUnoccupiedToOccupiedThreshold, + (uint8_t *) &physicalContactUnoccupiedToOccupiedThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace OccupancySensing + +namespace CarbonMonoxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, CarbonMonoxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace CarbonMonoxideConcentrationMeasurement + +namespace CarbonDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, CarbonDioxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace CarbonDioxideConcentrationMeasurement + +namespace EthyleneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace EthyleneConcentrationMeasurement + +namespace EthyleneOxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, EthyleneOxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace EthyleneOxideConcentrationMeasurement + +namespace HydrogenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace HydrogenConcentrationMeasurement + +namespace HydrogenSulphideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, HydrogenSulphideConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace HydrogenSulphideConcentrationMeasurement + +namespace NitricOxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, NitricOxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace NitricOxideConcentrationMeasurement + +namespace NitrogenDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, NitrogenDioxideConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace NitrogenDioxideConcentrationMeasurement + +namespace OxygenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, OxygenConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace OxygenConcentrationMeasurement + +namespace OzoneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, OzoneConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace OzoneConcentrationMeasurement + +namespace SulfurDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, SulfurDioxideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SulfurDioxideConcentrationMeasurement + +namespace DissolvedOxygenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, DissolvedOxygenConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace DissolvedOxygenConcentrationMeasurement + +namespace BromateConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, BromateConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BromateConcentrationMeasurement + +namespace ChloraminesConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, ChloraminesConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ChloraminesConcentrationMeasurement + +namespace ChlorineConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, ChlorineConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ChlorineConcentrationMeasurement + +namespace FecalColiformAndEColiConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, FecalColiformAndEColiConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace FecalColiformAndEColiConcentrationMeasurement + +namespace FluorideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, FluorideConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace FluorideConcentrationMeasurement + +namespace HaloaceticAcidsConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, HaloaceticAcidsConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace HaloaceticAcidsConcentrationMeasurement + +namespace TotalTrihalomethanesConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, TotalTrihalomethanesConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TotalTrihalomethanesConcentrationMeasurement + +namespace TotalColiformBacteriaConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, TotalColiformBacteriaConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TotalColiformBacteriaConcentrationMeasurement + +namespace TurbidityConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, TurbidityConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TurbidityConcentrationMeasurement + +namespace CopperConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, CopperConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace CopperConcentrationMeasurement + +namespace LeadConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, LeadConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace LeadConcentrationMeasurement + +namespace ManganeseConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, ManganeseConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ManganeseConcentrationMeasurement + +namespace SulfateConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, SulfateConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SulfateConcentrationMeasurement + +namespace BromodichloromethaneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, BromodichloromethaneConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BromodichloromethaneConcentrationMeasurement + +namespace BromoformConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, BromoformConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace BromoformConcentrationMeasurement + +namespace ChlorodibromomethaneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) tolerance, sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, ChlorodibromomethaneConcentrationMeasurement::Id, Ids::Tolerance, + (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ChlorodibromomethaneConcentrationMeasurement + +namespace ChloroformConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) measuredValue, sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MeasuredValue, + (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, ChloroformConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ChloroformConcentrationMeasurement + +namespace SodiumConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue) +{ + return emberAfReadServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) measuredValue, + sizeof(*measuredValue)); +} +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MeasuredValue, (uint8_t *) &measuredValue, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); +} +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MinMeasuredValue, + (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue) +{ + return emberAfReadServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); +} +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue) +{ + return emberAfWriteServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::MaxMeasuredValue, + (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance) +{ + return emberAfReadServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) tolerance, + sizeof(*tolerance)); +} +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance) +{ + return emberAfWriteServerAttribute(endpoint, SodiumConcentrationMeasurement::Id, Ids::Tolerance, (uint8_t *) &tolerance, + ZCL_SINGLE_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SodiumConcentrationMeasurement + +namespace IasZone { +namespace Attributes { +EmberAfStatus GetZoneState(chip::EndpointId endpoint, uint8_t * zoneState) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::ZoneState, (uint8_t *) zoneState, sizeof(*zoneState)); +} +EmberAfStatus SetZoneState(chip::EndpointId endpoint, uint8_t zoneState) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::ZoneState, (uint8_t *) &zoneState, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetZoneType(chip::EndpointId endpoint, uint16_t * zoneType) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::ZoneType, (uint8_t *) zoneType, sizeof(*zoneType)); +} +EmberAfStatus SetZoneType(chip::EndpointId endpoint, uint16_t zoneType) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::ZoneType, (uint8_t *) &zoneType, ZCL_ENUM16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetZoneStatus(chip::EndpointId endpoint, uint16_t * zoneStatus) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::ZoneStatus, (uint8_t *) zoneStatus, sizeof(*zoneStatus)); +} +EmberAfStatus SetZoneStatus(chip::EndpointId endpoint, uint16_t zoneStatus) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::ZoneStatus, (uint8_t *) &zoneStatus, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetIasCieAddress(chip::EndpointId endpoint, chip::NodeId * iasCieAddress) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::IasCieAddress, (uint8_t *) iasCieAddress, sizeof(*iasCieAddress)); +} +EmberAfStatus SetIasCieAddress(chip::EndpointId endpoint, chip::NodeId iasCieAddress) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::IasCieAddress, (uint8_t *) &iasCieAddress, + ZCL_NODE_ID_ATTRIBUTE_TYPE); +} +EmberAfStatus GetZoneId(chip::EndpointId endpoint, uint8_t * zoneId) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::ZoneId, (uint8_t *) zoneId, sizeof(*zoneId)); +} +EmberAfStatus SetZoneId(chip::EndpointId endpoint, uint8_t zoneId) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::ZoneId, (uint8_t *) &zoneId, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNumberOfZoneSensitivityLevelsSupported(chip::EndpointId endpoint, uint8_t * numberOfZoneSensitivityLevelsSupported) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::NumberOfZoneSensitivityLevelsSupported, + (uint8_t *) numberOfZoneSensitivityLevelsSupported, + sizeof(*numberOfZoneSensitivityLevelsSupported)); +} +EmberAfStatus SetNumberOfZoneSensitivityLevelsSupported(chip::EndpointId endpoint, uint8_t numberOfZoneSensitivityLevelsSupported) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::NumberOfZoneSensitivityLevelsSupported, + (uint8_t *) &numberOfZoneSensitivityLevelsSupported, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentZoneSensitivityLevel(chip::EndpointId endpoint, uint8_t * currentZoneSensitivityLevel) +{ + return emberAfReadServerAttribute(endpoint, IasZone::Id, Ids::CurrentZoneSensitivityLevel, + (uint8_t *) currentZoneSensitivityLevel, sizeof(*currentZoneSensitivityLevel)); +} +EmberAfStatus SetCurrentZoneSensitivityLevel(chip::EndpointId endpoint, uint8_t currentZoneSensitivityLevel) +{ + return emberAfWriteServerAttribute(endpoint, IasZone::Id, Ids::CurrentZoneSensitivityLevel, + (uint8_t *) ¤tZoneSensitivityLevel, ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace IasZone + +namespace IasWd { +namespace Attributes { +EmberAfStatus GetMaxDuration(chip::EndpointId endpoint, uint16_t * maxDuration) +{ + return emberAfReadServerAttribute(endpoint, IasWd::Id, Ids::MaxDuration, (uint8_t *) maxDuration, sizeof(*maxDuration)); +} +EmberAfStatus SetMaxDuration(chip::EndpointId endpoint, uint16_t maxDuration) +{ + return emberAfWriteServerAttribute(endpoint, IasWd::Id, Ids::MaxDuration, (uint8_t *) &maxDuration, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace IasWd + +namespace WakeOnLan { +namespace Attributes { +} // namespace Attributes +} // namespace WakeOnLan + +namespace TvChannel { +namespace Attributes { +} // namespace Attributes +} // namespace TvChannel + +namespace TargetNavigator { +namespace Attributes { +EmberAfStatus GetCurrentNavigatorTarget(chip::EndpointId endpoint, uint8_t * currentNavigatorTarget) +{ + return emberAfReadServerAttribute(endpoint, TargetNavigator::Id, Ids::CurrentNavigatorTarget, + (uint8_t *) currentNavigatorTarget, sizeof(*currentNavigatorTarget)); +} +EmberAfStatus SetCurrentNavigatorTarget(chip::EndpointId endpoint, uint8_t currentNavigatorTarget) +{ + return emberAfWriteServerAttribute(endpoint, TargetNavigator::Id, Ids::CurrentNavigatorTarget, + (uint8_t *) ¤tNavigatorTarget, ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TargetNavigator + +namespace MediaPlayback { +namespace Attributes { +EmberAfStatus GetPlaybackState(chip::EndpointId endpoint, uint8_t * playbackState) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::PlaybackState, (uint8_t *) playbackState, + sizeof(*playbackState)); +} +EmberAfStatus SetPlaybackState(chip::EndpointId endpoint, uint8_t playbackState) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::PlaybackState, (uint8_t *) &playbackState, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetStartTime(chip::EndpointId endpoint, uint64_t * startTime) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::StartTime, (uint8_t *) startTime, sizeof(*startTime)); +} +EmberAfStatus SetStartTime(chip::EndpointId endpoint, uint64_t startTime) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::StartTime, (uint8_t *) &startTime, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDuration(chip::EndpointId endpoint, uint64_t * duration) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::Duration, (uint8_t *) duration, sizeof(*duration)); +} +EmberAfStatus SetDuration(chip::EndpointId endpoint, uint64_t duration) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::Duration, (uint8_t *) &duration, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUpdatedAt(chip::EndpointId endpoint, uint64_t * updatedAt) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::UpdatedAt, (uint8_t *) updatedAt, sizeof(*updatedAt)); +} +EmberAfStatus SetUpdatedAt(chip::EndpointId endpoint, uint64_t updatedAt) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::UpdatedAt, (uint8_t *) &updatedAt, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPosistion(chip::EndpointId endpoint, uint64_t * posistion) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::Posistion, (uint8_t *) posistion, sizeof(*posistion)); +} +EmberAfStatus SetPosistion(chip::EndpointId endpoint, uint64_t posistion) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::Posistion, (uint8_t *) &posistion, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPlaybackSpeed(chip::EndpointId endpoint, uint64_t * playbackSpeed) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::PlaybackSpeed, (uint8_t *) playbackSpeed, + sizeof(*playbackSpeed)); +} +EmberAfStatus SetPlaybackSpeed(chip::EndpointId endpoint, uint64_t playbackSpeed) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::PlaybackSpeed, (uint8_t *) &playbackSpeed, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSeekRangeEnd(chip::EndpointId endpoint, uint64_t * seekRangeEnd) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::SeekRangeEnd, (uint8_t *) seekRangeEnd, + sizeof(*seekRangeEnd)); +} +EmberAfStatus SetSeekRangeEnd(chip::EndpointId endpoint, uint64_t seekRangeEnd) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::SeekRangeEnd, (uint8_t *) &seekRangeEnd, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetSeekRangeStart(chip::EndpointId endpoint, uint64_t * seekRangeStart) +{ + return emberAfReadServerAttribute(endpoint, MediaPlayback::Id, Ids::SeekRangeStart, (uint8_t *) seekRangeStart, + sizeof(*seekRangeStart)); +} +EmberAfStatus SetSeekRangeStart(chip::EndpointId endpoint, uint64_t seekRangeStart) +{ + return emberAfWriteServerAttribute(endpoint, MediaPlayback::Id, Ids::SeekRangeStart, (uint8_t *) &seekRangeStart, + ZCL_INT64U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace MediaPlayback + +namespace MediaInput { +namespace Attributes { +EmberAfStatus GetCurrentMediaInput(chip::EndpointId endpoint, uint8_t * currentMediaInput) +{ + return emberAfReadServerAttribute(endpoint, MediaInput::Id, Ids::CurrentMediaInput, (uint8_t *) currentMediaInput, + sizeof(*currentMediaInput)); +} +EmberAfStatus SetCurrentMediaInput(chip::EndpointId endpoint, uint8_t currentMediaInput) +{ + return emberAfWriteServerAttribute(endpoint, MediaInput::Id, Ids::CurrentMediaInput, (uint8_t *) ¤tMediaInput, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace MediaInput + +namespace ContentLauncher { +namespace Attributes { +} // namespace Attributes +} // namespace ContentLauncher + +namespace AudioOutput { +namespace Attributes { +EmberAfStatus GetCurrentAudioOutput(chip::EndpointId endpoint, uint8_t * currentAudioOutput) +{ + return emberAfReadServerAttribute(endpoint, AudioOutput::Id, Ids::CurrentAudioOutput, (uint8_t *) currentAudioOutput, + sizeof(*currentAudioOutput)); +} +EmberAfStatus SetCurrentAudioOutput(chip::EndpointId endpoint, uint8_t currentAudioOutput) +{ + return emberAfWriteServerAttribute(endpoint, AudioOutput::Id, Ids::CurrentAudioOutput, (uint8_t *) ¤tAudioOutput, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace AudioOutput + +namespace ApplicationLauncher { +namespace Attributes { +EmberAfStatus GetCatalogVendorId(chip::EndpointId endpoint, uint8_t * catalogVendorId) +{ + return emberAfReadServerAttribute(endpoint, ApplicationLauncher::Id, Ids::CatalogVendorId, (uint8_t *) catalogVendorId, + sizeof(*catalogVendorId)); +} +EmberAfStatus SetCatalogVendorId(chip::EndpointId endpoint, uint8_t catalogVendorId) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationLauncher::Id, Ids::CatalogVendorId, (uint8_t *) &catalogVendorId, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApplicationId(chip::EndpointId endpoint, uint8_t * applicationId) +{ + return emberAfReadServerAttribute(endpoint, ApplicationLauncher::Id, Ids::ApplicationId, (uint8_t *) applicationId, + sizeof(*applicationId)); +} +EmberAfStatus SetApplicationId(chip::EndpointId endpoint, uint8_t applicationId) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationLauncher::Id, Ids::ApplicationId, (uint8_t *) &applicationId, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ApplicationLauncher + +namespace ApplicationBasic { +namespace Attributes { +EmberAfStatus GetVendorId(chip::EndpointId endpoint, uint16_t * vendorId) +{ + return emberAfReadServerAttribute(endpoint, ApplicationBasic::Id, Ids::VendorId, (uint8_t *) vendorId, sizeof(*vendorId)); +} +EmberAfStatus SetVendorId(chip::EndpointId endpoint, uint16_t vendorId) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationBasic::Id, Ids::VendorId, (uint8_t *) &vendorId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetProductId(chip::EndpointId endpoint, uint16_t * productId) +{ + return emberAfReadServerAttribute(endpoint, ApplicationBasic::Id, Ids::ProductId, (uint8_t *) productId, sizeof(*productId)); +} +EmberAfStatus SetProductId(chip::EndpointId endpoint, uint16_t productId) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationBasic::Id, Ids::ProductId, (uint8_t *) &productId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCatalogVendorId(chip::EndpointId endpoint, uint16_t * catalogVendorId) +{ + return emberAfReadServerAttribute(endpoint, ApplicationBasic::Id, Ids::CatalogVendorId, (uint8_t *) catalogVendorId, + sizeof(*catalogVendorId)); +} +EmberAfStatus SetCatalogVendorId(chip::EndpointId endpoint, uint16_t catalogVendorId) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationBasic::Id, Ids::CatalogVendorId, (uint8_t *) &catalogVendorId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApplicationStatus(chip::EndpointId endpoint, uint8_t * applicationStatus) +{ + return emberAfReadServerAttribute(endpoint, ApplicationBasic::Id, Ids::ApplicationStatus, (uint8_t *) applicationStatus, + sizeof(*applicationStatus)); +} +EmberAfStatus SetApplicationStatus(chip::EndpointId endpoint, uint8_t applicationStatus) +{ + return emberAfWriteServerAttribute(endpoint, ApplicationBasic::Id, Ids::ApplicationStatus, (uint8_t *) &applicationStatus, + ZCL_ENUM8_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ApplicationBasic + +namespace TestCluster { +namespace Attributes { +EmberAfStatus GetBoolean(chip::EndpointId endpoint, uint8_t * boolean) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Boolean, (uint8_t *) boolean, sizeof(*boolean)); +} +EmberAfStatus SetBoolean(chip::EndpointId endpoint, uint8_t boolean) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Boolean, (uint8_t *) &boolean, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBitmap8(chip::EndpointId endpoint, uint8_t * bitmap8) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap8, (uint8_t *) bitmap8, sizeof(*bitmap8)); +} +EmberAfStatus SetBitmap8(chip::EndpointId endpoint, uint8_t bitmap8) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap8, (uint8_t *) &bitmap8, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBitmap16(chip::EndpointId endpoint, uint16_t * bitmap16) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap16, (uint8_t *) bitmap16, sizeof(*bitmap16)); +} +EmberAfStatus SetBitmap16(chip::EndpointId endpoint, uint16_t bitmap16) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap16, (uint8_t *) &bitmap16, + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBitmap32(chip::EndpointId endpoint, uint32_t * bitmap32) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap32, (uint8_t *) bitmap32, sizeof(*bitmap32)); +} +EmberAfStatus SetBitmap32(chip::EndpointId endpoint, uint32_t bitmap32) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap32, (uint8_t *) &bitmap32, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBitmap64(chip::EndpointId endpoint, uint64_t * bitmap64) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap64, (uint8_t *) bitmap64, sizeof(*bitmap64)); +} +EmberAfStatus SetBitmap64(chip::EndpointId endpoint, uint64_t bitmap64) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Bitmap64, (uint8_t *) &bitmap64, + ZCL_BITMAP64_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt8u(chip::EndpointId endpoint, uint8_t * int8u) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int8u, (uint8_t *) int8u, sizeof(*int8u)); +} +EmberAfStatus SetInt8u(chip::EndpointId endpoint, uint8_t int8u) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int8u, (uint8_t *) &int8u, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt16u(chip::EndpointId endpoint, uint16_t * int16u) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int16u, (uint8_t *) int16u, sizeof(*int16u)); +} +EmberAfStatus SetInt16u(chip::EndpointId endpoint, uint16_t int16u) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int16u, (uint8_t *) &int16u, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt32u(chip::EndpointId endpoint, uint32_t * int32u) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int32u, (uint8_t *) int32u, sizeof(*int32u)); +} +EmberAfStatus SetInt32u(chip::EndpointId endpoint, uint32_t int32u) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int32u, (uint8_t *) &int32u, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt64u(chip::EndpointId endpoint, uint64_t * int64u) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int64u, (uint8_t *) int64u, sizeof(*int64u)); +} +EmberAfStatus SetInt64u(chip::EndpointId endpoint, uint64_t int64u) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int64u, (uint8_t *) &int64u, ZCL_INT64U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt8s(chip::EndpointId endpoint, int8_t * int8s) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int8s, (uint8_t *) int8s, sizeof(*int8s)); +} +EmberAfStatus SetInt8s(chip::EndpointId endpoint, int8_t int8s) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int8s, (uint8_t *) &int8s, ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt16s(chip::EndpointId endpoint, int16_t * int16s) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int16s, (uint8_t *) int16s, sizeof(*int16s)); +} +EmberAfStatus SetInt16s(chip::EndpointId endpoint, int16_t int16s) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int16s, (uint8_t *) &int16s, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt32s(chip::EndpointId endpoint, int32_t * int32s) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int32s, (uint8_t *) int32s, sizeof(*int32s)); +} +EmberAfStatus SetInt32s(chip::EndpointId endpoint, int32_t int32s) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int32s, (uint8_t *) &int32s, ZCL_INT32S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInt64s(chip::EndpointId endpoint, int64_t * int64s) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Int64s, (uint8_t *) int64s, sizeof(*int64s)); +} +EmberAfStatus SetInt64s(chip::EndpointId endpoint, int64_t int64s) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Int64s, (uint8_t *) &int64s, ZCL_INT64S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnum8(chip::EndpointId endpoint, uint8_t * enum8) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Enum8, (uint8_t *) enum8, sizeof(*enum8)); +} +EmberAfStatus SetEnum8(chip::EndpointId endpoint, uint8_t enum8) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Enum8, (uint8_t *) &enum8, ZCL_ENUM8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEnum16(chip::EndpointId endpoint, uint16_t * enum16) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Enum16, (uint8_t *) enum16, sizeof(*enum16)); +} +EmberAfStatus SetEnum16(chip::EndpointId endpoint, uint16_t enum16) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Enum16, (uint8_t *) &enum16, ZCL_ENUM16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetUnsupported(chip::EndpointId endpoint, uint8_t * unsupported) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Unsupported, (uint8_t *) unsupported, sizeof(*unsupported)); +} +EmberAfStatus SetUnsupported(chip::EndpointId endpoint, uint8_t unsupported) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Unsupported, (uint8_t *) &unsupported, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace TestCluster + +namespace ApplianceIdentification { +namespace Attributes { +EmberAfStatus GetCompanyId(chip::EndpointId endpoint, uint16_t * companyId) +{ + return emberAfReadServerAttribute(endpoint, ApplianceIdentification::Id, Ids::CompanyId, (uint8_t *) companyId, + sizeof(*companyId)); +} +EmberAfStatus SetCompanyId(chip::EndpointId endpoint, uint16_t companyId) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceIdentification::Id, Ids::CompanyId, (uint8_t *) &companyId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetBrandId(chip::EndpointId endpoint, uint16_t * brandId) +{ + return emberAfReadServerAttribute(endpoint, ApplianceIdentification::Id, Ids::BrandId, (uint8_t *) brandId, sizeof(*brandId)); +} +EmberAfStatus SetBrandId(chip::EndpointId endpoint, uint16_t brandId) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceIdentification::Id, Ids::BrandId, (uint8_t *) &brandId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetProductTypeId(chip::EndpointId endpoint, uint16_t * productTypeId) +{ + return emberAfReadServerAttribute(endpoint, ApplianceIdentification::Id, Ids::ProductTypeId, (uint8_t *) productTypeId, + sizeof(*productTypeId)); +} +EmberAfStatus SetProductTypeId(chip::EndpointId endpoint, uint16_t productTypeId) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceIdentification::Id, Ids::ProductTypeId, (uint8_t *) &productTypeId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCecedSpecificationVersion(chip::EndpointId endpoint, uint8_t * cecedSpecificationVersion) +{ + return emberAfReadServerAttribute(endpoint, ApplianceIdentification::Id, Ids::CecedSpecificationVersion, + (uint8_t *) cecedSpecificationVersion, sizeof(*cecedSpecificationVersion)); +} +EmberAfStatus SetCecedSpecificationVersion(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceIdentification::Id, Ids::CecedSpecificationVersion, + (uint8_t *) &cecedSpecificationVersion, ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ApplianceIdentification + +namespace MeterIdentification { +namespace Attributes { +EmberAfStatus GetMeterTypeId(chip::EndpointId endpoint, uint16_t * meterTypeId) +{ + return emberAfReadServerAttribute(endpoint, MeterIdentification::Id, Ids::MeterTypeId, (uint8_t *) meterTypeId, + sizeof(*meterTypeId)); +} +EmberAfStatus SetMeterTypeId(chip::EndpointId endpoint, uint16_t meterTypeId) +{ + return emberAfWriteServerAttribute(endpoint, MeterIdentification::Id, Ids::MeterTypeId, (uint8_t *) &meterTypeId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDataQualityId(chip::EndpointId endpoint, uint16_t * dataQualityId) +{ + return emberAfReadServerAttribute(endpoint, MeterIdentification::Id, Ids::DataQualityId, (uint8_t *) dataQualityId, + sizeof(*dataQualityId)); +} +EmberAfStatus SetDataQualityId(chip::EndpointId endpoint, uint16_t dataQualityId) +{ + return emberAfWriteServerAttribute(endpoint, MeterIdentification::Id, Ids::DataQualityId, (uint8_t *) &dataQualityId, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace MeterIdentification + +namespace ApplianceStatistics { +namespace Attributes { +EmberAfStatus GetLogMaxSize(chip::EndpointId endpoint, uint32_t * logMaxSize) +{ + return emberAfReadServerAttribute(endpoint, ApplianceStatistics::Id, Ids::LogMaxSize, (uint8_t *) logMaxSize, + sizeof(*logMaxSize)); +} +EmberAfStatus SetLogMaxSize(chip::EndpointId endpoint, uint32_t logMaxSize) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceStatistics::Id, Ids::LogMaxSize, (uint8_t *) &logMaxSize, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLogQueueMaxSize(chip::EndpointId endpoint, uint8_t * logQueueMaxSize) +{ + return emberAfReadServerAttribute(endpoint, ApplianceStatistics::Id, Ids::LogQueueMaxSize, (uint8_t *) logQueueMaxSize, + sizeof(*logQueueMaxSize)); +} +EmberAfStatus SetLogQueueMaxSize(chip::EndpointId endpoint, uint8_t logQueueMaxSize) +{ + return emberAfWriteServerAttribute(endpoint, ApplianceStatistics::Id, Ids::LogQueueMaxSize, (uint8_t *) &logQueueMaxSize, + ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ApplianceStatistics + +namespace ElectricalMeasurement { +namespace Attributes { +EmberAfStatus GetMeasurementType(chip::EndpointId endpoint, uint32_t * measurementType) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasurementType, (uint8_t *) measurementType, + sizeof(*measurementType)); +} +EmberAfStatus SetMeasurementType(chip::EndpointId endpoint, uint32_t measurementType) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasurementType, (uint8_t *) &measurementType, + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcVoltage(chip::EndpointId endpoint, int16_t * dcVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltage, (uint8_t *) dcVoltage, + sizeof(*dcVoltage)); +} +EmberAfStatus SetDcVoltage(chip::EndpointId endpoint, int16_t dcVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltage, (uint8_t *) &dcVoltage, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcVoltageMin(chip::EndpointId endpoint, int16_t * dcVoltageMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMin, (uint8_t *) dcVoltageMin, + sizeof(*dcVoltageMin)); +} +EmberAfStatus SetDcVoltageMin(chip::EndpointId endpoint, int16_t dcVoltageMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMin, (uint8_t *) &dcVoltageMin, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcVoltageMax(chip::EndpointId endpoint, int16_t * dcVoltageMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMax, (uint8_t *) dcVoltageMax, + sizeof(*dcVoltageMax)); +} +EmberAfStatus SetDcVoltageMax(chip::EndpointId endpoint, int16_t dcVoltageMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMax, (uint8_t *) &dcVoltageMax, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcCurrent(chip::EndpointId endpoint, int16_t * dcCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrent, (uint8_t *) dcCurrent, + sizeof(*dcCurrent)); +} +EmberAfStatus SetDcCurrent(chip::EndpointId endpoint, int16_t dcCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrent, (uint8_t *) &dcCurrent, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcCurrentMin(chip::EndpointId endpoint, int16_t * dcCurrentMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMin, (uint8_t *) dcCurrentMin, + sizeof(*dcCurrentMin)); +} +EmberAfStatus SetDcCurrentMin(chip::EndpointId endpoint, int16_t dcCurrentMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMin, (uint8_t *) &dcCurrentMin, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcCurrentMax(chip::EndpointId endpoint, int16_t * dcCurrentMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMax, (uint8_t *) dcCurrentMax, + sizeof(*dcCurrentMax)); +} +EmberAfStatus SetDcCurrentMax(chip::EndpointId endpoint, int16_t dcCurrentMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMax, (uint8_t *) &dcCurrentMax, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcPower(chip::EndpointId endpoint, int16_t * dcPower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPower, (uint8_t *) dcPower, sizeof(*dcPower)); +} +EmberAfStatus SetDcPower(chip::EndpointId endpoint, int16_t dcPower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPower, (uint8_t *) &dcPower, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcPowerMin(chip::EndpointId endpoint, int16_t * dcPowerMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMin, (uint8_t *) dcPowerMin, + sizeof(*dcPowerMin)); +} +EmberAfStatus SetDcPowerMin(chip::EndpointId endpoint, int16_t dcPowerMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMin, (uint8_t *) &dcPowerMin, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcPowerMax(chip::EndpointId endpoint, int16_t * dcPowerMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMax, (uint8_t *) dcPowerMax, + sizeof(*dcPowerMax)); +} +EmberAfStatus SetDcPowerMax(chip::EndpointId endpoint, int16_t dcPowerMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMax, (uint8_t *) &dcPowerMax, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcVoltageMultiplier(chip::EndpointId endpoint, uint16_t * dcVoltageMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMultiplier, + (uint8_t *) dcVoltageMultiplier, sizeof(*dcVoltageMultiplier)); +} +EmberAfStatus SetDcVoltageMultiplier(chip::EndpointId endpoint, uint16_t dcVoltageMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageMultiplier, + (uint8_t *) &dcVoltageMultiplier, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcVoltageDivisor(chip::EndpointId endpoint, uint16_t * dcVoltageDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageDivisor, (uint8_t *) dcVoltageDivisor, + sizeof(*dcVoltageDivisor)); +} +EmberAfStatus SetDcVoltageDivisor(chip::EndpointId endpoint, uint16_t dcVoltageDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcVoltageDivisor, (uint8_t *) &dcVoltageDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcCurrentMultiplier(chip::EndpointId endpoint, uint16_t * dcCurrentMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMultiplier, + (uint8_t *) dcCurrentMultiplier, sizeof(*dcCurrentMultiplier)); +} +EmberAfStatus SetDcCurrentMultiplier(chip::EndpointId endpoint, uint16_t dcCurrentMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentMultiplier, + (uint8_t *) &dcCurrentMultiplier, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcCurrentDivisor(chip::EndpointId endpoint, uint16_t * dcCurrentDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentDivisor, (uint8_t *) dcCurrentDivisor, + sizeof(*dcCurrentDivisor)); +} +EmberAfStatus SetDcCurrentDivisor(chip::EndpointId endpoint, uint16_t dcCurrentDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcCurrentDivisor, (uint8_t *) &dcCurrentDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcPowerMultiplier(chip::EndpointId endpoint, uint16_t * dcPowerMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMultiplier, (uint8_t *) dcPowerMultiplier, + sizeof(*dcPowerMultiplier)); +} +EmberAfStatus SetDcPowerMultiplier(chip::EndpointId endpoint, uint16_t dcPowerMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerMultiplier, (uint8_t *) &dcPowerMultiplier, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetDcPowerDivisor(chip::EndpointId endpoint, uint16_t * dcPowerDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerDivisor, (uint8_t *) dcPowerDivisor, + sizeof(*dcPowerDivisor)); +} +EmberAfStatus SetDcPowerDivisor(chip::EndpointId endpoint, uint16_t dcPowerDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::DcPowerDivisor, (uint8_t *) &dcPowerDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcFrequency(chip::EndpointId endpoint, uint16_t * acFrequency) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequency, (uint8_t *) acFrequency, + sizeof(*acFrequency)); +} +EmberAfStatus SetAcFrequency(chip::EndpointId endpoint, uint16_t acFrequency) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequency, (uint8_t *) &acFrequency, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcFrequencyMin(chip::EndpointId endpoint, uint16_t * acFrequencyMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMin, (uint8_t *) acFrequencyMin, + sizeof(*acFrequencyMin)); +} +EmberAfStatus SetAcFrequencyMin(chip::EndpointId endpoint, uint16_t acFrequencyMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMin, (uint8_t *) &acFrequencyMin, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcFrequencyMax(chip::EndpointId endpoint, uint16_t * acFrequencyMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMax, (uint8_t *) acFrequencyMax, + sizeof(*acFrequencyMax)); +} +EmberAfStatus SetAcFrequencyMax(chip::EndpointId endpoint, uint16_t acFrequencyMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMax, (uint8_t *) &acFrequencyMax, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetNeutralCurrent(chip::EndpointId endpoint, uint16_t * neutralCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::NeutralCurrent, (uint8_t *) neutralCurrent, + sizeof(*neutralCurrent)); +} +EmberAfStatus SetNeutralCurrent(chip::EndpointId endpoint, uint16_t neutralCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::NeutralCurrent, (uint8_t *) &neutralCurrent, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTotalActivePower(chip::EndpointId endpoint, int32_t * totalActivePower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalActivePower, (uint8_t *) totalActivePower, + sizeof(*totalActivePower)); +} +EmberAfStatus SetTotalActivePower(chip::EndpointId endpoint, int32_t totalActivePower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalActivePower, (uint8_t *) &totalActivePower, + ZCL_INT32S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTotalReactivePower(chip::EndpointId endpoint, int32_t * totalReactivePower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalReactivePower, (uint8_t *) totalReactivePower, + sizeof(*totalReactivePower)); +} +EmberAfStatus SetTotalReactivePower(chip::EndpointId endpoint, int32_t totalReactivePower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalReactivePower, + (uint8_t *) &totalReactivePower, ZCL_INT32S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetTotalApparentPower(chip::EndpointId endpoint, uint32_t * totalApparentPower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalApparentPower, (uint8_t *) totalApparentPower, + sizeof(*totalApparentPower)); +} +EmberAfStatus SetTotalApparentPower(chip::EndpointId endpoint, uint32_t totalApparentPower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::TotalApparentPower, + (uint8_t *) &totalApparentPower, ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured1stHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured1stHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured1stHarmonicCurrent, + (uint8_t *) measured1stHarmonicCurrent, sizeof(*measured1stHarmonicCurrent)); +} +EmberAfStatus SetMeasured1stHarmonicCurrent(chip::EndpointId endpoint, int16_t measured1stHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured1stHarmonicCurrent, + (uint8_t *) &measured1stHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured3rdHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured3rdHarmonicCurrent, + (uint8_t *) measured3rdHarmonicCurrent, sizeof(*measured3rdHarmonicCurrent)); +} +EmberAfStatus SetMeasured3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t measured3rdHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured3rdHarmonicCurrent, + (uint8_t *) &measured3rdHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured5thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured5thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured5thHarmonicCurrent, + (uint8_t *) measured5thHarmonicCurrent, sizeof(*measured5thHarmonicCurrent)); +} +EmberAfStatus SetMeasured5thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured5thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured5thHarmonicCurrent, + (uint8_t *) &measured5thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured7thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured7thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured7thHarmonicCurrent, + (uint8_t *) measured7thHarmonicCurrent, sizeof(*measured7thHarmonicCurrent)); +} +EmberAfStatus SetMeasured7thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured7thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured7thHarmonicCurrent, + (uint8_t *) &measured7thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured9thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured9thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured9thHarmonicCurrent, + (uint8_t *) measured9thHarmonicCurrent, sizeof(*measured9thHarmonicCurrent)); +} +EmberAfStatus SetMeasured9thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured9thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured9thHarmonicCurrent, + (uint8_t *) &measured9thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasured11thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured11thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured11thHarmonicCurrent, + (uint8_t *) measured11thHarmonicCurrent, sizeof(*measured11thHarmonicCurrent)); +} +EmberAfStatus SetMeasured11thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured11thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::Measured11thHarmonicCurrent, + (uint8_t *) &measured11thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase1stHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase1stHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase1stHarmonicCurrent, + (uint8_t *) measuredPhase1stHarmonicCurrent, sizeof(*measuredPhase1stHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase1stHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase1stHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase1stHarmonicCurrent, + (uint8_t *) &measuredPhase1stHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase3rdHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase3rdHarmonicCurrent, + (uint8_t *) measuredPhase3rdHarmonicCurrent, sizeof(*measuredPhase3rdHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase3rdHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase3rdHarmonicCurrent, + (uint8_t *) &measuredPhase3rdHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase5thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase5thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase5thHarmonicCurrent, + (uint8_t *) measuredPhase5thHarmonicCurrent, sizeof(*measuredPhase5thHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase5thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase5thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase5thHarmonicCurrent, + (uint8_t *) &measuredPhase5thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase7thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase7thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase7thHarmonicCurrent, + (uint8_t *) measuredPhase7thHarmonicCurrent, sizeof(*measuredPhase7thHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase7thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase7thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase7thHarmonicCurrent, + (uint8_t *) &measuredPhase7thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase9thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase9thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase9thHarmonicCurrent, + (uint8_t *) measuredPhase9thHarmonicCurrent, sizeof(*measuredPhase9thHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase9thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase9thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase9thHarmonicCurrent, + (uint8_t *) &measuredPhase9thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetMeasuredPhase11thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase11thHarmonicCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase11thHarmonicCurrent, + (uint8_t *) measuredPhase11thHarmonicCurrent, sizeof(*measuredPhase11thHarmonicCurrent)); +} +EmberAfStatus SetMeasuredPhase11thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase11thHarmonicCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::MeasuredPhase11thHarmonicCurrent, + (uint8_t *) &measuredPhase11thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcFrequencyMultiplier(chip::EndpointId endpoint, uint16_t * acFrequencyMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMultiplier, + (uint8_t *) acFrequencyMultiplier, sizeof(*acFrequencyMultiplier)); +} +EmberAfStatus SetAcFrequencyMultiplier(chip::EndpointId endpoint, uint16_t acFrequencyMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyMultiplier, + (uint8_t *) &acFrequencyMultiplier, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcFrequencyDivisor(chip::EndpointId endpoint, uint16_t * acFrequencyDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyDivisor, (uint8_t *) acFrequencyDivisor, + sizeof(*acFrequencyDivisor)); +} +EmberAfStatus SetAcFrequencyDivisor(chip::EndpointId endpoint, uint16_t acFrequencyDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcFrequencyDivisor, + (uint8_t *) &acFrequencyDivisor, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerMultiplier(chip::EndpointId endpoint, uint32_t * powerMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerMultiplier, (uint8_t *) powerMultiplier, + sizeof(*powerMultiplier)); +} +EmberAfStatus SetPowerMultiplier(chip::EndpointId endpoint, uint32_t powerMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerMultiplier, (uint8_t *) &powerMultiplier, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerDivisor(chip::EndpointId endpoint, uint32_t * powerDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerDivisor, (uint8_t *) powerDivisor, + sizeof(*powerDivisor)); +} +EmberAfStatus SetPowerDivisor(chip::EndpointId endpoint, uint32_t powerDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerDivisor, (uint8_t *) &powerDivisor, + ZCL_INT32U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t * harmonicCurrentMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::HarmonicCurrentMultiplier, + (uint8_t *) harmonicCurrentMultiplier, sizeof(*harmonicCurrentMultiplier)); +} +EmberAfStatus SetHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t harmonicCurrentMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::HarmonicCurrentMultiplier, + (uint8_t *) &harmonicCurrentMultiplier, ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPhaseHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t * phaseHarmonicCurrentMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PhaseHarmonicCurrentMultiplier, + (uint8_t *) phaseHarmonicCurrentMultiplier, sizeof(*phaseHarmonicCurrentMultiplier)); +} +EmberAfStatus SetPhaseHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t phaseHarmonicCurrentMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PhaseHarmonicCurrentMultiplier, + (uint8_t *) &phaseHarmonicCurrentMultiplier, ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstantaneousVoltage(chip::EndpointId endpoint, int16_t * instantaneousVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousVoltage, + (uint8_t *) instantaneousVoltage, sizeof(*instantaneousVoltage)); +} +EmberAfStatus SetInstantaneousVoltage(chip::EndpointId endpoint, int16_t instantaneousVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousVoltage, + (uint8_t *) &instantaneousVoltage, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstantaneousLineCurrent(chip::EndpointId endpoint, uint16_t * instantaneousLineCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousLineCurrent, + (uint8_t *) instantaneousLineCurrent, sizeof(*instantaneousLineCurrent)); +} +EmberAfStatus SetInstantaneousLineCurrent(chip::EndpointId endpoint, uint16_t instantaneousLineCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousLineCurrent, + (uint8_t *) &instantaneousLineCurrent, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstantaneousActiveCurrent(chip::EndpointId endpoint, int16_t * instantaneousActiveCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousActiveCurrent, + (uint8_t *) instantaneousActiveCurrent, sizeof(*instantaneousActiveCurrent)); +} +EmberAfStatus SetInstantaneousActiveCurrent(chip::EndpointId endpoint, int16_t instantaneousActiveCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousActiveCurrent, + (uint8_t *) &instantaneousActiveCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstantaneousReactiveCurrent(chip::EndpointId endpoint, int16_t * instantaneousReactiveCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousReactiveCurrent, + (uint8_t *) instantaneousReactiveCurrent, sizeof(*instantaneousReactiveCurrent)); +} +EmberAfStatus SetInstantaneousReactiveCurrent(chip::EndpointId endpoint, int16_t instantaneousReactiveCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousReactiveCurrent, + (uint8_t *) &instantaneousReactiveCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetInstantaneousPower(chip::EndpointId endpoint, int16_t * instantaneousPower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousPower, (uint8_t *) instantaneousPower, + sizeof(*instantaneousPower)); +} +EmberAfStatus SetInstantaneousPower(chip::EndpointId endpoint, int16_t instantaneousPower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::InstantaneousPower, + (uint8_t *) &instantaneousPower, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltage(chip::EndpointId endpoint, uint16_t * rmsVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltage, (uint8_t *) rmsVoltage, + sizeof(*rmsVoltage)); +} +EmberAfStatus SetRmsVoltage(chip::EndpointId endpoint, uint16_t rmsVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltage, (uint8_t *) &rmsVoltage, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMin(chip::EndpointId endpoint, uint16_t * rmsVoltageMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMin, (uint8_t *) rmsVoltageMin, + sizeof(*rmsVoltageMin)); +} +EmberAfStatus SetRmsVoltageMin(chip::EndpointId endpoint, uint16_t rmsVoltageMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMin, (uint8_t *) &rmsVoltageMin, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMax(chip::EndpointId endpoint, uint16_t * rmsVoltageMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMax, (uint8_t *) rmsVoltageMax, + sizeof(*rmsVoltageMax)); +} +EmberAfStatus SetRmsVoltageMax(chip::EndpointId endpoint, uint16_t rmsVoltageMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMax, (uint8_t *) &rmsVoltageMax, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrent(chip::EndpointId endpoint, uint16_t * rmsCurrent) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrent, (uint8_t *) rmsCurrent, + sizeof(*rmsCurrent)); +} +EmberAfStatus SetRmsCurrent(chip::EndpointId endpoint, uint16_t rmsCurrent) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrent, (uint8_t *) &rmsCurrent, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMin(chip::EndpointId endpoint, uint16_t * rmsCurrentMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMin, (uint8_t *) rmsCurrentMin, + sizeof(*rmsCurrentMin)); +} +EmberAfStatus SetRmsCurrentMin(chip::EndpointId endpoint, uint16_t rmsCurrentMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMin, (uint8_t *) &rmsCurrentMin, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMax(chip::EndpointId endpoint, uint16_t * rmsCurrentMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMax, (uint8_t *) rmsCurrentMax, + sizeof(*rmsCurrentMax)); +} +EmberAfStatus SetRmsCurrentMax(chip::EndpointId endpoint, uint16_t rmsCurrentMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMax, (uint8_t *) &rmsCurrentMax, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePower(chip::EndpointId endpoint, int16_t * activePower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePower, (uint8_t *) activePower, + sizeof(*activePower)); +} +EmberAfStatus SetActivePower(chip::EndpointId endpoint, int16_t activePower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePower, (uint8_t *) &activePower, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMin(chip::EndpointId endpoint, int16_t * activePowerMin) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMin, (uint8_t *) activePowerMin, + sizeof(*activePowerMin)); +} +EmberAfStatus SetActivePowerMin(chip::EndpointId endpoint, int16_t activePowerMin) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMin, (uint8_t *) &activePowerMin, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMax(chip::EndpointId endpoint, int16_t * activePowerMax) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMax, (uint8_t *) activePowerMax, + sizeof(*activePowerMax)); +} +EmberAfStatus SetActivePowerMax(chip::EndpointId endpoint, int16_t activePowerMax) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMax, (uint8_t *) &activePowerMax, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReactivePower(chip::EndpointId endpoint, int16_t * reactivePower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePower, (uint8_t *) reactivePower, + sizeof(*reactivePower)); +} +EmberAfStatus SetReactivePower(chip::EndpointId endpoint, int16_t reactivePower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePower, (uint8_t *) &reactivePower, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApparentPower(chip::EndpointId endpoint, uint16_t * apparentPower) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPower, (uint8_t *) apparentPower, + sizeof(*apparentPower)); +} +EmberAfStatus SetApparentPower(chip::EndpointId endpoint, uint16_t apparentPower) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPower, (uint8_t *) &apparentPower, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerFactor(chip::EndpointId endpoint, int8_t * powerFactor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactor, (uint8_t *) powerFactor, + sizeof(*powerFactor)); +} +EmberAfStatus SetPowerFactor(chip::EndpointId endpoint, int8_t powerFactor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactor, (uint8_t *) &powerFactor, + ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsVoltageMeasurementPeriod(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriod) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriod, + (uint8_t *) averageRmsVoltageMeasurementPeriod, sizeof(*averageRmsVoltageMeasurementPeriod)); +} +EmberAfStatus SetAverageRmsVoltageMeasurementPeriod(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriod) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriod, + (uint8_t *) &averageRmsVoltageMeasurementPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsUnderVoltageCounter(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounter) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounter, + (uint8_t *) averageRmsUnderVoltageCounter, sizeof(*averageRmsUnderVoltageCounter)); +} +EmberAfStatus SetAverageRmsUnderVoltageCounter(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounter) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounter, + (uint8_t *) &averageRmsUnderVoltageCounter, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeOverVoltagePeriod(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriod) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriod, + (uint8_t *) rmsExtremeOverVoltagePeriod, sizeof(*rmsExtremeOverVoltagePeriod)); +} +EmberAfStatus SetRmsExtremeOverVoltagePeriod(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriod) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriod, + (uint8_t *) &rmsExtremeOverVoltagePeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeUnderVoltagePeriod(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriod) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriod, + (uint8_t *) rmsExtremeUnderVoltagePeriod, sizeof(*rmsExtremeUnderVoltagePeriod)); +} +EmberAfStatus SetRmsExtremeUnderVoltagePeriod(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriod) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriod, + (uint8_t *) &rmsExtremeUnderVoltagePeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSagPeriod(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriod) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriod, + (uint8_t *) rmsVoltageSagPeriod, sizeof(*rmsVoltageSagPeriod)); +} +EmberAfStatus SetRmsVoltageSagPeriod(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriod) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriod, + (uint8_t *) &rmsVoltageSagPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSwellPeriod(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriod) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriod, + (uint8_t *) rmsVoltageSwellPeriod, sizeof(*rmsVoltageSwellPeriod)); +} +EmberAfStatus SetRmsVoltageSwellPeriod(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriod) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriod, + (uint8_t *) &rmsVoltageSwellPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcVoltageMultiplier(chip::EndpointId endpoint, uint16_t * acVoltageMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageMultiplier, + (uint8_t *) acVoltageMultiplier, sizeof(*acVoltageMultiplier)); +} +EmberAfStatus SetAcVoltageMultiplier(chip::EndpointId endpoint, uint16_t acVoltageMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageMultiplier, + (uint8_t *) &acVoltageMultiplier, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcVoltageDivisor(chip::EndpointId endpoint, uint16_t * acVoltageDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageDivisor, (uint8_t *) acVoltageDivisor, + sizeof(*acVoltageDivisor)); +} +EmberAfStatus SetAcVoltageDivisor(chip::EndpointId endpoint, uint16_t acVoltageDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageDivisor, (uint8_t *) &acVoltageDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCurrentMultiplier(chip::EndpointId endpoint, uint16_t * acCurrentMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentMultiplier, + (uint8_t *) acCurrentMultiplier, sizeof(*acCurrentMultiplier)); +} +EmberAfStatus SetAcCurrentMultiplier(chip::EndpointId endpoint, uint16_t acCurrentMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentMultiplier, + (uint8_t *) &acCurrentMultiplier, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCurrentDivisor(chip::EndpointId endpoint, uint16_t * acCurrentDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentDivisor, (uint8_t *) acCurrentDivisor, + sizeof(*acCurrentDivisor)); +} +EmberAfStatus SetAcCurrentDivisor(chip::EndpointId endpoint, uint16_t acCurrentDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentDivisor, (uint8_t *) &acCurrentDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcPowerMultiplier(chip::EndpointId endpoint, uint16_t * acPowerMultiplier) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcPowerMultiplier, (uint8_t *) acPowerMultiplier, + sizeof(*acPowerMultiplier)); +} +EmberAfStatus SetAcPowerMultiplier(chip::EndpointId endpoint, uint16_t acPowerMultiplier) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcPowerMultiplier, (uint8_t *) &acPowerMultiplier, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcPowerDivisor(chip::EndpointId endpoint, uint16_t * acPowerDivisor) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcPowerDivisor, (uint8_t *) acPowerDivisor, + sizeof(*acPowerDivisor)); +} +EmberAfStatus SetAcPowerDivisor(chip::EndpointId endpoint, uint16_t acPowerDivisor) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcPowerDivisor, (uint8_t *) &acPowerDivisor, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetOverloadAlarmsMask(chip::EndpointId endpoint, uint8_t * overloadAlarmsMask) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::OverloadAlarmsMask, (uint8_t *) overloadAlarmsMask, + sizeof(*overloadAlarmsMask)); +} +EmberAfStatus SetOverloadAlarmsMask(chip::EndpointId endpoint, uint8_t overloadAlarmsMask) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::OverloadAlarmsMask, + (uint8_t *) &overloadAlarmsMask, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} +EmberAfStatus GetVoltageOverload(chip::EndpointId endpoint, int16_t * voltageOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::VoltageOverload, (uint8_t *) voltageOverload, + sizeof(*voltageOverload)); +} +EmberAfStatus SetVoltageOverload(chip::EndpointId endpoint, int16_t voltageOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::VoltageOverload, (uint8_t *) &voltageOverload, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetCurrentOverload(chip::EndpointId endpoint, int16_t * currentOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::CurrentOverload, (uint8_t *) currentOverload, + sizeof(*currentOverload)); +} +EmberAfStatus SetCurrentOverload(chip::EndpointId endpoint, int16_t currentOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::CurrentOverload, (uint8_t *) ¤tOverload, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcOverloadAlarmsMask(chip::EndpointId endpoint, uint16_t * acOverloadAlarmsMask) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcOverloadAlarmsMask, + (uint8_t *) acOverloadAlarmsMask, sizeof(*acOverloadAlarmsMask)); +} +EmberAfStatus SetAcOverloadAlarmsMask(chip::EndpointId endpoint, uint16_t acOverloadAlarmsMask) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcOverloadAlarmsMask, + (uint8_t *) &acOverloadAlarmsMask, ZCL_BITMAP16_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcVoltageOverload(chip::EndpointId endpoint, int16_t * acVoltageOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageOverload, (uint8_t *) acVoltageOverload, + sizeof(*acVoltageOverload)); +} +EmberAfStatus SetAcVoltageOverload(chip::EndpointId endpoint, int16_t acVoltageOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcVoltageOverload, (uint8_t *) &acVoltageOverload, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcCurrentOverload(chip::EndpointId endpoint, int16_t * acCurrentOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentOverload, (uint8_t *) acCurrentOverload, + sizeof(*acCurrentOverload)); +} +EmberAfStatus SetAcCurrentOverload(chip::EndpointId endpoint, int16_t acCurrentOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcCurrentOverload, (uint8_t *) &acCurrentOverload, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcActivePowerOverload(chip::EndpointId endpoint, int16_t * acActivePowerOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcActivePowerOverload, + (uint8_t *) acActivePowerOverload, sizeof(*acActivePowerOverload)); +} +EmberAfStatus SetAcActivePowerOverload(chip::EndpointId endpoint, int16_t acActivePowerOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcActivePowerOverload, + (uint8_t *) &acActivePowerOverload, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAcReactivePowerOverload(chip::EndpointId endpoint, int16_t * acReactivePowerOverload) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcReactivePowerOverload, + (uint8_t *) acReactivePowerOverload, sizeof(*acReactivePowerOverload)); +} +EmberAfStatus SetAcReactivePowerOverload(chip::EndpointId endpoint, int16_t acReactivePowerOverload) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AcReactivePowerOverload, + (uint8_t *) &acReactivePowerOverload, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsOverVoltage(chip::EndpointId endpoint, int16_t * averageRmsOverVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltage, + (uint8_t *) averageRmsOverVoltage, sizeof(*averageRmsOverVoltage)); +} +EmberAfStatus SetAverageRmsOverVoltage(chip::EndpointId endpoint, int16_t averageRmsOverVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltage, + (uint8_t *) &averageRmsOverVoltage, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsUnderVoltage(chip::EndpointId endpoint, int16_t * averageRmsUnderVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltage, + (uint8_t *) averageRmsUnderVoltage, sizeof(*averageRmsUnderVoltage)); +} +EmberAfStatus SetAverageRmsUnderVoltage(chip::EndpointId endpoint, int16_t averageRmsUnderVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltage, + (uint8_t *) &averageRmsUnderVoltage, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeOverVoltage(chip::EndpointId endpoint, int16_t * rmsExtremeOverVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltage, + (uint8_t *) rmsExtremeOverVoltage, sizeof(*rmsExtremeOverVoltage)); +} +EmberAfStatus SetRmsExtremeOverVoltage(chip::EndpointId endpoint, int16_t rmsExtremeOverVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltage, + (uint8_t *) &rmsExtremeOverVoltage, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeUnderVoltage(chip::EndpointId endpoint, int16_t * rmsExtremeUnderVoltage) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltage, + (uint8_t *) rmsExtremeUnderVoltage, sizeof(*rmsExtremeUnderVoltage)); +} +EmberAfStatus SetRmsExtremeUnderVoltage(chip::EndpointId endpoint, int16_t rmsExtremeUnderVoltage) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltage, + (uint8_t *) &rmsExtremeUnderVoltage, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSag(chip::EndpointId endpoint, int16_t * rmsVoltageSag) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSag, (uint8_t *) rmsVoltageSag, + sizeof(*rmsVoltageSag)); +} +EmberAfStatus SetRmsVoltageSag(chip::EndpointId endpoint, int16_t rmsVoltageSag) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSag, (uint8_t *) &rmsVoltageSag, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSwell(chip::EndpointId endpoint, int16_t * rmsVoltageSwell) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwell, (uint8_t *) rmsVoltageSwell, + sizeof(*rmsVoltageSwell)); +} +EmberAfStatus SetRmsVoltageSwell(chip::EndpointId endpoint, int16_t rmsVoltageSwell) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwell, (uint8_t *) &rmsVoltageSwell, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLineCurrentPhaseB(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::LineCurrentPhaseB, (uint8_t *) lineCurrentPhaseB, + sizeof(*lineCurrentPhaseB)); +} +EmberAfStatus SetLineCurrentPhaseB(chip::EndpointId endpoint, uint16_t lineCurrentPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::LineCurrentPhaseB, (uint8_t *) &lineCurrentPhaseB, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActiveCurrentPhaseB(chip::EndpointId endpoint, int16_t * activeCurrentPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActiveCurrentPhaseB, + (uint8_t *) activeCurrentPhaseB, sizeof(*activeCurrentPhaseB)); +} +EmberAfStatus SetActiveCurrentPhaseB(chip::EndpointId endpoint, int16_t activeCurrentPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActiveCurrentPhaseB, + (uint8_t *) &activeCurrentPhaseB, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReactiveCurrentPhaseB(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactiveCurrentPhaseB, + (uint8_t *) reactiveCurrentPhaseB, sizeof(*reactiveCurrentPhaseB)); +} +EmberAfStatus SetReactiveCurrentPhaseB(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactiveCurrentPhaseB, + (uint8_t *) &reactiveCurrentPhaseB, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltagePhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltagePhaseB, (uint8_t *) rmsVoltagePhaseB, + sizeof(*rmsVoltagePhaseB)); +} +EmberAfStatus SetRmsVoltagePhaseB(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltagePhaseB, (uint8_t *) &rmsVoltagePhaseB, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMinPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMinPhaseB, + (uint8_t *) rmsVoltageMinPhaseB, sizeof(*rmsVoltageMinPhaseB)); +} +EmberAfStatus SetRmsVoltageMinPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMinPhaseB, + (uint8_t *) &rmsVoltageMinPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMaxPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMaxPhaseB, + (uint8_t *) rmsVoltageMaxPhaseB, sizeof(*rmsVoltageMaxPhaseB)); +} +EmberAfStatus SetRmsVoltageMaxPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMaxPhaseB, + (uint8_t *) &rmsVoltageMaxPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentPhaseB, (uint8_t *) rmsCurrentPhaseB, + sizeof(*rmsCurrentPhaseB)); +} +EmberAfStatus SetRmsCurrentPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentPhaseB, (uint8_t *) &rmsCurrentPhaseB, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMinPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMinPhaseB, + (uint8_t *) rmsCurrentMinPhaseB, sizeof(*rmsCurrentMinPhaseB)); +} +EmberAfStatus SetRmsCurrentMinPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMinPhaseB, + (uint8_t *) &rmsCurrentMinPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMaxPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMaxPhaseB, + (uint8_t *) rmsCurrentMaxPhaseB, sizeof(*rmsCurrentMaxPhaseB)); +} +EmberAfStatus SetRmsCurrentMaxPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMaxPhaseB, + (uint8_t *) &rmsCurrentMaxPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerPhaseB(chip::EndpointId endpoint, int16_t * activePowerPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerPhaseB, (uint8_t *) activePowerPhaseB, + sizeof(*activePowerPhaseB)); +} +EmberAfStatus SetActivePowerPhaseB(chip::EndpointId endpoint, int16_t activePowerPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerPhaseB, (uint8_t *) &activePowerPhaseB, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMinPhaseB(chip::EndpointId endpoint, int16_t * activePowerMinPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMinPhaseB, + (uint8_t *) activePowerMinPhaseB, sizeof(*activePowerMinPhaseB)); +} +EmberAfStatus SetActivePowerMinPhaseB(chip::EndpointId endpoint, int16_t activePowerMinPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMinPhaseB, + (uint8_t *) &activePowerMinPhaseB, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMaxPhaseB(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMaxPhaseB, + (uint8_t *) activePowerMaxPhaseB, sizeof(*activePowerMaxPhaseB)); +} +EmberAfStatus SetActivePowerMaxPhaseB(chip::EndpointId endpoint, int16_t activePowerMaxPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMaxPhaseB, + (uint8_t *) &activePowerMaxPhaseB, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReactivePowerPhaseB(chip::EndpointId endpoint, int16_t * reactivePowerPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePowerPhaseB, + (uint8_t *) reactivePowerPhaseB, sizeof(*reactivePowerPhaseB)); +} +EmberAfStatus SetReactivePowerPhaseB(chip::EndpointId endpoint, int16_t reactivePowerPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePowerPhaseB, + (uint8_t *) &reactivePowerPhaseB, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApparentPowerPhaseB(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPowerPhaseB, + (uint8_t *) apparentPowerPhaseB, sizeof(*apparentPowerPhaseB)); +} +EmberAfStatus SetApparentPowerPhaseB(chip::EndpointId endpoint, uint16_t apparentPowerPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPowerPhaseB, + (uint8_t *) &apparentPowerPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerFactorPhaseB(chip::EndpointId endpoint, int8_t * powerFactorPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactorPhaseB, (uint8_t *) powerFactorPhaseB, + sizeof(*powerFactorPhaseB)); +} +EmberAfStatus SetPowerFactorPhaseB(chip::EndpointId endpoint, int8_t powerFactorPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactorPhaseB, (uint8_t *) &powerFactorPhaseB, + ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsVoltageMeasurementPeriodPhaseB(chip::EndpointId endpoint, + uint16_t * averageRmsVoltageMeasurementPeriodPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriodPhaseB, + (uint8_t *) averageRmsVoltageMeasurementPeriodPhaseB, + sizeof(*averageRmsVoltageMeasurementPeriodPhaseB)); +} +EmberAfStatus SetAverageRmsVoltageMeasurementPeriodPhaseB(chip::EndpointId endpoint, + uint16_t averageRmsVoltageMeasurementPeriodPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriodPhaseB, + (uint8_t *) &averageRmsVoltageMeasurementPeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsOverVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltageCounterPhaseB, + (uint8_t *) averageRmsOverVoltageCounterPhaseB, sizeof(*averageRmsOverVoltageCounterPhaseB)); +} +EmberAfStatus SetAverageRmsOverVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltageCounterPhaseB, + (uint8_t *) &averageRmsOverVoltageCounterPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsUnderVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounterPhaseB, + (uint8_t *) averageRmsUnderVoltageCounterPhaseB, + sizeof(*averageRmsUnderVoltageCounterPhaseB)); +} +EmberAfStatus SetAverageRmsUnderVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounterPhaseB, + (uint8_t *) &averageRmsUnderVoltageCounterPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeOverVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriodPhaseB, + (uint8_t *) rmsExtremeOverVoltagePeriodPhaseB, sizeof(*rmsExtremeOverVoltagePeriodPhaseB)); +} +EmberAfStatus SetRmsExtremeOverVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriodPhaseB, + (uint8_t *) &rmsExtremeOverVoltagePeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeUnderVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriodPhaseB, + (uint8_t *) rmsExtremeUnderVoltagePeriodPhaseB, sizeof(*rmsExtremeUnderVoltagePeriodPhaseB)); +} +EmberAfStatus SetRmsExtremeUnderVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriodPhaseB, + (uint8_t *) &rmsExtremeUnderVoltagePeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSagPeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriodPhaseB, + (uint8_t *) rmsVoltageSagPeriodPhaseB, sizeof(*rmsVoltageSagPeriodPhaseB)); +} +EmberAfStatus SetRmsVoltageSagPeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriodPhaseB, + (uint8_t *) &rmsVoltageSagPeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSwellPeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseB) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriodPhaseB, + (uint8_t *) rmsVoltageSwellPeriodPhaseB, sizeof(*rmsVoltageSwellPeriodPhaseB)); +} +EmberAfStatus SetRmsVoltageSwellPeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseB) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriodPhaseB, + (uint8_t *) &rmsVoltageSwellPeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetLineCurrentPhaseC(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::LineCurrentPhaseC, (uint8_t *) lineCurrentPhaseC, + sizeof(*lineCurrentPhaseC)); +} +EmberAfStatus SetLineCurrentPhaseC(chip::EndpointId endpoint, uint16_t lineCurrentPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::LineCurrentPhaseC, (uint8_t *) &lineCurrentPhaseC, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActiveCurrentPhaseC(chip::EndpointId endpoint, int16_t * activeCurrentPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActiveCurrentPhaseC, + (uint8_t *) activeCurrentPhaseC, sizeof(*activeCurrentPhaseC)); +} +EmberAfStatus SetActiveCurrentPhaseC(chip::EndpointId endpoint, int16_t activeCurrentPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActiveCurrentPhaseC, + (uint8_t *) &activeCurrentPhaseC, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReactiveCurrentPhaseC(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactiveCurrentPhaseC, + (uint8_t *) reactiveCurrentPhaseC, sizeof(*reactiveCurrentPhaseC)); +} +EmberAfStatus SetReactiveCurrentPhaseC(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactiveCurrentPhaseC, + (uint8_t *) &reactiveCurrentPhaseC, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltagePhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltagePhaseC, (uint8_t *) rmsVoltagePhaseC, + sizeof(*rmsVoltagePhaseC)); +} +EmberAfStatus SetRmsVoltagePhaseC(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltagePhaseC, (uint8_t *) &rmsVoltagePhaseC, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMinPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMinPhaseC, + (uint8_t *) rmsVoltageMinPhaseC, sizeof(*rmsVoltageMinPhaseC)); +} +EmberAfStatus SetRmsVoltageMinPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMinPhaseC, + (uint8_t *) &rmsVoltageMinPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageMaxPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMaxPhaseC, + (uint8_t *) rmsVoltageMaxPhaseC, sizeof(*rmsVoltageMaxPhaseC)); +} +EmberAfStatus SetRmsVoltageMaxPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageMaxPhaseC, + (uint8_t *) &rmsVoltageMaxPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentPhaseC, (uint8_t *) rmsCurrentPhaseC, + sizeof(*rmsCurrentPhaseC)); +} +EmberAfStatus SetRmsCurrentPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentPhaseC, (uint8_t *) &rmsCurrentPhaseC, + ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMinPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMinPhaseC, + (uint8_t *) rmsCurrentMinPhaseC, sizeof(*rmsCurrentMinPhaseC)); +} +EmberAfStatus SetRmsCurrentMinPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMinPhaseC, + (uint8_t *) &rmsCurrentMinPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsCurrentMaxPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMaxPhaseC, + (uint8_t *) rmsCurrentMaxPhaseC, sizeof(*rmsCurrentMaxPhaseC)); +} +EmberAfStatus SetRmsCurrentMaxPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsCurrentMaxPhaseC, + (uint8_t *) &rmsCurrentMaxPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerPhaseC(chip::EndpointId endpoint, int16_t * activePowerPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerPhaseC, (uint8_t *) activePowerPhaseC, + sizeof(*activePowerPhaseC)); +} +EmberAfStatus SetActivePowerPhaseC(chip::EndpointId endpoint, int16_t activePowerPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerPhaseC, (uint8_t *) &activePowerPhaseC, + ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMinPhaseC(chip::EndpointId endpoint, int16_t * activePowerMinPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMinPhaseC, + (uint8_t *) activePowerMinPhaseC, sizeof(*activePowerMinPhaseC)); +} +EmberAfStatus SetActivePowerMinPhaseC(chip::EndpointId endpoint, int16_t activePowerMinPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMinPhaseC, + (uint8_t *) &activePowerMinPhaseC, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetActivePowerMaxPhaseC(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMaxPhaseC, + (uint8_t *) activePowerMaxPhaseC, sizeof(*activePowerMaxPhaseC)); +} +EmberAfStatus SetActivePowerMaxPhaseC(chip::EndpointId endpoint, int16_t activePowerMaxPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ActivePowerMaxPhaseC, + (uint8_t *) &activePowerMaxPhaseC, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetReactivePowerPhaseC(chip::EndpointId endpoint, int16_t * reactivePowerPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePowerPhaseC, + (uint8_t *) reactivePowerPhaseC, sizeof(*reactivePowerPhaseC)); +} +EmberAfStatus SetReactivePowerPhaseC(chip::EndpointId endpoint, int16_t reactivePowerPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ReactivePowerPhaseC, + (uint8_t *) &reactivePowerPhaseC, ZCL_INT16S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetApparentPowerPhaseC(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPowerPhaseC, + (uint8_t *) apparentPowerPhaseC, sizeof(*apparentPowerPhaseC)); +} +EmberAfStatus SetApparentPowerPhaseC(chip::EndpointId endpoint, uint16_t apparentPowerPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::ApparentPowerPhaseC, + (uint8_t *) &apparentPowerPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetPowerFactorPhaseC(chip::EndpointId endpoint, int8_t * powerFactorPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactorPhaseC, (uint8_t *) powerFactorPhaseC, + sizeof(*powerFactorPhaseC)); +} +EmberAfStatus SetPowerFactorPhaseC(chip::EndpointId endpoint, int8_t powerFactorPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::PowerFactorPhaseC, (uint8_t *) &powerFactorPhaseC, + ZCL_INT8S_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsVoltageMeasurementPeriodPhaseC(chip::EndpointId endpoint, + uint16_t * averageRmsVoltageMeasurementPeriodPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriodPhaseC, + (uint8_t *) averageRmsVoltageMeasurementPeriodPhaseC, + sizeof(*averageRmsVoltageMeasurementPeriodPhaseC)); +} +EmberAfStatus SetAverageRmsVoltageMeasurementPeriodPhaseC(chip::EndpointId endpoint, + uint16_t averageRmsVoltageMeasurementPeriodPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsVoltageMeasurementPeriodPhaseC, + (uint8_t *) &averageRmsVoltageMeasurementPeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsOverVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltageCounterPhaseC, + (uint8_t *) averageRmsOverVoltageCounterPhaseC, sizeof(*averageRmsOverVoltageCounterPhaseC)); +} +EmberAfStatus SetAverageRmsOverVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsOverVoltageCounterPhaseC, + (uint8_t *) &averageRmsOverVoltageCounterPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetAverageRmsUnderVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounterPhaseC, + (uint8_t *) averageRmsUnderVoltageCounterPhaseC, + sizeof(*averageRmsUnderVoltageCounterPhaseC)); +} +EmberAfStatus SetAverageRmsUnderVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::AverageRmsUnderVoltageCounterPhaseC, + (uint8_t *) &averageRmsUnderVoltageCounterPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeOverVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriodPhaseC, + (uint8_t *) rmsExtremeOverVoltagePeriodPhaseC, sizeof(*rmsExtremeOverVoltagePeriodPhaseC)); +} +EmberAfStatus SetRmsExtremeOverVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeOverVoltagePeriodPhaseC, + (uint8_t *) &rmsExtremeOverVoltagePeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsExtremeUnderVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriodPhaseC, + (uint8_t *) rmsExtremeUnderVoltagePeriodPhaseC, sizeof(*rmsExtremeUnderVoltagePeriodPhaseC)); +} +EmberAfStatus SetRmsExtremeUnderVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsExtremeUnderVoltagePeriodPhaseC, + (uint8_t *) &rmsExtremeUnderVoltagePeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSagPeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriodPhaseC, + (uint8_t *) rmsVoltageSagPeriodPhaseC, sizeof(*rmsVoltageSagPeriodPhaseC)); +} +EmberAfStatus SetRmsVoltageSagPeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSagPeriodPhaseC, + (uint8_t *) &rmsVoltageSagPeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetRmsVoltageSwellPeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseC) +{ + return emberAfReadServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriodPhaseC, + (uint8_t *) rmsVoltageSwellPeriodPhaseC, sizeof(*rmsVoltageSwellPeriodPhaseC)); +} +EmberAfStatus SetRmsVoltageSwellPeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseC) +{ + return emberAfWriteServerAttribute(endpoint, ElectricalMeasurement::Id, Ids::RmsVoltageSwellPeriodPhaseC, + (uint8_t *) &rmsVoltageSwellPeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace ElectricalMeasurement + +namespace GroupKeyManagement { +namespace Attributes { +} // namespace Attributes +} // namespace GroupKeyManagement + +namespace SampleMfgSpecificCluster { +namespace Attributes { +EmberAfStatus GetEmberSampleAttribute(chip::EndpointId endpoint, uint8_t * emberSampleAttribute) +{ + return emberAfReadServerAttribute(endpoint, SampleMfgSpecificCluster::Id, Ids::EmberSampleAttribute, + (uint8_t *) emberSampleAttribute, sizeof(*emberSampleAttribute)); +} +EmberAfStatus SetEmberSampleAttribute(chip::EndpointId endpoint, uint8_t emberSampleAttribute) +{ + return emberAfWriteServerAttribute(endpoint, SampleMfgSpecificCluster::Id, Ids::EmberSampleAttribute, + (uint8_t *) &emberSampleAttribute, ZCL_INT8U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEmberSampleAttribute2(chip::EndpointId endpoint, uint8_t * emberSampleAttribute2) +{ + return emberAfReadServerAttribute(endpoint, SampleMfgSpecificCluster::Id, Ids::EmberSampleAttribute2, + (uint8_t *) emberSampleAttribute2, sizeof(*emberSampleAttribute2)); +} +EmberAfStatus SetEmberSampleAttribute2(chip::EndpointId endpoint, uint8_t emberSampleAttribute2) +{ + return emberAfWriteServerAttribute(endpoint, SampleMfgSpecificCluster::Id, Ids::EmberSampleAttribute2, + (uint8_t *) &emberSampleAttribute2, ZCL_INT8U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SampleMfgSpecificCluster + +namespace SampleMfgSpecificCluster2 { +namespace Attributes { +EmberAfStatus GetEmberSampleAttribute3(chip::EndpointId endpoint, uint16_t * emberSampleAttribute3) +{ + return emberAfReadServerAttribute(endpoint, SampleMfgSpecificCluster2::Id, Ids::EmberSampleAttribute3, + (uint8_t *) emberSampleAttribute3, sizeof(*emberSampleAttribute3)); +} +EmberAfStatus SetEmberSampleAttribute3(chip::EndpointId endpoint, uint16_t emberSampleAttribute3) +{ + return emberAfWriteServerAttribute(endpoint, SampleMfgSpecificCluster2::Id, Ids::EmberSampleAttribute3, + (uint8_t *) &emberSampleAttribute3, ZCL_INT16U_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEmberSampleAttribute4(chip::EndpointId endpoint, uint16_t * emberSampleAttribute4) +{ + return emberAfReadServerAttribute(endpoint, SampleMfgSpecificCluster2::Id, Ids::EmberSampleAttribute4, + (uint8_t *) emberSampleAttribute4, sizeof(*emberSampleAttribute4)); +} +EmberAfStatus SetEmberSampleAttribute4(chip::EndpointId endpoint, uint16_t emberSampleAttribute4) +{ + return emberAfWriteServerAttribute(endpoint, SampleMfgSpecificCluster2::Id, Ids::EmberSampleAttribute4, + (uint8_t *) &emberSampleAttribute4, ZCL_INT16U_ATTRIBUTE_TYPE); +} +} // namespace Attributes +} // namespace SampleMfgSpecificCluster2 + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/common/gen/attributes/Accessors.h b/src/app/common/gen/attributes/Accessors.h new file mode 100644 index 00000000000000..b2b876e61d1fcd --- /dev/null +++ b/src/app/common/gen/attributes/Accessors.h @@ -0,0 +1,2197 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +/** + * @file + * This file contains declarations for accessors around clusters attributes. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace PowerConfiguration { +namespace Attributes { +EmberAfStatus GetMainsVoltage(chip::EndpointId endpoint, uint16_t * mainsVoltage); // int16u +EmberAfStatus SetMainsVoltage(chip::EndpointId endpoint, uint16_t mainsVoltage); +EmberAfStatus GetMainsFrequency(chip::EndpointId endpoint, uint8_t * mainsFrequency); // int8u +EmberAfStatus SetMainsFrequency(chip::EndpointId endpoint, uint8_t mainsFrequency); +EmberAfStatus GetMainsAlarmMask(chip::EndpointId endpoint, uint8_t * mainsAlarmMask); // bitmap8 +EmberAfStatus SetMainsAlarmMask(chip::EndpointId endpoint, uint8_t mainsAlarmMask); +EmberAfStatus GetMainsVoltageMinThreshold(chip::EndpointId endpoint, uint16_t * mainsVoltageMinThreshold); // int16u +EmberAfStatus SetMainsVoltageMinThreshold(chip::EndpointId endpoint, uint16_t mainsVoltageMinThreshold); +EmberAfStatus GetMainsVoltageMaxThreshold(chip::EndpointId endpoint, uint16_t * mainsVoltageMaxThreshold); // int16u +EmberAfStatus SetMainsVoltageMaxThreshold(chip::EndpointId endpoint, uint16_t mainsVoltageMaxThreshold); +EmberAfStatus GetMainsVoltageDwellTrip(chip::EndpointId endpoint, uint16_t * mainsVoltageDwellTrip); // int16u +EmberAfStatus SetMainsVoltageDwellTrip(chip::EndpointId endpoint, uint16_t mainsVoltageDwellTrip); +EmberAfStatus GetBatteryVoltage(chip::EndpointId endpoint, uint8_t * batteryVoltage); // int8u +EmberAfStatus SetBatteryVoltage(chip::EndpointId endpoint, uint8_t batteryVoltage); +EmberAfStatus GetBatteryPercentageRemaining(chip::EndpointId endpoint, uint8_t * batteryPercentageRemaining); // int8u +EmberAfStatus SetBatteryPercentageRemaining(chip::EndpointId endpoint, uint8_t batteryPercentageRemaining); +EmberAfStatus GetBatterySize(chip::EndpointId endpoint, uint8_t * batterySize); // enum8 +EmberAfStatus SetBatterySize(chip::EndpointId endpoint, uint8_t batterySize); +EmberAfStatus GetBatteryAhrRating(chip::EndpointId endpoint, uint16_t * batteryAhrRating); // int16u +EmberAfStatus SetBatteryAhrRating(chip::EndpointId endpoint, uint16_t batteryAhrRating); +EmberAfStatus GetBatteryQuantity(chip::EndpointId endpoint, uint8_t * batteryQuantity); // int8u +EmberAfStatus SetBatteryQuantity(chip::EndpointId endpoint, uint8_t batteryQuantity); +EmberAfStatus GetBatteryRatedVoltage(chip::EndpointId endpoint, uint8_t * batteryRatedVoltage); // int8u +EmberAfStatus SetBatteryRatedVoltage(chip::EndpointId endpoint, uint8_t batteryRatedVoltage); +EmberAfStatus GetBatteryAlarmMask(chip::EndpointId endpoint, uint8_t * batteryAlarmMask); // bitmap8 +EmberAfStatus SetBatteryAlarmMask(chip::EndpointId endpoint, uint8_t batteryAlarmMask); +EmberAfStatus GetBatteryVoltageMinThreshold(chip::EndpointId endpoint, uint8_t * batteryVoltageMinThreshold); // int8u +EmberAfStatus SetBatteryVoltageMinThreshold(chip::EndpointId endpoint, uint8_t batteryVoltageMinThreshold); +EmberAfStatus GetBatteryVoltageThreshold1(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold1); // int8u +EmberAfStatus SetBatteryVoltageThreshold1(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold1); +EmberAfStatus GetBatteryVoltageThreshold2(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold2); // int8u +EmberAfStatus SetBatteryVoltageThreshold2(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold2); +EmberAfStatus GetBatteryVoltageThreshold3(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold3); // int8u +EmberAfStatus SetBatteryVoltageThreshold3(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold3); +EmberAfStatus GetBatteryPercentageMinThreshold(chip::EndpointId endpoint, uint8_t * batteryPercentageMinThreshold); // int8u +EmberAfStatus SetBatteryPercentageMinThreshold(chip::EndpointId endpoint, uint8_t batteryPercentageMinThreshold); +EmberAfStatus GetBatteryPercentageThreshold1(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold1); // int8u +EmberAfStatus SetBatteryPercentageThreshold1(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold1); +EmberAfStatus GetBatteryPercentageThreshold2(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold2); // int8u +EmberAfStatus SetBatteryPercentageThreshold2(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold2); +EmberAfStatus GetBatteryPercentageThreshold3(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold3); // int8u +EmberAfStatus SetBatteryPercentageThreshold3(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold3); +EmberAfStatus GetBatteryAlarmState(chip::EndpointId endpoint, uint32_t * batteryAlarmState); // bitmap32 +EmberAfStatus SetBatteryAlarmState(chip::EndpointId endpoint, uint32_t batteryAlarmState); +EmberAfStatus GetBattery2Voltage(chip::EndpointId endpoint, uint8_t * battery2Voltage); // int8u +EmberAfStatus SetBattery2Voltage(chip::EndpointId endpoint, uint8_t battery2Voltage); +EmberAfStatus GetBattery2PercentageRemaining(chip::EndpointId endpoint, uint8_t * battery2PercentageRemaining); // int8u +EmberAfStatus SetBattery2PercentageRemaining(chip::EndpointId endpoint, uint8_t battery2PercentageRemaining); +EmberAfStatus GetBattery2Size(chip::EndpointId endpoint, uint8_t * battery2Size); // enum8 +EmberAfStatus SetBattery2Size(chip::EndpointId endpoint, uint8_t battery2Size); +EmberAfStatus GetBattery2AhrRating(chip::EndpointId endpoint, uint16_t * battery2AhrRating); // int16u +EmberAfStatus SetBattery2AhrRating(chip::EndpointId endpoint, uint16_t battery2AhrRating); +EmberAfStatus GetBattery2Quantity(chip::EndpointId endpoint, uint8_t * battery2Quantity); // int8u +EmberAfStatus SetBattery2Quantity(chip::EndpointId endpoint, uint8_t battery2Quantity); +EmberAfStatus GetBattery2RatedVoltage(chip::EndpointId endpoint, uint8_t * battery2RatedVoltage); // int8u +EmberAfStatus SetBattery2RatedVoltage(chip::EndpointId endpoint, uint8_t battery2RatedVoltage); +EmberAfStatus GetBattery2AlarmMask(chip::EndpointId endpoint, uint8_t * battery2AlarmMask); // bitmap8 +EmberAfStatus SetBattery2AlarmMask(chip::EndpointId endpoint, uint8_t battery2AlarmMask); +EmberAfStatus GetBattery2VoltageMinThreshold(chip::EndpointId endpoint, uint8_t * battery2VoltageMinThreshold); // int8u +EmberAfStatus SetBattery2VoltageMinThreshold(chip::EndpointId endpoint, uint8_t battery2VoltageMinThreshold); +EmberAfStatus GetBattery2VoltageThreshold1(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold1); // int8u +EmberAfStatus SetBattery2VoltageThreshold1(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold1); +EmberAfStatus GetBattery2VoltageThreshold2(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold2); // int8u +EmberAfStatus SetBattery2VoltageThreshold2(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold2); +EmberAfStatus GetBattery2VoltageThreshold3(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold3); // int8u +EmberAfStatus SetBattery2VoltageThreshold3(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold3); +EmberAfStatus GetBattery2PercentageMinThreshold(chip::EndpointId endpoint, uint8_t * battery2PercentageMinThreshold); // int8u +EmberAfStatus SetBattery2PercentageMinThreshold(chip::EndpointId endpoint, uint8_t battery2PercentageMinThreshold); +EmberAfStatus GetBattery2PercentageThreshold1(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold1); // int8u +EmberAfStatus SetBattery2PercentageThreshold1(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold1); +EmberAfStatus GetBattery2PercentageThreshold2(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold2); // int8u +EmberAfStatus SetBattery2PercentageThreshold2(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold2); +EmberAfStatus GetBattery2PercentageThreshold3(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold3); // int8u +EmberAfStatus SetBattery2PercentageThreshold3(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold3); +EmberAfStatus GetBattery2AlarmState(chip::EndpointId endpoint, uint32_t * battery2AlarmState); // bitmap32 +EmberAfStatus SetBattery2AlarmState(chip::EndpointId endpoint, uint32_t battery2AlarmState); +EmberAfStatus GetBattery3Voltage(chip::EndpointId endpoint, uint8_t * battery3Voltage); // int8u +EmberAfStatus SetBattery3Voltage(chip::EndpointId endpoint, uint8_t battery3Voltage); +EmberAfStatus GetBattery3PercentageRemaining(chip::EndpointId endpoint, uint8_t * battery3PercentageRemaining); // int8u +EmberAfStatus SetBattery3PercentageRemaining(chip::EndpointId endpoint, uint8_t battery3PercentageRemaining); +EmberAfStatus GetBattery3Size(chip::EndpointId endpoint, uint8_t * battery3Size); // enum8 +EmberAfStatus SetBattery3Size(chip::EndpointId endpoint, uint8_t battery3Size); +EmberAfStatus GetBattery3AhrRating(chip::EndpointId endpoint, uint16_t * battery3AhrRating); // int16u +EmberAfStatus SetBattery3AhrRating(chip::EndpointId endpoint, uint16_t battery3AhrRating); +EmberAfStatus GetBattery3Quantity(chip::EndpointId endpoint, uint8_t * battery3Quantity); // int8u +EmberAfStatus SetBattery3Quantity(chip::EndpointId endpoint, uint8_t battery3Quantity); +EmberAfStatus GetBattery3RatedVoltage(chip::EndpointId endpoint, uint8_t * battery3RatedVoltage); // int8u +EmberAfStatus SetBattery3RatedVoltage(chip::EndpointId endpoint, uint8_t battery3RatedVoltage); +EmberAfStatus GetBattery3AlarmMask(chip::EndpointId endpoint, uint8_t * battery3AlarmMask); // bitmap8 +EmberAfStatus SetBattery3AlarmMask(chip::EndpointId endpoint, uint8_t battery3AlarmMask); +EmberAfStatus GetBattery3VoltageMinThreshold(chip::EndpointId endpoint, uint8_t * battery3VoltageMinThreshold); // int8u +EmberAfStatus SetBattery3VoltageMinThreshold(chip::EndpointId endpoint, uint8_t battery3VoltageMinThreshold); +EmberAfStatus GetBattery3VoltageThreshold1(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold1); // int8u +EmberAfStatus SetBattery3VoltageThreshold1(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold1); +EmberAfStatus GetBattery3VoltageThreshold2(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold2); // int8u +EmberAfStatus SetBattery3VoltageThreshold2(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold2); +EmberAfStatus GetBattery3VoltageThreshold3(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold3); // int8u +EmberAfStatus SetBattery3VoltageThreshold3(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold3); +EmberAfStatus GetBattery3PercentageMinThreshold(chip::EndpointId endpoint, uint8_t * battery3PercentageMinThreshold); // int8u +EmberAfStatus SetBattery3PercentageMinThreshold(chip::EndpointId endpoint, uint8_t battery3PercentageMinThreshold); +EmberAfStatus GetBattery3PercentageThreshold1(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold1); // int8u +EmberAfStatus SetBattery3PercentageThreshold1(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold1); +EmberAfStatus GetBattery3PercentageThreshold2(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold2); // int8u +EmberAfStatus SetBattery3PercentageThreshold2(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold2); +EmberAfStatus GetBattery3PercentageThreshold3(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold3); // int8u +EmberAfStatus SetBattery3PercentageThreshold3(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold3); +EmberAfStatus GetBattery3AlarmState(chip::EndpointId endpoint, uint32_t * battery3AlarmState); // bitmap32 +EmberAfStatus SetBattery3AlarmState(chip::EndpointId endpoint, uint32_t battery3AlarmState); +} // namespace Attributes +} // namespace PowerConfiguration + +namespace DeviceTemperatureConfiguration { +namespace Attributes { +EmberAfStatus GetCurrentTemperature(chip::EndpointId endpoint, int16_t * currentTemperature); // int16s +EmberAfStatus SetCurrentTemperature(chip::EndpointId endpoint, int16_t currentTemperature); +EmberAfStatus GetMinTempExperienced(chip::EndpointId endpoint, int16_t * minTempExperienced); // int16s +EmberAfStatus SetMinTempExperienced(chip::EndpointId endpoint, int16_t minTempExperienced); +EmberAfStatus GetMaxTempExperienced(chip::EndpointId endpoint, int16_t * maxTempExperienced); // int16s +EmberAfStatus SetMaxTempExperienced(chip::EndpointId endpoint, int16_t maxTempExperienced); +EmberAfStatus GetOverTempTotalDwell(chip::EndpointId endpoint, uint16_t * overTempTotalDwell); // int16u +EmberAfStatus SetOverTempTotalDwell(chip::EndpointId endpoint, uint16_t overTempTotalDwell); +EmberAfStatus GetDeviceTempAlarmMask(chip::EndpointId endpoint, uint8_t * deviceTempAlarmMask); // bitmap8 +EmberAfStatus SetDeviceTempAlarmMask(chip::EndpointId endpoint, uint8_t deviceTempAlarmMask); +EmberAfStatus GetLowTempThreshold(chip::EndpointId endpoint, int16_t * lowTempThreshold); // int16s +EmberAfStatus SetLowTempThreshold(chip::EndpointId endpoint, int16_t lowTempThreshold); +EmberAfStatus GetHighTempThreshold(chip::EndpointId endpoint, int16_t * highTempThreshold); // int16s +EmberAfStatus SetHighTempThreshold(chip::EndpointId endpoint, int16_t highTempThreshold); +} // namespace Attributes +} // namespace DeviceTemperatureConfiguration + +namespace Identify { +namespace Attributes { +EmberAfStatus GetIdentifyTime(chip::EndpointId endpoint, uint16_t * identifyTime); // int16u +EmberAfStatus SetIdentifyTime(chip::EndpointId endpoint, uint16_t identifyTime); +EmberAfStatus GetCommissionState(chip::EndpointId endpoint, uint8_t * commissionState); // bitmap8 +EmberAfStatus SetCommissionState(chip::EndpointId endpoint, uint8_t commissionState); +} // namespace Attributes +} // namespace Identify + +namespace Groups { +namespace Attributes { +EmberAfStatus GetNameSupport(chip::EndpointId endpoint, uint8_t * nameSupport); // bitmap8 +EmberAfStatus SetNameSupport(chip::EndpointId endpoint, uint8_t nameSupport); +} // namespace Attributes +} // namespace Groups + +namespace Scenes { +namespace Attributes { +EmberAfStatus GetSceneCount(chip::EndpointId endpoint, uint8_t * sceneCount); // int8u +EmberAfStatus SetSceneCount(chip::EndpointId endpoint, uint8_t sceneCount); +EmberAfStatus GetCurrentScene(chip::EndpointId endpoint, uint8_t * currentScene); // int8u +EmberAfStatus SetCurrentScene(chip::EndpointId endpoint, uint8_t currentScene); +EmberAfStatus GetCurrentGroup(chip::EndpointId endpoint, uint16_t * currentGroup); // int16u +EmberAfStatus SetCurrentGroup(chip::EndpointId endpoint, uint16_t currentGroup); +EmberAfStatus GetSceneValid(chip::EndpointId endpoint, uint8_t * sceneValid); // boolean +EmberAfStatus SetSceneValid(chip::EndpointId endpoint, uint8_t sceneValid); +EmberAfStatus GetNameSupport(chip::EndpointId endpoint, uint8_t * nameSupport); // bitmap8 +EmberAfStatus SetNameSupport(chip::EndpointId endpoint, uint8_t nameSupport); +EmberAfStatus GetLastConfiguredBy(chip::EndpointId endpoint, + /* TYPE WARNING: unknown defaults to */ uint8_t ** lastConfiguredBy); // eui64 +EmberAfStatus SetLastConfiguredBy(chip::EndpointId endpoint, /* TYPE WARNING: unknown defaults to */ uint8_t * lastConfiguredBy); +} // namespace Attributes +} // namespace Scenes + +namespace OnOff { +namespace Attributes { +EmberAfStatus GetOnOff(chip::EndpointId endpoint, uint8_t * onOff); // boolean +EmberAfStatus SetOnOff(chip::EndpointId endpoint, uint8_t onOff); +EmberAfStatus GetSampleMfgSpecificAttribute0x00000x1002(chip::EndpointId endpoint, + uint16_t * sampleMfgSpecificAttribute0x00000x1002); // int16u +EmberAfStatus SetSampleMfgSpecificAttribute0x00000x1002(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00000x1002); +EmberAfStatus GetSampleMfgSpecificAttribute0x00000x1049(chip::EndpointId endpoint, + uint8_t * sampleMfgSpecificAttribute0x00000x1049); // int8u +EmberAfStatus SetSampleMfgSpecificAttribute0x00000x1049(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00000x1049); +EmberAfStatus GetSampleMfgSpecificAttribute0x00010x1002(chip::EndpointId endpoint, + uint8_t * sampleMfgSpecificAttribute0x00010x1002); // int8u +EmberAfStatus SetSampleMfgSpecificAttribute0x00010x1002(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00010x1002); +EmberAfStatus GetSampleMfgSpecificAttribute0x00010x1040(chip::EndpointId endpoint, + uint16_t * sampleMfgSpecificAttribute0x00010x1040); // int16u +EmberAfStatus SetSampleMfgSpecificAttribute0x00010x1040(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00010x1040); +EmberAfStatus GetGlobalSceneControl(chip::EndpointId endpoint, uint8_t * globalSceneControl); // boolean +EmberAfStatus SetGlobalSceneControl(chip::EndpointId endpoint, uint8_t globalSceneControl); +EmberAfStatus GetOnTime(chip::EndpointId endpoint, uint16_t * onTime); // int16u +EmberAfStatus SetOnTime(chip::EndpointId endpoint, uint16_t onTime); +EmberAfStatus GetOffWaitTime(chip::EndpointId endpoint, uint16_t * offWaitTime); // int16u +EmberAfStatus SetOffWaitTime(chip::EndpointId endpoint, uint16_t offWaitTime); +EmberAfStatus GetStartUpOnOff(chip::EndpointId endpoint, uint8_t * startUpOnOff); // enum8 +EmberAfStatus SetStartUpOnOff(chip::EndpointId endpoint, uint8_t startUpOnOff); +} // namespace Attributes +} // namespace OnOff + +namespace OnOffSwitchConfiguration { +namespace Attributes { +EmberAfStatus GetSwitchType(chip::EndpointId endpoint, uint8_t * switchType); // enum8 +EmberAfStatus SetSwitchType(chip::EndpointId endpoint, uint8_t switchType); +EmberAfStatus GetSwitchActions(chip::EndpointId endpoint, uint8_t * switchActions); // enum8 +EmberAfStatus SetSwitchActions(chip::EndpointId endpoint, uint8_t switchActions); +} // namespace Attributes +} // namespace OnOffSwitchConfiguration + +namespace LevelControl { +namespace Attributes { +EmberAfStatus GetCurrentLevel(chip::EndpointId endpoint, uint8_t * currentLevel); // int8u +EmberAfStatus SetCurrentLevel(chip::EndpointId endpoint, uint8_t currentLevel); +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime); +EmberAfStatus GetOptions(chip::EndpointId endpoint, uint8_t * options); // bitmap8 +EmberAfStatus SetOptions(chip::EndpointId endpoint, uint8_t options); +EmberAfStatus GetOnOffTransitionTime(chip::EndpointId endpoint, uint16_t * onOffTransitionTime); // int16u +EmberAfStatus SetOnOffTransitionTime(chip::EndpointId endpoint, uint16_t onOffTransitionTime); +EmberAfStatus GetOnLevel(chip::EndpointId endpoint, uint8_t * onLevel); // int8u +EmberAfStatus SetOnLevel(chip::EndpointId endpoint, uint8_t onLevel); +EmberAfStatus GetOnTransitionTime(chip::EndpointId endpoint, uint16_t * onTransitionTime); // int16u +EmberAfStatus SetOnTransitionTime(chip::EndpointId endpoint, uint16_t onTransitionTime); +EmberAfStatus GetOffTransitionTime(chip::EndpointId endpoint, uint16_t * offTransitionTime); // int16u +EmberAfStatus SetOffTransitionTime(chip::EndpointId endpoint, uint16_t offTransitionTime); +EmberAfStatus GetDefaultMoveRate(chip::EndpointId endpoint, uint8_t * defaultMoveRate); // int8u +EmberAfStatus SetDefaultMoveRate(chip::EndpointId endpoint, uint8_t defaultMoveRate); +EmberAfStatus GetStartUpCurrentLevel(chip::EndpointId endpoint, uint8_t * startUpCurrentLevel); // int8u +EmberAfStatus SetStartUpCurrentLevel(chip::EndpointId endpoint, uint8_t startUpCurrentLevel); +} // namespace Attributes +} // namespace LevelControl + +namespace Alarms { +namespace Attributes { +EmberAfStatus GetAlarmCount(chip::EndpointId endpoint, uint16_t * alarmCount); // int16u +EmberAfStatus SetAlarmCount(chip::EndpointId endpoint, uint16_t alarmCount); +} // namespace Attributes +} // namespace Alarms + +namespace Time { +namespace Attributes { +EmberAfStatus GetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** time); // utc +EmberAfStatus SetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * time); +EmberAfStatus GetTimeStatus(chip::EndpointId endpoint, uint8_t * timeStatus); // bitmap8 +EmberAfStatus SetTimeStatus(chip::EndpointId endpoint, uint8_t timeStatus); +EmberAfStatus GetTimeZone(chip::EndpointId endpoint, int32_t * timeZone); // int32s +EmberAfStatus SetTimeZone(chip::EndpointId endpoint, int32_t timeZone); +EmberAfStatus GetDstStart(chip::EndpointId endpoint, uint32_t * dstStart); // int32u +EmberAfStatus SetDstStart(chip::EndpointId endpoint, uint32_t dstStart); +EmberAfStatus GetDstEnd(chip::EndpointId endpoint, uint32_t * dstEnd); // int32u +EmberAfStatus SetDstEnd(chip::EndpointId endpoint, uint32_t dstEnd); +EmberAfStatus GetDstShift(chip::EndpointId endpoint, int32_t * dstShift); // int32s +EmberAfStatus SetDstShift(chip::EndpointId endpoint, int32_t dstShift); +EmberAfStatus GetStandardTime(chip::EndpointId endpoint, uint32_t * standardTime); // int32u +EmberAfStatus SetStandardTime(chip::EndpointId endpoint, uint32_t standardTime); +EmberAfStatus GetLocalTime(chip::EndpointId endpoint, uint32_t * localTime); // int32u +EmberAfStatus SetLocalTime(chip::EndpointId endpoint, uint32_t localTime); +EmberAfStatus GetLastSetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** lastSetTime); // utc +EmberAfStatus SetLastSetTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * lastSetTime); +EmberAfStatus GetValidUntilTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t ** validUntilTime); // utc +EmberAfStatus SetValidUntilTime(chip::EndpointId endpoint, /* TYPE WARNING: utc defaults to */ uint8_t * validUntilTime); +} // namespace Attributes +} // namespace Time + +namespace BinaryInputBasic { +namespace Attributes { +EmberAfStatus GetOutOfService(chip::EndpointId endpoint, uint8_t * outOfService); // boolean +EmberAfStatus SetOutOfService(chip::EndpointId endpoint, uint8_t outOfService); +EmberAfStatus GetPolarity(chip::EndpointId endpoint, uint8_t * polarity); // enum8 +EmberAfStatus SetPolarity(chip::EndpointId endpoint, uint8_t polarity); +EmberAfStatus GetPresentValue(chip::EndpointId endpoint, uint8_t * presentValue); // boolean +EmberAfStatus SetPresentValue(chip::EndpointId endpoint, uint8_t presentValue); +EmberAfStatus GetReliability(chip::EndpointId endpoint, uint8_t * reliability); // enum8 +EmberAfStatus SetReliability(chip::EndpointId endpoint, uint8_t reliability); +EmberAfStatus GetStatusFlags(chip::EndpointId endpoint, uint8_t * statusFlags); // bitmap8 +EmberAfStatus SetStatusFlags(chip::EndpointId endpoint, uint8_t statusFlags); +EmberAfStatus GetApplicationType(chip::EndpointId endpoint, uint32_t * applicationType); // int32u +EmberAfStatus SetApplicationType(chip::EndpointId endpoint, uint32_t applicationType); +} // namespace Attributes +} // namespace BinaryInputBasic + +namespace PowerProfile { +namespace Attributes { +EmberAfStatus GetTotalProfileNum(chip::EndpointId endpoint, uint8_t * totalProfileNum); // int8u +EmberAfStatus SetTotalProfileNum(chip::EndpointId endpoint, uint8_t totalProfileNum); +EmberAfStatus GetMultipleScheduling(chip::EndpointId endpoint, uint8_t * multipleScheduling); // boolean +EmberAfStatus SetMultipleScheduling(chip::EndpointId endpoint, uint8_t multipleScheduling); +EmberAfStatus GetEnergyFormatting(chip::EndpointId endpoint, uint8_t * energyFormatting); // bitmap8 +EmberAfStatus SetEnergyFormatting(chip::EndpointId endpoint, uint8_t energyFormatting); +EmberAfStatus GetEnergyRemote(chip::EndpointId endpoint, uint8_t * energyRemote); // boolean +EmberAfStatus SetEnergyRemote(chip::EndpointId endpoint, uint8_t energyRemote); +EmberAfStatus GetScheduleMode(chip::EndpointId endpoint, uint8_t * scheduleMode); // bitmap8 +EmberAfStatus SetScheduleMode(chip::EndpointId endpoint, uint8_t scheduleMode); +} // namespace Attributes +} // namespace PowerProfile + +namespace ApplianceControl { +namespace Attributes { +EmberAfStatus GetStartTime(chip::EndpointId endpoint, uint16_t * startTime); // int16u +EmberAfStatus SetStartTime(chip::EndpointId endpoint, uint16_t startTime); +EmberAfStatus GetFinishTime(chip::EndpointId endpoint, uint16_t * finishTime); // int16u +EmberAfStatus SetFinishTime(chip::EndpointId endpoint, uint16_t finishTime); +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime); +} // namespace Attributes +} // namespace ApplianceControl + +namespace Descriptor { +namespace Attributes { +} // namespace Attributes +} // namespace Descriptor + +namespace PollControl { +namespace Attributes { +EmberAfStatus GetCheckInInterval(chip::EndpointId endpoint, uint32_t * checkInInterval); // int32u +EmberAfStatus SetCheckInInterval(chip::EndpointId endpoint, uint32_t checkInInterval); +EmberAfStatus GetLongPollInterval(chip::EndpointId endpoint, uint32_t * longPollInterval); // int32u +EmberAfStatus SetLongPollInterval(chip::EndpointId endpoint, uint32_t longPollInterval); +EmberAfStatus GetShortPollInterval(chip::EndpointId endpoint, uint16_t * shortPollInterval); // int16u +EmberAfStatus SetShortPollInterval(chip::EndpointId endpoint, uint16_t shortPollInterval); +EmberAfStatus GetFastPollTimeout(chip::EndpointId endpoint, uint16_t * fastPollTimeout); // int16u +EmberAfStatus SetFastPollTimeout(chip::EndpointId endpoint, uint16_t fastPollTimeout); +EmberAfStatus GetCheckInIntervalMin(chip::EndpointId endpoint, uint32_t * checkInIntervalMin); // int32u +EmberAfStatus SetCheckInIntervalMin(chip::EndpointId endpoint, uint32_t checkInIntervalMin); +EmberAfStatus GetLongPollIntervalMin(chip::EndpointId endpoint, uint32_t * longPollIntervalMin); // int32u +EmberAfStatus SetLongPollIntervalMin(chip::EndpointId endpoint, uint32_t longPollIntervalMin); +EmberAfStatus GetFastPollTimeoutMax(chip::EndpointId endpoint, uint16_t * fastPollTimeoutMax); // int16u +EmberAfStatus SetFastPollTimeoutMax(chip::EndpointId endpoint, uint16_t fastPollTimeoutMax); +} // namespace Attributes +} // namespace PollControl + +namespace Basic { +namespace Attributes { +EmberAfStatus GetInteractionModelVersion(chip::EndpointId endpoint, uint16_t * interactionModelVersion); // int16u +EmberAfStatus SetInteractionModelVersion(chip::EndpointId endpoint, uint16_t interactionModelVersion); +EmberAfStatus GetVendorID(chip::EndpointId endpoint, uint16_t * vendorID); // int16u +EmberAfStatus SetVendorID(chip::EndpointId endpoint, uint16_t vendorID); +EmberAfStatus GetProductID(chip::EndpointId endpoint, uint16_t * productID); // int16u +EmberAfStatus SetProductID(chip::EndpointId endpoint, uint16_t productID); +EmberAfStatus GetHardwareVersion(chip::EndpointId endpoint, uint16_t * hardwareVersion); // int16u +EmberAfStatus SetHardwareVersion(chip::EndpointId endpoint, uint16_t hardwareVersion); +EmberAfStatus GetSoftwareVersion(chip::EndpointId endpoint, uint32_t * softwareVersion); // int32u +EmberAfStatus SetSoftwareVersion(chip::EndpointId endpoint, uint32_t softwareVersion); +EmberAfStatus GetLocalConfigDisabled(chip::EndpointId endpoint, uint8_t * localConfigDisabled); // boolean +EmberAfStatus SetLocalConfigDisabled(chip::EndpointId endpoint, uint8_t localConfigDisabled); +EmberAfStatus GetReachable(chip::EndpointId endpoint, uint8_t * reachable); // boolean +EmberAfStatus SetReachable(chip::EndpointId endpoint, uint8_t reachable); +} // namespace Attributes +} // namespace Basic + +namespace GeneralCommissioning { +namespace Attributes { +EmberAfStatus GetBreadcrumb(chip::EndpointId endpoint, uint64_t * breadcrumb); // int64u +EmberAfStatus SetBreadcrumb(chip::EndpointId endpoint, uint64_t breadcrumb); +} // namespace Attributes +} // namespace GeneralCommissioning + +namespace GeneralDiagnostics { +namespace Attributes { +EmberAfStatus GetRebootCount(chip::EndpointId endpoint, uint16_t * rebootCount); // int16u +EmberAfStatus SetRebootCount(chip::EndpointId endpoint, uint16_t rebootCount); +EmberAfStatus GetUpTime(chip::EndpointId endpoint, uint64_t * upTime); // int64u +EmberAfStatus SetUpTime(chip::EndpointId endpoint, uint64_t upTime); +EmberAfStatus GetTotalOperationalHours(chip::EndpointId endpoint, uint32_t * totalOperationalHours); // int32u +EmberAfStatus SetTotalOperationalHours(chip::EndpointId endpoint, uint32_t totalOperationalHours); +EmberAfStatus GetBootReasons(chip::EndpointId endpoint, uint8_t * bootReasons); // enum8 +EmberAfStatus SetBootReasons(chip::EndpointId endpoint, uint8_t bootReasons); +} // namespace Attributes +} // namespace GeneralDiagnostics + +namespace SoftwareDiagnostics { +namespace Attributes { +EmberAfStatus GetCurrentHeapFree(chip::EndpointId endpoint, uint64_t * currentHeapFree); // int64u +EmberAfStatus SetCurrentHeapFree(chip::EndpointId endpoint, uint64_t currentHeapFree); +EmberAfStatus GetCurrentHeapUsed(chip::EndpointId endpoint, uint64_t * currentHeapUsed); // int64u +EmberAfStatus SetCurrentHeapUsed(chip::EndpointId endpoint, uint64_t currentHeapUsed); +EmberAfStatus GetCurrentHeapHighWatermark(chip::EndpointId endpoint, uint64_t * currentHeapHighWatermark); // int64u +EmberAfStatus SetCurrentHeapHighWatermark(chip::EndpointId endpoint, uint64_t currentHeapHighWatermark); +} // namespace Attributes +} // namespace SoftwareDiagnostics + +namespace ThreadNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetChannel(chip::EndpointId endpoint, uint8_t * channel); // int8u +EmberAfStatus SetChannel(chip::EndpointId endpoint, uint8_t channel); +EmberAfStatus GetRoutingRole(chip::EndpointId endpoint, uint8_t * routingRole); // enum8 +EmberAfStatus SetRoutingRole(chip::EndpointId endpoint, uint8_t routingRole); +EmberAfStatus GetPanId(chip::EndpointId endpoint, uint16_t * panId); // int16u +EmberAfStatus SetPanId(chip::EndpointId endpoint, uint16_t panId); +EmberAfStatus GetExtendedPanId(chip::EndpointId endpoint, uint64_t * extendedPanId); // int64u +EmberAfStatus SetExtendedPanId(chip::EndpointId endpoint, uint64_t extendedPanId); +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount); +EmberAfStatus GetPartitionId(chip::EndpointId endpoint, uint32_t * partitionId); // int32u +EmberAfStatus SetPartitionId(chip::EndpointId endpoint, uint32_t partitionId); +EmberAfStatus GetWeighting(chip::EndpointId endpoint, uint8_t * weighting); // int8u +EmberAfStatus SetWeighting(chip::EndpointId endpoint, uint8_t weighting); +EmberAfStatus GetDataVersion(chip::EndpointId endpoint, uint8_t * dataVersion); // int8u +EmberAfStatus SetDataVersion(chip::EndpointId endpoint, uint8_t dataVersion); +EmberAfStatus GetStableDataVersion(chip::EndpointId endpoint, uint8_t * stableDataVersion); // int8u +EmberAfStatus SetStableDataVersion(chip::EndpointId endpoint, uint8_t stableDataVersion); +EmberAfStatus GetLeaderRouterId(chip::EndpointId endpoint, uint8_t * leaderRouterId); // int8u +EmberAfStatus SetLeaderRouterId(chip::EndpointId endpoint, uint8_t leaderRouterId); +EmberAfStatus GetDetachedRoleCount(chip::EndpointId endpoint, uint16_t * detachedRoleCount); // int16u +EmberAfStatus SetDetachedRoleCount(chip::EndpointId endpoint, uint16_t detachedRoleCount); +EmberAfStatus GetChildRoleCount(chip::EndpointId endpoint, uint16_t * childRoleCount); // int16u +EmberAfStatus SetChildRoleCount(chip::EndpointId endpoint, uint16_t childRoleCount); +EmberAfStatus GetRouterRoleCount(chip::EndpointId endpoint, uint16_t * routerRoleCount); // int16u +EmberAfStatus SetRouterRoleCount(chip::EndpointId endpoint, uint16_t routerRoleCount); +EmberAfStatus GetLeaderRoleCount(chip::EndpointId endpoint, uint16_t * leaderRoleCount); // int16u +EmberAfStatus SetLeaderRoleCount(chip::EndpointId endpoint, uint16_t leaderRoleCount); +EmberAfStatus GetAttachAttemptCount(chip::EndpointId endpoint, uint16_t * attachAttemptCount); // int16u +EmberAfStatus SetAttachAttemptCount(chip::EndpointId endpoint, uint16_t attachAttemptCount); +EmberAfStatus GetPartitionIdChangeCount(chip::EndpointId endpoint, uint16_t * partitionIdChangeCount); // int16u +EmberAfStatus SetPartitionIdChangeCount(chip::EndpointId endpoint, uint16_t partitionIdChangeCount); +EmberAfStatus GetBetterPartitionAttachAttemptCount(chip::EndpointId endpoint, + uint16_t * betterPartitionAttachAttemptCount); // int16u +EmberAfStatus SetBetterPartitionAttachAttemptCount(chip::EndpointId endpoint, uint16_t betterPartitionAttachAttemptCount); +EmberAfStatus GetParentChangeCount(chip::EndpointId endpoint, uint16_t * parentChangeCount); // int16u +EmberAfStatus SetParentChangeCount(chip::EndpointId endpoint, uint16_t parentChangeCount); +EmberAfStatus GetTxTotalCount(chip::EndpointId endpoint, uint32_t * txTotalCount); // int32u +EmberAfStatus SetTxTotalCount(chip::EndpointId endpoint, uint32_t txTotalCount); +EmberAfStatus GetTxUnicastCount(chip::EndpointId endpoint, uint32_t * txUnicastCount); // int32u +EmberAfStatus SetTxUnicastCount(chip::EndpointId endpoint, uint32_t txUnicastCount); +EmberAfStatus GetTxBroadcastCount(chip::EndpointId endpoint, uint32_t * txBroadcastCount); // int32u +EmberAfStatus SetTxBroadcastCount(chip::EndpointId endpoint, uint32_t txBroadcastCount); +EmberAfStatus GetTxAckRequestedCount(chip::EndpointId endpoint, uint32_t * txAckRequestedCount); // int32u +EmberAfStatus SetTxAckRequestedCount(chip::EndpointId endpoint, uint32_t txAckRequestedCount); +EmberAfStatus GetTxAckedCount(chip::EndpointId endpoint, uint32_t * txAckedCount); // int32u +EmberAfStatus SetTxAckedCount(chip::EndpointId endpoint, uint32_t txAckedCount); +EmberAfStatus GetTxNoAckRequestedCount(chip::EndpointId endpoint, uint32_t * txNoAckRequestedCount); // int32u +EmberAfStatus SetTxNoAckRequestedCount(chip::EndpointId endpoint, uint32_t txNoAckRequestedCount); +EmberAfStatus GetTxDataCount(chip::EndpointId endpoint, uint32_t * txDataCount); // int32u +EmberAfStatus SetTxDataCount(chip::EndpointId endpoint, uint32_t txDataCount); +EmberAfStatus GetTxDataPollCount(chip::EndpointId endpoint, uint32_t * txDataPollCount); // int32u +EmberAfStatus SetTxDataPollCount(chip::EndpointId endpoint, uint32_t txDataPollCount); +EmberAfStatus GetTxBeaconCount(chip::EndpointId endpoint, uint32_t * txBeaconCount); // int32u +EmberAfStatus SetTxBeaconCount(chip::EndpointId endpoint, uint32_t txBeaconCount); +EmberAfStatus GetTxBeaconRequestCount(chip::EndpointId endpoint, uint32_t * txBeaconRequestCount); // int32u +EmberAfStatus SetTxBeaconRequestCount(chip::EndpointId endpoint, uint32_t txBeaconRequestCount); +EmberAfStatus GetTxOtherCount(chip::EndpointId endpoint, uint32_t * txOtherCount); // int32u +EmberAfStatus SetTxOtherCount(chip::EndpointId endpoint, uint32_t txOtherCount); +EmberAfStatus GetTxRetryCount(chip::EndpointId endpoint, uint32_t * txRetryCount); // int32u +EmberAfStatus SetTxRetryCount(chip::EndpointId endpoint, uint32_t txRetryCount); +EmberAfStatus GetTxDirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t * txDirectMaxRetryExpiryCount); // int32u +EmberAfStatus SetTxDirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t txDirectMaxRetryExpiryCount); +EmberAfStatus GetTxIndirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t * txIndirectMaxRetryExpiryCount); // int32u +EmberAfStatus SetTxIndirectMaxRetryExpiryCount(chip::EndpointId endpoint, uint32_t txIndirectMaxRetryExpiryCount); +EmberAfStatus GetTxErrCcaCount(chip::EndpointId endpoint, uint32_t * txErrCcaCount); // int32u +EmberAfStatus SetTxErrCcaCount(chip::EndpointId endpoint, uint32_t txErrCcaCount); +EmberAfStatus GetTxErrAbortCount(chip::EndpointId endpoint, uint32_t * txErrAbortCount); // int32u +EmberAfStatus SetTxErrAbortCount(chip::EndpointId endpoint, uint32_t txErrAbortCount); +EmberAfStatus GetTxErrBusyChannelCount(chip::EndpointId endpoint, uint32_t * txErrBusyChannelCount); // int32u +EmberAfStatus SetTxErrBusyChannelCount(chip::EndpointId endpoint, uint32_t txErrBusyChannelCount); +EmberAfStatus GetRxTotalCount(chip::EndpointId endpoint, uint32_t * rxTotalCount); // int32u +EmberAfStatus SetRxTotalCount(chip::EndpointId endpoint, uint32_t rxTotalCount); +EmberAfStatus GetRxUnicastCount(chip::EndpointId endpoint, uint32_t * rxUnicastCount); // int32u +EmberAfStatus SetRxUnicastCount(chip::EndpointId endpoint, uint32_t rxUnicastCount); +EmberAfStatus GetRxBroadcastCount(chip::EndpointId endpoint, uint32_t * rxBroadcastCount); // int32u +EmberAfStatus SetRxBroadcastCount(chip::EndpointId endpoint, uint32_t rxBroadcastCount); +EmberAfStatus GetRxDataCount(chip::EndpointId endpoint, uint32_t * rxDataCount); // int32u +EmberAfStatus SetRxDataCount(chip::EndpointId endpoint, uint32_t rxDataCount); +EmberAfStatus GetRxDataPollCount(chip::EndpointId endpoint, uint32_t * rxDataPollCount); // int32u +EmberAfStatus SetRxDataPollCount(chip::EndpointId endpoint, uint32_t rxDataPollCount); +EmberAfStatus GetRxBeaconCount(chip::EndpointId endpoint, uint32_t * rxBeaconCount); // int32u +EmberAfStatus SetRxBeaconCount(chip::EndpointId endpoint, uint32_t rxBeaconCount); +EmberAfStatus GetRxBeaconRequestCount(chip::EndpointId endpoint, uint32_t * rxBeaconRequestCount); // int32u +EmberAfStatus SetRxBeaconRequestCount(chip::EndpointId endpoint, uint32_t rxBeaconRequestCount); +EmberAfStatus GetRxOtherCount(chip::EndpointId endpoint, uint32_t * rxOtherCount); // int32u +EmberAfStatus SetRxOtherCount(chip::EndpointId endpoint, uint32_t rxOtherCount); +EmberAfStatus GetRxAddressFilteredCount(chip::EndpointId endpoint, uint32_t * rxAddressFilteredCount); // int32u +EmberAfStatus SetRxAddressFilteredCount(chip::EndpointId endpoint, uint32_t rxAddressFilteredCount); +EmberAfStatus GetRxDestAddrFilteredCount(chip::EndpointId endpoint, uint32_t * rxDestAddrFilteredCount); // int32u +EmberAfStatus SetRxDestAddrFilteredCount(chip::EndpointId endpoint, uint32_t rxDestAddrFilteredCount); +EmberAfStatus GetRxDuplicatedCount(chip::EndpointId endpoint, uint32_t * rxDuplicatedCount); // int32u +EmberAfStatus SetRxDuplicatedCount(chip::EndpointId endpoint, uint32_t rxDuplicatedCount); +EmberAfStatus GetRxErrNoFrameCount(chip::EndpointId endpoint, uint32_t * rxErrNoFrameCount); // int32u +EmberAfStatus SetRxErrNoFrameCount(chip::EndpointId endpoint, uint32_t rxErrNoFrameCount); +EmberAfStatus GetRxErrUnknownNeighborCount(chip::EndpointId endpoint, uint32_t * rxErrUnknownNeighborCount); // int32u +EmberAfStatus SetRxErrUnknownNeighborCount(chip::EndpointId endpoint, uint32_t rxErrUnknownNeighborCount); +EmberAfStatus GetRxErrInvalidSrcAddrCount(chip::EndpointId endpoint, uint32_t * rxErrInvalidSrcAddrCount); // int32u +EmberAfStatus SetRxErrInvalidSrcAddrCount(chip::EndpointId endpoint, uint32_t rxErrInvalidSrcAddrCount); +EmberAfStatus GetRxErrSecCount(chip::EndpointId endpoint, uint32_t * rxErrSecCount); // int32u +EmberAfStatus SetRxErrSecCount(chip::EndpointId endpoint, uint32_t rxErrSecCount); +EmberAfStatus GetRxErrFcsCount(chip::EndpointId endpoint, uint32_t * rxErrFcsCount); // int32u +EmberAfStatus SetRxErrFcsCount(chip::EndpointId endpoint, uint32_t rxErrFcsCount); +EmberAfStatus GetRxErrOtherCount(chip::EndpointId endpoint, uint32_t * rxErrOtherCount); // int32u +EmberAfStatus SetRxErrOtherCount(chip::EndpointId endpoint, uint32_t rxErrOtherCount); +EmberAfStatus GetActiveTimestamp(chip::EndpointId endpoint, uint64_t * activeTimestamp); // int64u +EmberAfStatus SetActiveTimestamp(chip::EndpointId endpoint, uint64_t activeTimestamp); +EmberAfStatus GetPendingTimestamp(chip::EndpointId endpoint, uint64_t * pendingTimestamp); // int64u +EmberAfStatus SetPendingTimestamp(chip::EndpointId endpoint, uint64_t pendingTimestamp); +EmberAfStatus GetDelay(chip::EndpointId endpoint, uint32_t * delay); // int32u +EmberAfStatus SetDelay(chip::EndpointId endpoint, uint32_t delay); +EmberAfStatus GetChannelMask(chip::EndpointId endpoint, uint8_t * channelMask); // int8u +EmberAfStatus SetChannelMask(chip::EndpointId endpoint, uint8_t channelMask); +} // namespace Attributes +} // namespace ThreadNetworkDiagnostics + +namespace WiFiNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetSecurityType(chip::EndpointId endpoint, uint8_t * securityType); // enum8 +EmberAfStatus SetSecurityType(chip::EndpointId endpoint, uint8_t securityType); +EmberAfStatus GetWiFiVersion(chip::EndpointId endpoint, uint8_t * wiFiVersion); // enum8 +EmberAfStatus SetWiFiVersion(chip::EndpointId endpoint, uint8_t wiFiVersion); +EmberAfStatus GetChannelNumber(chip::EndpointId endpoint, uint16_t * channelNumber); // int16u +EmberAfStatus SetChannelNumber(chip::EndpointId endpoint, uint16_t channelNumber); +EmberAfStatus GetRssi(chip::EndpointId endpoint, int8_t * rssi); // int8s +EmberAfStatus SetRssi(chip::EndpointId endpoint, int8_t rssi); +EmberAfStatus GetBeaconLostCount(chip::EndpointId endpoint, uint32_t * beaconLostCount); // int32u +EmberAfStatus SetBeaconLostCount(chip::EndpointId endpoint, uint32_t beaconLostCount); +EmberAfStatus GetBeaconRxCount(chip::EndpointId endpoint, uint32_t * beaconRxCount); // int32u +EmberAfStatus SetBeaconRxCount(chip::EndpointId endpoint, uint32_t beaconRxCount); +EmberAfStatus GetPacketMulticastRxCount(chip::EndpointId endpoint, uint32_t * packetMulticastRxCount); // int32u +EmberAfStatus SetPacketMulticastRxCount(chip::EndpointId endpoint, uint32_t packetMulticastRxCount); +EmberAfStatus GetPacketMulticastTxCount(chip::EndpointId endpoint, uint32_t * packetMulticastTxCount); // int32u +EmberAfStatus SetPacketMulticastTxCount(chip::EndpointId endpoint, uint32_t packetMulticastTxCount); +EmberAfStatus GetPacketUnicastRxCount(chip::EndpointId endpoint, uint32_t * packetUnicastRxCount); // int32u +EmberAfStatus SetPacketUnicastRxCount(chip::EndpointId endpoint, uint32_t packetUnicastRxCount); +EmberAfStatus GetPacketUnicastTxCount(chip::EndpointId endpoint, uint32_t * packetUnicastTxCount); // int32u +EmberAfStatus SetPacketUnicastTxCount(chip::EndpointId endpoint, uint32_t packetUnicastTxCount); +EmberAfStatus GetCurrentMaxRate(chip::EndpointId endpoint, uint64_t * currentMaxRate); // int64u +EmberAfStatus SetCurrentMaxRate(chip::EndpointId endpoint, uint64_t currentMaxRate); +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount); +} // namespace Attributes +} // namespace WiFiNetworkDiagnostics + +namespace EthernetNetworkDiagnostics { +namespace Attributes { +EmberAfStatus GetPHYRate(chip::EndpointId endpoint, uint8_t * pHYRate); // enum8 +EmberAfStatus SetPHYRate(chip::EndpointId endpoint, uint8_t pHYRate); +EmberAfStatus GetFullDuplex(chip::EndpointId endpoint, uint8_t * fullDuplex); // boolean +EmberAfStatus SetFullDuplex(chip::EndpointId endpoint, uint8_t fullDuplex); +EmberAfStatus GetPacketRxCount(chip::EndpointId endpoint, uint64_t * packetRxCount); // int64u +EmberAfStatus SetPacketRxCount(chip::EndpointId endpoint, uint64_t packetRxCount); +EmberAfStatus GetPacketTxCount(chip::EndpointId endpoint, uint64_t * packetTxCount); // int64u +EmberAfStatus SetPacketTxCount(chip::EndpointId endpoint, uint64_t packetTxCount); +EmberAfStatus GetTxErrCount(chip::EndpointId endpoint, uint64_t * txErrCount); // int64u +EmberAfStatus SetTxErrCount(chip::EndpointId endpoint, uint64_t txErrCount); +EmberAfStatus GetCollisionCount(chip::EndpointId endpoint, uint64_t * collisionCount); // int64u +EmberAfStatus SetCollisionCount(chip::EndpointId endpoint, uint64_t collisionCount); +EmberAfStatus GetOverrunCount(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u +EmberAfStatus SetOverrunCount(chip::EndpointId endpoint, uint64_t overrunCount); +EmberAfStatus GetCarrierDetect(chip::EndpointId endpoint, uint8_t * carrierDetect); // boolean +EmberAfStatus SetCarrierDetect(chip::EndpointId endpoint, uint8_t carrierDetect); +EmberAfStatus GetTimeSinceReset(chip::EndpointId endpoint, uint64_t * timeSinceReset); // int64u +EmberAfStatus SetTimeSinceReset(chip::EndpointId endpoint, uint64_t timeSinceReset); +} // namespace Attributes +} // namespace EthernetNetworkDiagnostics + +namespace BridgedDeviceBasic { +namespace Attributes { +EmberAfStatus GetVendorID(chip::EndpointId endpoint, uint16_t * vendorID); // int16u +EmberAfStatus SetVendorID(chip::EndpointId endpoint, uint16_t vendorID); +EmberAfStatus GetHardwareVersion(chip::EndpointId endpoint, uint16_t * hardwareVersion); // int16u +EmberAfStatus SetHardwareVersion(chip::EndpointId endpoint, uint16_t hardwareVersion); +EmberAfStatus GetSoftwareVersion(chip::EndpointId endpoint, uint32_t * softwareVersion); // int32u +EmberAfStatus SetSoftwareVersion(chip::EndpointId endpoint, uint32_t softwareVersion); +EmberAfStatus GetReachable(chip::EndpointId endpoint, uint8_t * reachable); // boolean +EmberAfStatus SetReachable(chip::EndpointId endpoint, uint8_t reachable); +} // namespace Attributes +} // namespace BridgedDeviceBasic + +namespace Switch { +namespace Attributes { +EmberAfStatus GetNumberOfPositions(chip::EndpointId endpoint, uint8_t * numberOfPositions); // int8u +EmberAfStatus SetNumberOfPositions(chip::EndpointId endpoint, uint8_t numberOfPositions); +EmberAfStatus GetCurrentPosition(chip::EndpointId endpoint, uint8_t * currentPosition); // int8u +EmberAfStatus SetCurrentPosition(chip::EndpointId endpoint, uint8_t currentPosition); +EmberAfStatus GetMultiPressMax(chip::EndpointId endpoint, uint8_t * multiPressMax); // int8u +EmberAfStatus SetMultiPressMax(chip::EndpointId endpoint, uint8_t multiPressMax); +} // namespace Attributes +} // namespace Switch + +namespace OperationalCredentials { +namespace Attributes { +} // namespace Attributes +} // namespace OperationalCredentials + +namespace FixedLabel { +namespace Attributes { +} // namespace Attributes +} // namespace FixedLabel + +namespace ShadeConfiguration { +namespace Attributes { +EmberAfStatus GetPhysicalClosedLimit(chip::EndpointId endpoint, uint16_t * physicalClosedLimit); // int16u +EmberAfStatus SetPhysicalClosedLimit(chip::EndpointId endpoint, uint16_t physicalClosedLimit); +EmberAfStatus GetMotorStepSize(chip::EndpointId endpoint, uint8_t * motorStepSize); // int8u +EmberAfStatus SetMotorStepSize(chip::EndpointId endpoint, uint8_t motorStepSize); +EmberAfStatus GetStatus(chip::EndpointId endpoint, uint8_t * status); // bitmap8 +EmberAfStatus SetStatus(chip::EndpointId endpoint, uint8_t status); +EmberAfStatus GetClosedLimit(chip::EndpointId endpoint, uint16_t * closedLimit); // int16u +EmberAfStatus SetClosedLimit(chip::EndpointId endpoint, uint16_t closedLimit); +EmberAfStatus GetMode(chip::EndpointId endpoint, uint8_t * mode); // enum8 +EmberAfStatus SetMode(chip::EndpointId endpoint, uint8_t mode); +} // namespace Attributes +} // namespace ShadeConfiguration + +namespace DoorLock { +namespace Attributes { +EmberAfStatus GetLockState(chip::EndpointId endpoint, uint8_t * lockState); // enum8 +EmberAfStatus SetLockState(chip::EndpointId endpoint, uint8_t lockState); +EmberAfStatus GetLockType(chip::EndpointId endpoint, uint8_t * lockType); // enum8 +EmberAfStatus SetLockType(chip::EndpointId endpoint, uint8_t lockType); +EmberAfStatus GetActuatorEnabled(chip::EndpointId endpoint, uint8_t * actuatorEnabled); // boolean +EmberAfStatus SetActuatorEnabled(chip::EndpointId endpoint, uint8_t actuatorEnabled); +EmberAfStatus GetDoorState(chip::EndpointId endpoint, uint8_t * doorState); // enum8 +EmberAfStatus SetDoorState(chip::EndpointId endpoint, uint8_t doorState); +EmberAfStatus GetDoorOpenEvents(chip::EndpointId endpoint, uint32_t * doorOpenEvents); // int32u +EmberAfStatus SetDoorOpenEvents(chip::EndpointId endpoint, uint32_t doorOpenEvents); +EmberAfStatus GetDoorClosedEvents(chip::EndpointId endpoint, uint32_t * doorClosedEvents); // int32u +EmberAfStatus SetDoorClosedEvents(chip::EndpointId endpoint, uint32_t doorClosedEvents); +EmberAfStatus GetOpenPeriod(chip::EndpointId endpoint, uint16_t * openPeriod); // int16u +EmberAfStatus SetOpenPeriod(chip::EndpointId endpoint, uint16_t openPeriod); +EmberAfStatus GetNumLockRecordsSupported(chip::EndpointId endpoint, uint16_t * numLockRecordsSupported); // int16u +EmberAfStatus SetNumLockRecordsSupported(chip::EndpointId endpoint, uint16_t numLockRecordsSupported); +EmberAfStatus GetNumTotalUsersSupported(chip::EndpointId endpoint, uint16_t * numTotalUsersSupported); // int16u +EmberAfStatus SetNumTotalUsersSupported(chip::EndpointId endpoint, uint16_t numTotalUsersSupported); +EmberAfStatus GetNumPinUsersSupported(chip::EndpointId endpoint, uint16_t * numPinUsersSupported); // int16u +EmberAfStatus SetNumPinUsersSupported(chip::EndpointId endpoint, uint16_t numPinUsersSupported); +EmberAfStatus GetNumRfidUsersSupported(chip::EndpointId endpoint, uint16_t * numRfidUsersSupported); // int16u +EmberAfStatus SetNumRfidUsersSupported(chip::EndpointId endpoint, uint16_t numRfidUsersSupported); +EmberAfStatus GetNumWeekdaySchedulesSupportedPerUser(chip::EndpointId endpoint, + uint8_t * numWeekdaySchedulesSupportedPerUser); // int8u +EmberAfStatus SetNumWeekdaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numWeekdaySchedulesSupportedPerUser); +EmberAfStatus GetNumYeardaySchedulesSupportedPerUser(chip::EndpointId endpoint, + uint8_t * numYeardaySchedulesSupportedPerUser); // int8u +EmberAfStatus SetNumYeardaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numYeardaySchedulesSupportedPerUser); +EmberAfStatus GetNumHolidaySchedulesSupportedPerUser(chip::EndpointId endpoint, + uint8_t * numHolidaySchedulesSupportedPerUser); // int8u +EmberAfStatus SetNumHolidaySchedulesSupportedPerUser(chip::EndpointId endpoint, uint8_t numHolidaySchedulesSupportedPerUser); +EmberAfStatus GetMaxPinLength(chip::EndpointId endpoint, uint8_t * maxPinLength); // int8u +EmberAfStatus SetMaxPinLength(chip::EndpointId endpoint, uint8_t maxPinLength); +EmberAfStatus GetMinPinLength(chip::EndpointId endpoint, uint8_t * minPinLength); // int8u +EmberAfStatus SetMinPinLength(chip::EndpointId endpoint, uint8_t minPinLength); +EmberAfStatus GetMaxRfidCodeLength(chip::EndpointId endpoint, uint8_t * maxRfidCodeLength); // int8u +EmberAfStatus SetMaxRfidCodeLength(chip::EndpointId endpoint, uint8_t maxRfidCodeLength); +EmberAfStatus GetMinRfidCodeLength(chip::EndpointId endpoint, uint8_t * minRfidCodeLength); // int8u +EmberAfStatus SetMinRfidCodeLength(chip::EndpointId endpoint, uint8_t minRfidCodeLength); +EmberAfStatus GetEnableLogging(chip::EndpointId endpoint, uint8_t * enableLogging); // boolean +EmberAfStatus SetEnableLogging(chip::EndpointId endpoint, uint8_t enableLogging); +EmberAfStatus GetLedSettings(chip::EndpointId endpoint, uint8_t * ledSettings); // int8u +EmberAfStatus SetLedSettings(chip::EndpointId endpoint, uint8_t ledSettings); +EmberAfStatus GetAutoRelockTime(chip::EndpointId endpoint, uint32_t * autoRelockTime); // int32u +EmberAfStatus SetAutoRelockTime(chip::EndpointId endpoint, uint32_t autoRelockTime); +EmberAfStatus GetSoundVolume(chip::EndpointId endpoint, uint8_t * soundVolume); // int8u +EmberAfStatus SetSoundVolume(chip::EndpointId endpoint, uint8_t soundVolume); +EmberAfStatus GetOperatingMode(chip::EndpointId endpoint, uint8_t * operatingMode); // enum8 +EmberAfStatus SetOperatingMode(chip::EndpointId endpoint, uint8_t operatingMode); +EmberAfStatus GetSupportedOperatingModes(chip::EndpointId endpoint, uint16_t * supportedOperatingModes); // bitmap16 +EmberAfStatus SetSupportedOperatingModes(chip::EndpointId endpoint, uint16_t supportedOperatingModes); +EmberAfStatus GetDefaultConfigurationRegister(chip::EndpointId endpoint, uint16_t * defaultConfigurationRegister); // bitmap16 +EmberAfStatus SetDefaultConfigurationRegister(chip::EndpointId endpoint, uint16_t defaultConfigurationRegister); +EmberAfStatus GetEnableLocalProgramming(chip::EndpointId endpoint, uint8_t * enableLocalProgramming); // boolean +EmberAfStatus SetEnableLocalProgramming(chip::EndpointId endpoint, uint8_t enableLocalProgramming); +EmberAfStatus GetEnableOneTouchLocking(chip::EndpointId endpoint, uint8_t * enableOneTouchLocking); // boolean +EmberAfStatus SetEnableOneTouchLocking(chip::EndpointId endpoint, uint8_t enableOneTouchLocking); +EmberAfStatus GetEnableInsideStatusLed(chip::EndpointId endpoint, uint8_t * enableInsideStatusLed); // boolean +EmberAfStatus SetEnableInsideStatusLed(chip::EndpointId endpoint, uint8_t enableInsideStatusLed); +EmberAfStatus GetEnablePrivacyModeButton(chip::EndpointId endpoint, uint8_t * enablePrivacyModeButton); // boolean +EmberAfStatus SetEnablePrivacyModeButton(chip::EndpointId endpoint, uint8_t enablePrivacyModeButton); +EmberAfStatus GetWrongCodeEntryLimit(chip::EndpointId endpoint, uint8_t * wrongCodeEntryLimit); // int8u +EmberAfStatus SetWrongCodeEntryLimit(chip::EndpointId endpoint, uint8_t wrongCodeEntryLimit); +EmberAfStatus GetUserCodeTemporaryDisableTime(chip::EndpointId endpoint, uint8_t * userCodeTemporaryDisableTime); // int8u +EmberAfStatus SetUserCodeTemporaryDisableTime(chip::EndpointId endpoint, uint8_t userCodeTemporaryDisableTime); +EmberAfStatus GetSendPinOverTheAir(chip::EndpointId endpoint, uint8_t * sendPinOverTheAir); // boolean +EmberAfStatus SetSendPinOverTheAir(chip::EndpointId endpoint, uint8_t sendPinOverTheAir); +EmberAfStatus GetRequirePinForRfOperation(chip::EndpointId endpoint, uint8_t * requirePinForRfOperation); // boolean +EmberAfStatus SetRequirePinForRfOperation(chip::EndpointId endpoint, uint8_t requirePinForRfOperation); +EmberAfStatus GetZigbeeSecurityLevel(chip::EndpointId endpoint, uint8_t * zigbeeSecurityLevel); // enum8 +EmberAfStatus SetZigbeeSecurityLevel(chip::EndpointId endpoint, uint8_t zigbeeSecurityLevel); +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint16_t * alarmMask); // bitmap16 +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint16_t alarmMask); +EmberAfStatus GetKeypadOperationEventMask(chip::EndpointId endpoint, uint16_t * keypadOperationEventMask); // bitmap16 +EmberAfStatus SetKeypadOperationEventMask(chip::EndpointId endpoint, uint16_t keypadOperationEventMask); +EmberAfStatus GetRfOperationEventMask(chip::EndpointId endpoint, uint16_t * rfOperationEventMask); // bitmap16 +EmberAfStatus SetRfOperationEventMask(chip::EndpointId endpoint, uint16_t rfOperationEventMask); +EmberAfStatus GetManualOperationEventMask(chip::EndpointId endpoint, uint16_t * manualOperationEventMask); // bitmap16 +EmberAfStatus SetManualOperationEventMask(chip::EndpointId endpoint, uint16_t manualOperationEventMask); +EmberAfStatus GetRfidOperationEventMask(chip::EndpointId endpoint, uint16_t * rfidOperationEventMask); // bitmap16 +EmberAfStatus SetRfidOperationEventMask(chip::EndpointId endpoint, uint16_t rfidOperationEventMask); +EmberAfStatus GetKeypadProgrammingEventMask(chip::EndpointId endpoint, uint16_t * keypadProgrammingEventMask); // bitmap16 +EmberAfStatus SetKeypadProgrammingEventMask(chip::EndpointId endpoint, uint16_t keypadProgrammingEventMask); +EmberAfStatus GetRfProgrammingEventMask(chip::EndpointId endpoint, uint16_t * rfProgrammingEventMask); // bitmap16 +EmberAfStatus SetRfProgrammingEventMask(chip::EndpointId endpoint, uint16_t rfProgrammingEventMask); +EmberAfStatus GetRfidProgrammingEventMask(chip::EndpointId endpoint, uint16_t * rfidProgrammingEventMask); // bitmap16 +EmberAfStatus SetRfidProgrammingEventMask(chip::EndpointId endpoint, uint16_t rfidProgrammingEventMask); +} // namespace Attributes +} // namespace DoorLock + +namespace WindowCovering { +namespace Attributes { +EmberAfStatus GetType(chip::EndpointId endpoint, uint8_t * type); // enum8 +EmberAfStatus SetType(chip::EndpointId endpoint, uint8_t type); +EmberAfStatus GetPhysicalClosedLimitLift(chip::EndpointId endpoint, uint16_t * physicalClosedLimitLift); // int16u +EmberAfStatus SetPhysicalClosedLimitLift(chip::EndpointId endpoint, uint16_t physicalClosedLimitLift); +EmberAfStatus GetPhysicalClosedLimitTilt(chip::EndpointId endpoint, uint16_t * physicalClosedLimitTilt); // int16u +EmberAfStatus SetPhysicalClosedLimitTilt(chip::EndpointId endpoint, uint16_t physicalClosedLimitTilt); +EmberAfStatus GetCurrentPositionLift(chip::EndpointId endpoint, uint16_t * currentPositionLift); // int16u +EmberAfStatus SetCurrentPositionLift(chip::EndpointId endpoint, uint16_t currentPositionLift); +EmberAfStatus GetCurrentPositionTilt(chip::EndpointId endpoint, uint16_t * currentPositionTilt); // int16u +EmberAfStatus SetCurrentPositionTilt(chip::EndpointId endpoint, uint16_t currentPositionTilt); +EmberAfStatus GetNumberOfActuationsLift(chip::EndpointId endpoint, uint16_t * numberOfActuationsLift); // int16u +EmberAfStatus SetNumberOfActuationsLift(chip::EndpointId endpoint, uint16_t numberOfActuationsLift); +EmberAfStatus GetNumberOfActuationsTilt(chip::EndpointId endpoint, uint16_t * numberOfActuationsTilt); // int16u +EmberAfStatus SetNumberOfActuationsTilt(chip::EndpointId endpoint, uint16_t numberOfActuationsTilt); +EmberAfStatus GetConfigStatus(chip::EndpointId endpoint, uint8_t * configStatus); // bitmap8 +EmberAfStatus SetConfigStatus(chip::EndpointId endpoint, uint8_t configStatus); +EmberAfStatus GetCurrentPositionLiftPercentage(chip::EndpointId endpoint, uint8_t * currentPositionLiftPercentage); // int8u +EmberAfStatus SetCurrentPositionLiftPercentage(chip::EndpointId endpoint, uint8_t currentPositionLiftPercentage); +EmberAfStatus GetCurrentPositionTiltPercentage(chip::EndpointId endpoint, uint8_t * currentPositionTiltPercentage); // int8u +EmberAfStatus SetCurrentPositionTiltPercentage(chip::EndpointId endpoint, uint8_t currentPositionTiltPercentage); +EmberAfStatus GetOperationalStatus(chip::EndpointId endpoint, uint8_t * operationalStatus); // bitmap8 +EmberAfStatus SetOperationalStatus(chip::EndpointId endpoint, uint8_t operationalStatus); +EmberAfStatus GetTargetPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t * targetPositionLiftPercent100ths); // int16u +EmberAfStatus SetTargetPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t targetPositionLiftPercent100ths); +EmberAfStatus GetTargetPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t * targetPositionTiltPercent100ths); // int16u +EmberAfStatus SetTargetPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t targetPositionTiltPercent100ths); +EmberAfStatus GetEndProductType(chip::EndpointId endpoint, uint8_t * endProductType); // enum8 +EmberAfStatus SetEndProductType(chip::EndpointId endpoint, uint8_t endProductType); +EmberAfStatus GetCurrentPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t * currentPositionLiftPercent100ths); // int16u +EmberAfStatus SetCurrentPositionLiftPercent100ths(chip::EndpointId endpoint, uint16_t currentPositionLiftPercent100ths); +EmberAfStatus GetCurrentPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t * currentPositionTiltPercent100ths); // int16u +EmberAfStatus SetCurrentPositionTiltPercent100ths(chip::EndpointId endpoint, uint16_t currentPositionTiltPercent100ths); +EmberAfStatus GetInstalledOpenLimitLift(chip::EndpointId endpoint, uint16_t * installedOpenLimitLift); // int16u +EmberAfStatus SetInstalledOpenLimitLift(chip::EndpointId endpoint, uint16_t installedOpenLimitLift); +EmberAfStatus GetInstalledClosedLimitLift(chip::EndpointId endpoint, uint16_t * installedClosedLimitLift); // int16u +EmberAfStatus SetInstalledClosedLimitLift(chip::EndpointId endpoint, uint16_t installedClosedLimitLift); +EmberAfStatus GetInstalledOpenLimitTilt(chip::EndpointId endpoint, uint16_t * installedOpenLimitTilt); // int16u +EmberAfStatus SetInstalledOpenLimitTilt(chip::EndpointId endpoint, uint16_t installedOpenLimitTilt); +EmberAfStatus GetInstalledClosedLimitTilt(chip::EndpointId endpoint, uint16_t * installedClosedLimitTilt); // int16u +EmberAfStatus SetInstalledClosedLimitTilt(chip::EndpointId endpoint, uint16_t installedClosedLimitTilt); +EmberAfStatus GetVelocityLift(chip::EndpointId endpoint, uint16_t * velocityLift); // int16u +EmberAfStatus SetVelocityLift(chip::EndpointId endpoint, uint16_t velocityLift); +EmberAfStatus GetAccelerationTimeLift(chip::EndpointId endpoint, uint16_t * accelerationTimeLift); // int16u +EmberAfStatus SetAccelerationTimeLift(chip::EndpointId endpoint, uint16_t accelerationTimeLift); +EmberAfStatus GetDecelerationTimeLift(chip::EndpointId endpoint, uint16_t * decelerationTimeLift); // int16u +EmberAfStatus SetDecelerationTimeLift(chip::EndpointId endpoint, uint16_t decelerationTimeLift); +EmberAfStatus GetMode(chip::EndpointId endpoint, uint8_t * mode); // bitmap8 +EmberAfStatus SetMode(chip::EndpointId endpoint, uint8_t mode); +EmberAfStatus GetSafetyStatus(chip::EndpointId endpoint, uint16_t * safetyStatus); // bitmap16 +EmberAfStatus SetSafetyStatus(chip::EndpointId endpoint, uint16_t safetyStatus); +} // namespace Attributes +} // namespace WindowCovering + +namespace BarrierControl { +namespace Attributes { +EmberAfStatus GetBarrierMovingState(chip::EndpointId endpoint, uint8_t * barrierMovingState); // enum8 +EmberAfStatus SetBarrierMovingState(chip::EndpointId endpoint, uint8_t barrierMovingState); +EmberAfStatus GetBarrierSafetyStatus(chip::EndpointId endpoint, uint16_t * barrierSafetyStatus); // bitmap16 +EmberAfStatus SetBarrierSafetyStatus(chip::EndpointId endpoint, uint16_t barrierSafetyStatus); +EmberAfStatus GetBarrierCapabilities(chip::EndpointId endpoint, uint8_t * barrierCapabilities); // bitmap8 +EmberAfStatus SetBarrierCapabilities(chip::EndpointId endpoint, uint8_t barrierCapabilities); +EmberAfStatus GetBarrierOpenEvents(chip::EndpointId endpoint, uint16_t * barrierOpenEvents); // int16u +EmberAfStatus SetBarrierOpenEvents(chip::EndpointId endpoint, uint16_t barrierOpenEvents); +EmberAfStatus GetBarrierCloseEvents(chip::EndpointId endpoint, uint16_t * barrierCloseEvents); // int16u +EmberAfStatus SetBarrierCloseEvents(chip::EndpointId endpoint, uint16_t barrierCloseEvents); +EmberAfStatus GetBarrierCommandOpenEvents(chip::EndpointId endpoint, uint16_t * barrierCommandOpenEvents); // int16u +EmberAfStatus SetBarrierCommandOpenEvents(chip::EndpointId endpoint, uint16_t barrierCommandOpenEvents); +EmberAfStatus GetBarrierCommandCloseEvents(chip::EndpointId endpoint, uint16_t * barrierCommandCloseEvents); // int16u +EmberAfStatus SetBarrierCommandCloseEvents(chip::EndpointId endpoint, uint16_t barrierCommandCloseEvents); +EmberAfStatus GetBarrierOpenPeriod(chip::EndpointId endpoint, uint16_t * barrierOpenPeriod); // int16u +EmberAfStatus SetBarrierOpenPeriod(chip::EndpointId endpoint, uint16_t barrierOpenPeriod); +EmberAfStatus GetBarrierClosePeriod(chip::EndpointId endpoint, uint16_t * barrierClosePeriod); // int16u +EmberAfStatus SetBarrierClosePeriod(chip::EndpointId endpoint, uint16_t barrierClosePeriod); +EmberAfStatus GetBarrierPosition(chip::EndpointId endpoint, uint8_t * barrierPosition); // int8u +EmberAfStatus SetBarrierPosition(chip::EndpointId endpoint, uint8_t barrierPosition); +} // namespace Attributes +} // namespace BarrierControl + +namespace PumpConfigurationAndControl { +namespace Attributes { +EmberAfStatus GetMaxPressure(chip::EndpointId endpoint, int16_t * maxPressure); // int16s +EmberAfStatus SetMaxPressure(chip::EndpointId endpoint, int16_t maxPressure); +EmberAfStatus GetMaxSpeed(chip::EndpointId endpoint, uint16_t * maxSpeed); // int16u +EmberAfStatus SetMaxSpeed(chip::EndpointId endpoint, uint16_t maxSpeed); +EmberAfStatus GetMaxFlow(chip::EndpointId endpoint, uint16_t * maxFlow); // int16u +EmberAfStatus SetMaxFlow(chip::EndpointId endpoint, uint16_t maxFlow); +EmberAfStatus GetMinConstPressure(chip::EndpointId endpoint, int16_t * minConstPressure); // int16s +EmberAfStatus SetMinConstPressure(chip::EndpointId endpoint, int16_t minConstPressure); +EmberAfStatus GetMaxConstPressure(chip::EndpointId endpoint, int16_t * maxConstPressure); // int16s +EmberAfStatus SetMaxConstPressure(chip::EndpointId endpoint, int16_t maxConstPressure); +EmberAfStatus GetMinCompPressure(chip::EndpointId endpoint, int16_t * minCompPressure); // int16s +EmberAfStatus SetMinCompPressure(chip::EndpointId endpoint, int16_t minCompPressure); +EmberAfStatus GetMaxCompPressure(chip::EndpointId endpoint, int16_t * maxCompPressure); // int16s +EmberAfStatus SetMaxCompPressure(chip::EndpointId endpoint, int16_t maxCompPressure); +EmberAfStatus GetMinConstSpeed(chip::EndpointId endpoint, uint16_t * minConstSpeed); // int16u +EmberAfStatus SetMinConstSpeed(chip::EndpointId endpoint, uint16_t minConstSpeed); +EmberAfStatus GetMaxConstSpeed(chip::EndpointId endpoint, uint16_t * maxConstSpeed); // int16u +EmberAfStatus SetMaxConstSpeed(chip::EndpointId endpoint, uint16_t maxConstSpeed); +EmberAfStatus GetMinConstFlow(chip::EndpointId endpoint, uint16_t * minConstFlow); // int16u +EmberAfStatus SetMinConstFlow(chip::EndpointId endpoint, uint16_t minConstFlow); +EmberAfStatus GetMaxConstFlow(chip::EndpointId endpoint, uint16_t * maxConstFlow); // int16u +EmberAfStatus SetMaxConstFlow(chip::EndpointId endpoint, uint16_t maxConstFlow); +EmberAfStatus GetMinConstTemp(chip::EndpointId endpoint, int16_t * minConstTemp); // int16s +EmberAfStatus SetMinConstTemp(chip::EndpointId endpoint, int16_t minConstTemp); +EmberAfStatus GetMaxConstTemp(chip::EndpointId endpoint, int16_t * maxConstTemp); // int16s +EmberAfStatus SetMaxConstTemp(chip::EndpointId endpoint, int16_t maxConstTemp); +EmberAfStatus GetPumpStatus(chip::EndpointId endpoint, uint16_t * pumpStatus); // bitmap16 +EmberAfStatus SetPumpStatus(chip::EndpointId endpoint, uint16_t pumpStatus); +EmberAfStatus GetEffectiveOperationMode(chip::EndpointId endpoint, uint8_t * effectiveOperationMode); // enum8 +EmberAfStatus SetEffectiveOperationMode(chip::EndpointId endpoint, uint8_t effectiveOperationMode); +EmberAfStatus GetEffectiveControlMode(chip::EndpointId endpoint, uint8_t * effectiveControlMode); // enum8 +EmberAfStatus SetEffectiveControlMode(chip::EndpointId endpoint, uint8_t effectiveControlMode); +EmberAfStatus GetCapacity(chip::EndpointId endpoint, int16_t * capacity); // int16s +EmberAfStatus SetCapacity(chip::EndpointId endpoint, int16_t capacity); +EmberAfStatus GetSpeed(chip::EndpointId endpoint, uint16_t * speed); // int16u +EmberAfStatus SetSpeed(chip::EndpointId endpoint, uint16_t speed); +EmberAfStatus GetLifetimeEnergyConsumed(chip::EndpointId endpoint, uint32_t * lifetimeEnergyConsumed); // int32u +EmberAfStatus SetLifetimeEnergyConsumed(chip::EndpointId endpoint, uint32_t lifetimeEnergyConsumed); +EmberAfStatus GetOperationMode(chip::EndpointId endpoint, uint8_t * operationMode); // enum8 +EmberAfStatus SetOperationMode(chip::EndpointId endpoint, uint8_t operationMode); +EmberAfStatus GetControlMode(chip::EndpointId endpoint, uint8_t * controlMode); // enum8 +EmberAfStatus SetControlMode(chip::EndpointId endpoint, uint8_t controlMode); +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint16_t * alarmMask); // bitmap16 +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint16_t alarmMask); +} // namespace Attributes +} // namespace PumpConfigurationAndControl + +namespace Thermostat { +namespace Attributes { +EmberAfStatus GetLocalTemperature(chip::EndpointId endpoint, int16_t * localTemperature); // int16s +EmberAfStatus SetLocalTemperature(chip::EndpointId endpoint, int16_t localTemperature); +EmberAfStatus GetOutdoorTemperature(chip::EndpointId endpoint, int16_t * outdoorTemperature); // int16s +EmberAfStatus SetOutdoorTemperature(chip::EndpointId endpoint, int16_t outdoorTemperature); +EmberAfStatus GetOccupancy(chip::EndpointId endpoint, uint8_t * occupancy); // bitmap8 +EmberAfStatus SetOccupancy(chip::EndpointId endpoint, uint8_t occupancy); +EmberAfStatus GetAbsMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t * absMinHeatSetpointLimit); // int16s +EmberAfStatus SetAbsMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t absMinHeatSetpointLimit); +EmberAfStatus GetAbsMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t * absMaxHeatSetpointLimit); // int16s +EmberAfStatus SetAbsMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t absMaxHeatSetpointLimit); +EmberAfStatus GetAbsMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t * absMinCoolSetpointLimit); // int16s +EmberAfStatus SetAbsMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t absMinCoolSetpointLimit); +EmberAfStatus GetAbsMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t * absMaxCoolSetpointLimit); // int16s +EmberAfStatus SetAbsMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t absMaxCoolSetpointLimit); +EmberAfStatus GetPiCoolingDemand(chip::EndpointId endpoint, uint8_t * piCoolingDemand); // int8u +EmberAfStatus SetPiCoolingDemand(chip::EndpointId endpoint, uint8_t piCoolingDemand); +EmberAfStatus GetPiHeatingDemand(chip::EndpointId endpoint, uint8_t * piHeatingDemand); // int8u +EmberAfStatus SetPiHeatingDemand(chip::EndpointId endpoint, uint8_t piHeatingDemand); +EmberAfStatus GetHvacSystemTypeConfiguration(chip::EndpointId endpoint, uint8_t * hvacSystemTypeConfiguration); // bitmap8 +EmberAfStatus SetHvacSystemTypeConfiguration(chip::EndpointId endpoint, uint8_t hvacSystemTypeConfiguration); +EmberAfStatus GetLocalTemperatureCalibration(chip::EndpointId endpoint, int8_t * localTemperatureCalibration); // int8s +EmberAfStatus SetLocalTemperatureCalibration(chip::EndpointId endpoint, int8_t localTemperatureCalibration); +EmberAfStatus GetOccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t * occupiedCoolingSetpoint); // int16s +EmberAfStatus SetOccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t occupiedCoolingSetpoint); +EmberAfStatus GetOccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t * occupiedHeatingSetpoint); // int16s +EmberAfStatus SetOccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t occupiedHeatingSetpoint); +EmberAfStatus GetUnoccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t * unoccupiedCoolingSetpoint); // int16s +EmberAfStatus SetUnoccupiedCoolingSetpoint(chip::EndpointId endpoint, int16_t unoccupiedCoolingSetpoint); +EmberAfStatus GetUnoccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t * unoccupiedHeatingSetpoint); // int16s +EmberAfStatus SetUnoccupiedHeatingSetpoint(chip::EndpointId endpoint, int16_t unoccupiedHeatingSetpoint); +EmberAfStatus GetMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t * minHeatSetpointLimit); // int16s +EmberAfStatus SetMinHeatSetpointLimit(chip::EndpointId endpoint, int16_t minHeatSetpointLimit); +EmberAfStatus GetMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t * maxHeatSetpointLimit); // int16s +EmberAfStatus SetMaxHeatSetpointLimit(chip::EndpointId endpoint, int16_t maxHeatSetpointLimit); +EmberAfStatus GetMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t * minCoolSetpointLimit); // int16s +EmberAfStatus SetMinCoolSetpointLimit(chip::EndpointId endpoint, int16_t minCoolSetpointLimit); +EmberAfStatus GetMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t * maxCoolSetpointLimit); // int16s +EmberAfStatus SetMaxCoolSetpointLimit(chip::EndpointId endpoint, int16_t maxCoolSetpointLimit); +EmberAfStatus GetMinSetpointDeadBand(chip::EndpointId endpoint, int8_t * minSetpointDeadBand); // int8s +EmberAfStatus SetMinSetpointDeadBand(chip::EndpointId endpoint, int8_t minSetpointDeadBand); +EmberAfStatus GetRemoteSensing(chip::EndpointId endpoint, uint8_t * remoteSensing); // bitmap8 +EmberAfStatus SetRemoteSensing(chip::EndpointId endpoint, uint8_t remoteSensing); +EmberAfStatus GetControlSequenceOfOperation(chip::EndpointId endpoint, uint8_t * controlSequenceOfOperation); // enum8 +EmberAfStatus SetControlSequenceOfOperation(chip::EndpointId endpoint, uint8_t controlSequenceOfOperation); +EmberAfStatus GetSystemMode(chip::EndpointId endpoint, uint8_t * systemMode); // enum8 +EmberAfStatus SetSystemMode(chip::EndpointId endpoint, uint8_t systemMode); +EmberAfStatus GetAlarmMask(chip::EndpointId endpoint, uint8_t * alarmMask); // bitmap8 +EmberAfStatus SetAlarmMask(chip::EndpointId endpoint, uint8_t alarmMask); +EmberAfStatus GetThermostatRunningMode(chip::EndpointId endpoint, uint8_t * thermostatRunningMode); // enum8 +EmberAfStatus SetThermostatRunningMode(chip::EndpointId endpoint, uint8_t thermostatRunningMode); +EmberAfStatus GetStartOfWeek(chip::EndpointId endpoint, uint8_t * startOfWeek); // enum8 +EmberAfStatus SetStartOfWeek(chip::EndpointId endpoint, uint8_t startOfWeek); +EmberAfStatus GetNumberOfWeeklyTransitions(chip::EndpointId endpoint, uint8_t * numberOfWeeklyTransitions); // int8u +EmberAfStatus SetNumberOfWeeklyTransitions(chip::EndpointId endpoint, uint8_t numberOfWeeklyTransitions); +EmberAfStatus GetNumberOfDailyTransitions(chip::EndpointId endpoint, uint8_t * numberOfDailyTransitions); // int8u +EmberAfStatus SetNumberOfDailyTransitions(chip::EndpointId endpoint, uint8_t numberOfDailyTransitions); +EmberAfStatus GetTemperatureSetpointHold(chip::EndpointId endpoint, uint8_t * temperatureSetpointHold); // enum8 +EmberAfStatus SetTemperatureSetpointHold(chip::EndpointId endpoint, uint8_t temperatureSetpointHold); +EmberAfStatus GetTemperatureSetpointHoldDuration(chip::EndpointId endpoint, uint16_t * temperatureSetpointHoldDuration); // int16u +EmberAfStatus SetTemperatureSetpointHoldDuration(chip::EndpointId endpoint, uint16_t temperatureSetpointHoldDuration); +EmberAfStatus GetThermostatProgrammingOperationMode(chip::EndpointId endpoint, + uint8_t * thermostatProgrammingOperationMode); // bitmap8 +EmberAfStatus SetThermostatProgrammingOperationMode(chip::EndpointId endpoint, uint8_t thermostatProgrammingOperationMode); +EmberAfStatus GetHvacRelayState(chip::EndpointId endpoint, uint16_t * hvacRelayState); // bitmap16 +EmberAfStatus SetHvacRelayState(chip::EndpointId endpoint, uint16_t hvacRelayState); +EmberAfStatus GetSetpointChangeSource(chip::EndpointId endpoint, uint8_t * setpointChangeSource); // enum8 +EmberAfStatus SetSetpointChangeSource(chip::EndpointId endpoint, uint8_t setpointChangeSource); +EmberAfStatus GetSetpointChangeAmount(chip::EndpointId endpoint, int16_t * setpointChangeAmount); // int16s +EmberAfStatus SetSetpointChangeAmount(chip::EndpointId endpoint, int16_t setpointChangeAmount); +EmberAfStatus GetSetpointChangeSourceTimestamp(chip::EndpointId endpoint, + /* TYPE WARNING: utc defaults to */ uint8_t ** setpointChangeSourceTimestamp); // utc +EmberAfStatus SetSetpointChangeSourceTimestamp(chip::EndpointId endpoint, + /* TYPE WARNING: utc defaults to */ uint8_t * setpointChangeSourceTimestamp); +EmberAfStatus GetAcType(chip::EndpointId endpoint, uint8_t * acType); // enum8 +EmberAfStatus SetAcType(chip::EndpointId endpoint, uint8_t acType); +EmberAfStatus GetAcCapacity(chip::EndpointId endpoint, uint16_t * acCapacity); // int16u +EmberAfStatus SetAcCapacity(chip::EndpointId endpoint, uint16_t acCapacity); +EmberAfStatus GetAcRefrigerantType(chip::EndpointId endpoint, uint8_t * acRefrigerantType); // enum8 +EmberAfStatus SetAcRefrigerantType(chip::EndpointId endpoint, uint8_t acRefrigerantType); +EmberAfStatus GetAcCompressor(chip::EndpointId endpoint, uint8_t * acCompressor); // enum8 +EmberAfStatus SetAcCompressor(chip::EndpointId endpoint, uint8_t acCompressor); +EmberAfStatus GetAcErrorCode(chip::EndpointId endpoint, uint32_t * acErrorCode); // bitmap32 +EmberAfStatus SetAcErrorCode(chip::EndpointId endpoint, uint32_t acErrorCode); +EmberAfStatus GetAcLouverPosition(chip::EndpointId endpoint, uint8_t * acLouverPosition); // enum8 +EmberAfStatus SetAcLouverPosition(chip::EndpointId endpoint, uint8_t acLouverPosition); +EmberAfStatus GetAcCoilTemperature(chip::EndpointId endpoint, int16_t * acCoilTemperature); // int16s +EmberAfStatus SetAcCoilTemperature(chip::EndpointId endpoint, int16_t acCoilTemperature); +EmberAfStatus GetAcCapacityFormat(chip::EndpointId endpoint, uint8_t * acCapacityFormat); // enum8 +EmberAfStatus SetAcCapacityFormat(chip::EndpointId endpoint, uint8_t acCapacityFormat); +} // namespace Attributes +} // namespace Thermostat + +namespace FanControl { +namespace Attributes { +EmberAfStatus GetFanMode(chip::EndpointId endpoint, uint8_t * fanMode); // enum8 +EmberAfStatus SetFanMode(chip::EndpointId endpoint, uint8_t fanMode); +EmberAfStatus GetFanModeSequence(chip::EndpointId endpoint, uint8_t * fanModeSequence); // enum8 +EmberAfStatus SetFanModeSequence(chip::EndpointId endpoint, uint8_t fanModeSequence); +} // namespace Attributes +} // namespace FanControl + +namespace DehumidificationControl { +namespace Attributes { +EmberAfStatus GetRelativeHumidity(chip::EndpointId endpoint, uint8_t * relativeHumidity); // int8u +EmberAfStatus SetRelativeHumidity(chip::EndpointId endpoint, uint8_t relativeHumidity); +EmberAfStatus GetDehumidificationCooling(chip::EndpointId endpoint, uint8_t * dehumidificationCooling); // int8u +EmberAfStatus SetDehumidificationCooling(chip::EndpointId endpoint, uint8_t dehumidificationCooling); +EmberAfStatus GetRhDehumidificationSetpoint(chip::EndpointId endpoint, uint8_t * rhDehumidificationSetpoint); // int8u +EmberAfStatus SetRhDehumidificationSetpoint(chip::EndpointId endpoint, uint8_t rhDehumidificationSetpoint); +EmberAfStatus GetRelativeHumidityMode(chip::EndpointId endpoint, uint8_t * relativeHumidityMode); // enum8 +EmberAfStatus SetRelativeHumidityMode(chip::EndpointId endpoint, uint8_t relativeHumidityMode); +EmberAfStatus GetDehumidificationLockout(chip::EndpointId endpoint, uint8_t * dehumidificationLockout); // enum8 +EmberAfStatus SetDehumidificationLockout(chip::EndpointId endpoint, uint8_t dehumidificationLockout); +EmberAfStatus GetDehumidificationHysteresis(chip::EndpointId endpoint, uint8_t * dehumidificationHysteresis); // int8u +EmberAfStatus SetDehumidificationHysteresis(chip::EndpointId endpoint, uint8_t dehumidificationHysteresis); +EmberAfStatus GetDehumidificationMaxCool(chip::EndpointId endpoint, uint8_t * dehumidificationMaxCool); // int8u +EmberAfStatus SetDehumidificationMaxCool(chip::EndpointId endpoint, uint8_t dehumidificationMaxCool); +EmberAfStatus GetRelativeHumidityDisplay(chip::EndpointId endpoint, uint8_t * relativeHumidityDisplay); // enum8 +EmberAfStatus SetRelativeHumidityDisplay(chip::EndpointId endpoint, uint8_t relativeHumidityDisplay); +} // namespace Attributes +} // namespace DehumidificationControl + +namespace ThermostatUserInterfaceConfiguration { +namespace Attributes { +EmberAfStatus GetTemperatureDisplayMode(chip::EndpointId endpoint, uint8_t * temperatureDisplayMode); // enum8 +EmberAfStatus SetTemperatureDisplayMode(chip::EndpointId endpoint, uint8_t temperatureDisplayMode); +EmberAfStatus GetKeypadLockout(chip::EndpointId endpoint, uint8_t * keypadLockout); // enum8 +EmberAfStatus SetKeypadLockout(chip::EndpointId endpoint, uint8_t keypadLockout); +EmberAfStatus GetScheduleProgrammingVisibility(chip::EndpointId endpoint, uint8_t * scheduleProgrammingVisibility); // enum8 +EmberAfStatus SetScheduleProgrammingVisibility(chip::EndpointId endpoint, uint8_t scheduleProgrammingVisibility); +} // namespace Attributes +} // namespace ThermostatUserInterfaceConfiguration + +namespace ColorControl { +namespace Attributes { +EmberAfStatus GetCurrentHue(chip::EndpointId endpoint, uint8_t * currentHue); // int8u +EmberAfStatus SetCurrentHue(chip::EndpointId endpoint, uint8_t currentHue); +EmberAfStatus GetCurrentSaturation(chip::EndpointId endpoint, uint8_t * currentSaturation); // int8u +EmberAfStatus SetCurrentSaturation(chip::EndpointId endpoint, uint8_t currentSaturation); +EmberAfStatus GetRemainingTime(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u +EmberAfStatus SetRemainingTime(chip::EndpointId endpoint, uint16_t remainingTime); +EmberAfStatus GetCurrentX(chip::EndpointId endpoint, uint16_t * currentX); // int16u +EmberAfStatus SetCurrentX(chip::EndpointId endpoint, uint16_t currentX); +EmberAfStatus GetCurrentY(chip::EndpointId endpoint, uint16_t * currentY); // int16u +EmberAfStatus SetCurrentY(chip::EndpointId endpoint, uint16_t currentY); +EmberAfStatus GetDriftCompensation(chip::EndpointId endpoint, uint8_t * driftCompensation); // enum8 +EmberAfStatus SetDriftCompensation(chip::EndpointId endpoint, uint8_t driftCompensation); +EmberAfStatus GetColorTemperature(chip::EndpointId endpoint, uint16_t * colorTemperature); // int16u +EmberAfStatus SetColorTemperature(chip::EndpointId endpoint, uint16_t colorTemperature); +EmberAfStatus GetColorMode(chip::EndpointId endpoint, uint8_t * colorMode); // enum8 +EmberAfStatus SetColorMode(chip::EndpointId endpoint, uint8_t colorMode); +EmberAfStatus GetColorControlOptions(chip::EndpointId endpoint, uint8_t * colorControlOptions); // bitmap8 +EmberAfStatus SetColorControlOptions(chip::EndpointId endpoint, uint8_t colorControlOptions); +EmberAfStatus GetNumberOfPrimaries(chip::EndpointId endpoint, uint8_t * numberOfPrimaries); // int8u +EmberAfStatus SetNumberOfPrimaries(chip::EndpointId endpoint, uint8_t numberOfPrimaries); +EmberAfStatus GetPrimary1X(chip::EndpointId endpoint, uint16_t * primary1X); // int16u +EmberAfStatus SetPrimary1X(chip::EndpointId endpoint, uint16_t primary1X); +EmberAfStatus GetPrimary1Y(chip::EndpointId endpoint, uint16_t * primary1Y); // int16u +EmberAfStatus SetPrimary1Y(chip::EndpointId endpoint, uint16_t primary1Y); +EmberAfStatus GetPrimary1Intensity(chip::EndpointId endpoint, uint8_t * primary1Intensity); // int8u +EmberAfStatus SetPrimary1Intensity(chip::EndpointId endpoint, uint8_t primary1Intensity); +EmberAfStatus GetPrimary2X(chip::EndpointId endpoint, uint16_t * primary2X); // int16u +EmberAfStatus SetPrimary2X(chip::EndpointId endpoint, uint16_t primary2X); +EmberAfStatus GetPrimary2Y(chip::EndpointId endpoint, uint16_t * primary2Y); // int16u +EmberAfStatus SetPrimary2Y(chip::EndpointId endpoint, uint16_t primary2Y); +EmberAfStatus GetPrimary2Intensity(chip::EndpointId endpoint, uint8_t * primary2Intensity); // int8u +EmberAfStatus SetPrimary2Intensity(chip::EndpointId endpoint, uint8_t primary2Intensity); +EmberAfStatus GetPrimary3X(chip::EndpointId endpoint, uint16_t * primary3X); // int16u +EmberAfStatus SetPrimary3X(chip::EndpointId endpoint, uint16_t primary3X); +EmberAfStatus GetPrimary3Y(chip::EndpointId endpoint, uint16_t * primary3Y); // int16u +EmberAfStatus SetPrimary3Y(chip::EndpointId endpoint, uint16_t primary3Y); +EmberAfStatus GetPrimary3Intensity(chip::EndpointId endpoint, uint8_t * primary3Intensity); // int8u +EmberAfStatus SetPrimary3Intensity(chip::EndpointId endpoint, uint8_t primary3Intensity); +EmberAfStatus GetPrimary4X(chip::EndpointId endpoint, uint16_t * primary4X); // int16u +EmberAfStatus SetPrimary4X(chip::EndpointId endpoint, uint16_t primary4X); +EmberAfStatus GetPrimary4Y(chip::EndpointId endpoint, uint16_t * primary4Y); // int16u +EmberAfStatus SetPrimary4Y(chip::EndpointId endpoint, uint16_t primary4Y); +EmberAfStatus GetPrimary4Intensity(chip::EndpointId endpoint, uint8_t * primary4Intensity); // int8u +EmberAfStatus SetPrimary4Intensity(chip::EndpointId endpoint, uint8_t primary4Intensity); +EmberAfStatus GetPrimary5X(chip::EndpointId endpoint, uint16_t * primary5X); // int16u +EmberAfStatus SetPrimary5X(chip::EndpointId endpoint, uint16_t primary5X); +EmberAfStatus GetPrimary5Y(chip::EndpointId endpoint, uint16_t * primary5Y); // int16u +EmberAfStatus SetPrimary5Y(chip::EndpointId endpoint, uint16_t primary5Y); +EmberAfStatus GetPrimary5Intensity(chip::EndpointId endpoint, uint8_t * primary5Intensity); // int8u +EmberAfStatus SetPrimary5Intensity(chip::EndpointId endpoint, uint8_t primary5Intensity); +EmberAfStatus GetPrimary6X(chip::EndpointId endpoint, uint16_t * primary6X); // int16u +EmberAfStatus SetPrimary6X(chip::EndpointId endpoint, uint16_t primary6X); +EmberAfStatus GetPrimary6Y(chip::EndpointId endpoint, uint16_t * primary6Y); // int16u +EmberAfStatus SetPrimary6Y(chip::EndpointId endpoint, uint16_t primary6Y); +EmberAfStatus GetPrimary6Intensity(chip::EndpointId endpoint, uint8_t * primary6Intensity); // int8u +EmberAfStatus SetPrimary6Intensity(chip::EndpointId endpoint, uint8_t primary6Intensity); +EmberAfStatus GetWhitePointX(chip::EndpointId endpoint, uint16_t * whitePointX); // int16u +EmberAfStatus SetWhitePointX(chip::EndpointId endpoint, uint16_t whitePointX); +EmberAfStatus GetWhitePointY(chip::EndpointId endpoint, uint16_t * whitePointY); // int16u +EmberAfStatus SetWhitePointY(chip::EndpointId endpoint, uint16_t whitePointY); +EmberAfStatus GetColorPointRX(chip::EndpointId endpoint, uint16_t * colorPointRX); // int16u +EmberAfStatus SetColorPointRX(chip::EndpointId endpoint, uint16_t colorPointRX); +EmberAfStatus GetColorPointRY(chip::EndpointId endpoint, uint16_t * colorPointRY); // int16u +EmberAfStatus SetColorPointRY(chip::EndpointId endpoint, uint16_t colorPointRY); +EmberAfStatus GetColorPointRIntensity(chip::EndpointId endpoint, uint8_t * colorPointRIntensity); // int8u +EmberAfStatus SetColorPointRIntensity(chip::EndpointId endpoint, uint8_t colorPointRIntensity); +EmberAfStatus GetColorPointGX(chip::EndpointId endpoint, uint16_t * colorPointGX); // int16u +EmberAfStatus SetColorPointGX(chip::EndpointId endpoint, uint16_t colorPointGX); +EmberAfStatus GetColorPointGY(chip::EndpointId endpoint, uint16_t * colorPointGY); // int16u +EmberAfStatus SetColorPointGY(chip::EndpointId endpoint, uint16_t colorPointGY); +EmberAfStatus GetColorPointGIntensity(chip::EndpointId endpoint, uint8_t * colorPointGIntensity); // int8u +EmberAfStatus SetColorPointGIntensity(chip::EndpointId endpoint, uint8_t colorPointGIntensity); +EmberAfStatus GetColorPointBX(chip::EndpointId endpoint, uint16_t * colorPointBX); // int16u +EmberAfStatus SetColorPointBX(chip::EndpointId endpoint, uint16_t colorPointBX); +EmberAfStatus GetColorPointBY(chip::EndpointId endpoint, uint16_t * colorPointBY); // int16u +EmberAfStatus SetColorPointBY(chip::EndpointId endpoint, uint16_t colorPointBY); +EmberAfStatus GetColorPointBIntensity(chip::EndpointId endpoint, uint8_t * colorPointBIntensity); // int8u +EmberAfStatus SetColorPointBIntensity(chip::EndpointId endpoint, uint8_t colorPointBIntensity); +EmberAfStatus GetEnhancedCurrentHue(chip::EndpointId endpoint, uint16_t * enhancedCurrentHue); // int16u +EmberAfStatus SetEnhancedCurrentHue(chip::EndpointId endpoint, uint16_t enhancedCurrentHue); +EmberAfStatus GetEnhancedColorMode(chip::EndpointId endpoint, uint8_t * enhancedColorMode); // enum8 +EmberAfStatus SetEnhancedColorMode(chip::EndpointId endpoint, uint8_t enhancedColorMode); +EmberAfStatus GetColorLoopActive(chip::EndpointId endpoint, uint8_t * colorLoopActive); // int8u +EmberAfStatus SetColorLoopActive(chip::EndpointId endpoint, uint8_t colorLoopActive); +EmberAfStatus GetColorLoopDirection(chip::EndpointId endpoint, uint8_t * colorLoopDirection); // int8u +EmberAfStatus SetColorLoopDirection(chip::EndpointId endpoint, uint8_t colorLoopDirection); +EmberAfStatus GetColorLoopTime(chip::EndpointId endpoint, uint16_t * colorLoopTime); // int16u +EmberAfStatus SetColorLoopTime(chip::EndpointId endpoint, uint16_t colorLoopTime); +EmberAfStatus GetColorLoopStartEnhancedHue(chip::EndpointId endpoint, uint16_t * colorLoopStartEnhancedHue); // int16u +EmberAfStatus SetColorLoopStartEnhancedHue(chip::EndpointId endpoint, uint16_t colorLoopStartEnhancedHue); +EmberAfStatus GetColorLoopStoredEnhancedHue(chip::EndpointId endpoint, uint16_t * colorLoopStoredEnhancedHue); // int16u +EmberAfStatus SetColorLoopStoredEnhancedHue(chip::EndpointId endpoint, uint16_t colorLoopStoredEnhancedHue); +EmberAfStatus GetColorCapabilities(chip::EndpointId endpoint, uint16_t * colorCapabilities); // bitmap16 +EmberAfStatus SetColorCapabilities(chip::EndpointId endpoint, uint16_t colorCapabilities); +EmberAfStatus GetColorTempPhysicalMin(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMin); // int16u +EmberAfStatus SetColorTempPhysicalMin(chip::EndpointId endpoint, uint16_t colorTempPhysicalMin); +EmberAfStatus GetColorTempPhysicalMax(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMax); // int16u +EmberAfStatus SetColorTempPhysicalMax(chip::EndpointId endpoint, uint16_t colorTempPhysicalMax); +EmberAfStatus GetCoupleColorTempToLevelMinMireds(chip::EndpointId endpoint, uint16_t * coupleColorTempToLevelMinMireds); // int16u +EmberAfStatus SetCoupleColorTempToLevelMinMireds(chip::EndpointId endpoint, uint16_t coupleColorTempToLevelMinMireds); +EmberAfStatus GetStartUpColorTemperatureMireds(chip::EndpointId endpoint, uint16_t * startUpColorTemperatureMireds); // int16u +EmberAfStatus SetStartUpColorTemperatureMireds(chip::EndpointId endpoint, uint16_t startUpColorTemperatureMireds); +} // namespace Attributes +} // namespace ColorControl + +namespace BallastConfiguration { +namespace Attributes { +EmberAfStatus GetPhysicalMinLevel(chip::EndpointId endpoint, uint8_t * physicalMinLevel); // int8u +EmberAfStatus SetPhysicalMinLevel(chip::EndpointId endpoint, uint8_t physicalMinLevel); +EmberAfStatus GetPhysicalMaxLevel(chip::EndpointId endpoint, uint8_t * physicalMaxLevel); // int8u +EmberAfStatus SetPhysicalMaxLevel(chip::EndpointId endpoint, uint8_t physicalMaxLevel); +EmberAfStatus GetBallastStatus(chip::EndpointId endpoint, uint8_t * ballastStatus); // bitmap8 +EmberAfStatus SetBallastStatus(chip::EndpointId endpoint, uint8_t ballastStatus); +EmberAfStatus GetMinLevel(chip::EndpointId endpoint, uint8_t * minLevel); // int8u +EmberAfStatus SetMinLevel(chip::EndpointId endpoint, uint8_t minLevel); +EmberAfStatus GetMaxLevel(chip::EndpointId endpoint, uint8_t * maxLevel); // int8u +EmberAfStatus SetMaxLevel(chip::EndpointId endpoint, uint8_t maxLevel); +EmberAfStatus GetPowerOnLevel(chip::EndpointId endpoint, uint8_t * powerOnLevel); // int8u +EmberAfStatus SetPowerOnLevel(chip::EndpointId endpoint, uint8_t powerOnLevel); +EmberAfStatus GetPowerOnFadeTime(chip::EndpointId endpoint, uint16_t * powerOnFadeTime); // int16u +EmberAfStatus SetPowerOnFadeTime(chip::EndpointId endpoint, uint16_t powerOnFadeTime); +EmberAfStatus GetIntrinsicBallastFactor(chip::EndpointId endpoint, uint8_t * intrinsicBallastFactor); // int8u +EmberAfStatus SetIntrinsicBallastFactor(chip::EndpointId endpoint, uint8_t intrinsicBallastFactor); +EmberAfStatus GetBallastFactorAdjustment(chip::EndpointId endpoint, uint8_t * ballastFactorAdjustment); // int8u +EmberAfStatus SetBallastFactorAdjustment(chip::EndpointId endpoint, uint8_t ballastFactorAdjustment); +EmberAfStatus GetLampQuality(chip::EndpointId endpoint, uint8_t * lampQuality); // int8u +EmberAfStatus SetLampQuality(chip::EndpointId endpoint, uint8_t lampQuality); +EmberAfStatus GetLampAlarmMode(chip::EndpointId endpoint, uint8_t * lampAlarmMode); // bitmap8 +EmberAfStatus SetLampAlarmMode(chip::EndpointId endpoint, uint8_t lampAlarmMode); +} // namespace Attributes +} // namespace BallastConfiguration + +namespace IlluminanceMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, uint16_t * measuredValue); // int16u +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, uint16_t measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, uint16_t * minMeasuredValue); // int16u +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, uint16_t minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t * maxMeasuredValue); // int16u +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance); // int16u +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus GetLightSensorType(chip::EndpointId endpoint, uint8_t * lightSensorType); // enum8 +EmberAfStatus SetLightSensorType(chip::EndpointId endpoint, uint8_t lightSensorType); +} // namespace Attributes +} // namespace IlluminanceMeasurement + +namespace IlluminanceLevelSensing { +namespace Attributes { +EmberAfStatus GetLevelStatus(chip::EndpointId endpoint, uint8_t * levelStatus); // enum8 +EmberAfStatus SetLevelStatus(chip::EndpointId endpoint, uint8_t levelStatus); +EmberAfStatus GetLightSensorType(chip::EndpointId endpoint, uint8_t * lightSensorType); // enum8 +EmberAfStatus SetLightSensorType(chip::EndpointId endpoint, uint8_t lightSensorType); +EmberAfStatus GetIlluminanceLevelTarget(chip::EndpointId endpoint, uint16_t * illuminanceLevelTarget); // int16u +EmberAfStatus SetIlluminanceLevelTarget(chip::EndpointId endpoint, uint16_t illuminanceLevelTarget); +} // namespace Attributes +} // namespace IlluminanceLevelSensing + +namespace TemperatureMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue); // int16s +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance); // int16u +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance); +} // namespace Attributes +} // namespace TemperatureMeasurement + +namespace PressureMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue); // int16s +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance); // int16u +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus GetScaledValue(chip::EndpointId endpoint, int16_t * scaledValue); // int16s +EmberAfStatus SetScaledValue(chip::EndpointId endpoint, int16_t scaledValue); +EmberAfStatus GetMinScaledValue(chip::EndpointId endpoint, int16_t * minScaledValue); // int16s +EmberAfStatus SetMinScaledValue(chip::EndpointId endpoint, int16_t minScaledValue); +EmberAfStatus GetMaxScaledValue(chip::EndpointId endpoint, int16_t * maxScaledValue); // int16s +EmberAfStatus SetMaxScaledValue(chip::EndpointId endpoint, int16_t maxScaledValue); +EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, int16_t * scaledTolerance); // int16s +EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, int16_t scaledTolerance); +EmberAfStatus GetScale(chip::EndpointId endpoint, int8_t * scale); // int8s +EmberAfStatus SetScale(chip::EndpointId endpoint, int8_t scale); +} // namespace Attributes +} // namespace PressureMeasurement + +namespace FlowMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, int16_t * measuredValue); // int16s +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance); // int16u +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance); +} // namespace Attributes +} // namespace FlowMeasurement + +namespace RelativeHumidityMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, uint16_t * measuredValue); // int16u +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, uint16_t measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, uint16_t * minMeasuredValue); // int16u +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, uint16_t minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t * maxMeasuredValue); // int16u +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, uint16_t maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, uint16_t * tolerance); // int16u +EmberAfStatus SetTolerance(chip::EndpointId endpoint, uint16_t tolerance); +} // namespace Attributes +} // namespace RelativeHumidityMeasurement + +namespace OccupancySensing { +namespace Attributes { +EmberAfStatus GetOccupancy(chip::EndpointId endpoint, uint8_t * occupancy); // bitmap8 +EmberAfStatus SetOccupancy(chip::EndpointId endpoint, uint8_t occupancy); +EmberAfStatus GetOccupancySensorType(chip::EndpointId endpoint, uint8_t * occupancySensorType); // enum8 +EmberAfStatus SetOccupancySensorType(chip::EndpointId endpoint, uint8_t occupancySensorType); +EmberAfStatus GetOccupancySensorTypeBitmap(chip::EndpointId endpoint, uint8_t * occupancySensorTypeBitmap); // bitmap8 +EmberAfStatus SetOccupancySensorTypeBitmap(chip::EndpointId endpoint, uint8_t occupancySensorTypeBitmap); +EmberAfStatus GetPirOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t * pirOccupiedToUnoccupiedDelay); // int16u +EmberAfStatus SetPirOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t pirOccupiedToUnoccupiedDelay); +EmberAfStatus GetPirUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t * pirUnoccupiedToOccupiedDelay); // int16u +EmberAfStatus SetPirUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t pirUnoccupiedToOccupiedDelay); +EmberAfStatus GetPirUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, uint8_t * pirUnoccupiedToOccupiedThreshold); // int8u +EmberAfStatus SetPirUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, uint8_t pirUnoccupiedToOccupiedThreshold); +EmberAfStatus GetUltrasonicOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, + uint16_t * ultrasonicOccupiedToUnoccupiedDelay); // int16u +EmberAfStatus SetUltrasonicOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, uint16_t ultrasonicOccupiedToUnoccupiedDelay); +EmberAfStatus GetUltrasonicUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, + uint16_t * ultrasonicUnoccupiedToOccupiedDelay); // int16u +EmberAfStatus SetUltrasonicUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, uint16_t ultrasonicUnoccupiedToOccupiedDelay); +EmberAfStatus GetUltrasonicUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t * ultrasonicUnoccupiedToOccupiedThreshold); // int8u +EmberAfStatus SetUltrasonicUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t ultrasonicUnoccupiedToOccupiedThreshold); +EmberAfStatus GetPhysicalContactOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, + uint16_t * physicalContactOccupiedToUnoccupiedDelay); // int16u +EmberAfStatus SetPhysicalContactOccupiedToUnoccupiedDelay(chip::EndpointId endpoint, + uint16_t physicalContactOccupiedToUnoccupiedDelay); +EmberAfStatus GetPhysicalContactUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, + uint16_t * physicalContactUnoccupiedToOccupiedDelay); // int16u +EmberAfStatus SetPhysicalContactUnoccupiedToOccupiedDelay(chip::EndpointId endpoint, + uint16_t physicalContactUnoccupiedToOccupiedDelay); +EmberAfStatus GetPhysicalContactUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t * physicalContactUnoccupiedToOccupiedThreshold); // int8u +EmberAfStatus SetPhysicalContactUnoccupiedToOccupiedThreshold(chip::EndpointId endpoint, + uint8_t physicalContactUnoccupiedToOccupiedThreshold); +} // namespace Attributes +} // namespace OccupancySensing + +namespace CarbonMonoxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace CarbonMonoxideConcentrationMeasurement + +namespace CarbonDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace CarbonDioxideConcentrationMeasurement + +namespace EthyleneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace EthyleneConcentrationMeasurement + +namespace EthyleneOxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace EthyleneOxideConcentrationMeasurement + +namespace HydrogenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace HydrogenConcentrationMeasurement + +namespace HydrogenSulphideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace HydrogenSulphideConcentrationMeasurement + +namespace NitricOxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace NitricOxideConcentrationMeasurement + +namespace NitrogenDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace NitrogenDioxideConcentrationMeasurement + +namespace OxygenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace OxygenConcentrationMeasurement + +namespace OzoneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace OzoneConcentrationMeasurement + +namespace SulfurDioxideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace SulfurDioxideConcentrationMeasurement + +namespace DissolvedOxygenConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace DissolvedOxygenConcentrationMeasurement + +namespace BromateConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace BromateConcentrationMeasurement + +namespace ChloraminesConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace ChloraminesConcentrationMeasurement + +namespace ChlorineConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace ChlorineConcentrationMeasurement + +namespace FecalColiformAndEColiConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace FecalColiformAndEColiConcentrationMeasurement + +namespace FluorideConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace FluorideConcentrationMeasurement + +namespace HaloaceticAcidsConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace HaloaceticAcidsConcentrationMeasurement + +namespace TotalTrihalomethanesConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace TotalTrihalomethanesConcentrationMeasurement + +namespace TotalColiformBacteriaConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace TotalColiformBacteriaConcentrationMeasurement + +namespace TurbidityConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace TurbidityConcentrationMeasurement + +namespace CopperConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace CopperConcentrationMeasurement + +namespace LeadConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace LeadConcentrationMeasurement + +namespace ManganeseConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace ManganeseConcentrationMeasurement + +namespace SulfateConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace SulfateConcentrationMeasurement + +namespace BromodichloromethaneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace BromodichloromethaneConcentrationMeasurement + +namespace BromoformConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace BromoformConcentrationMeasurement + +namespace ChlorodibromomethaneConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace ChlorodibromomethaneConcentrationMeasurement + +namespace ChloroformConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace ChloroformConcentrationMeasurement + +namespace SodiumConcentrationMeasurement { +namespace Attributes { +EmberAfStatus GetMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** measuredValue); // single +EmberAfStatus SetMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * measuredValue); +EmberAfStatus GetMinMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** minMeasuredValue); // single +EmberAfStatus SetMinMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * minMeasuredValue); +EmberAfStatus GetMaxMeasuredValue(chip::EndpointId endpoint, + /* TYPE WARNING: single defaults to */ uint8_t ** maxMeasuredValue); // single +EmberAfStatus SetMaxMeasuredValue(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * maxMeasuredValue); +EmberAfStatus GetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t ** tolerance); // single +EmberAfStatus SetTolerance(chip::EndpointId endpoint, /* TYPE WARNING: single defaults to */ uint8_t * tolerance); +} // namespace Attributes +} // namespace SodiumConcentrationMeasurement + +namespace IasZone { +namespace Attributes { +EmberAfStatus GetZoneState(chip::EndpointId endpoint, uint8_t * zoneState); // enum8 +EmberAfStatus SetZoneState(chip::EndpointId endpoint, uint8_t zoneState); +EmberAfStatus GetZoneType(chip::EndpointId endpoint, uint16_t * zoneType); // enum16 +EmberAfStatus SetZoneType(chip::EndpointId endpoint, uint16_t zoneType); +EmberAfStatus GetZoneStatus(chip::EndpointId endpoint, uint16_t * zoneStatus); // bitmap16 +EmberAfStatus SetZoneStatus(chip::EndpointId endpoint, uint16_t zoneStatus); +EmberAfStatus GetIasCieAddress(chip::EndpointId endpoint, chip::NodeId * iasCieAddress); // node_id +EmberAfStatus SetIasCieAddress(chip::EndpointId endpoint, chip::NodeId iasCieAddress); +EmberAfStatus GetZoneId(chip::EndpointId endpoint, uint8_t * zoneId); // int8u +EmberAfStatus SetZoneId(chip::EndpointId endpoint, uint8_t zoneId); +EmberAfStatus GetNumberOfZoneSensitivityLevelsSupported(chip::EndpointId endpoint, + uint8_t * numberOfZoneSensitivityLevelsSupported); // int8u +EmberAfStatus SetNumberOfZoneSensitivityLevelsSupported(chip::EndpointId endpoint, uint8_t numberOfZoneSensitivityLevelsSupported); +EmberAfStatus GetCurrentZoneSensitivityLevel(chip::EndpointId endpoint, uint8_t * currentZoneSensitivityLevel); // int8u +EmberAfStatus SetCurrentZoneSensitivityLevel(chip::EndpointId endpoint, uint8_t currentZoneSensitivityLevel); +} // namespace Attributes +} // namespace IasZone + +namespace IasWd { +namespace Attributes { +EmberAfStatus GetMaxDuration(chip::EndpointId endpoint, uint16_t * maxDuration); // int16u +EmberAfStatus SetMaxDuration(chip::EndpointId endpoint, uint16_t maxDuration); +} // namespace Attributes +} // namespace IasWd + +namespace WakeOnLan { +namespace Attributes { +} // namespace Attributes +} // namespace WakeOnLan + +namespace TvChannel { +namespace Attributes { +} // namespace Attributes +} // namespace TvChannel + +namespace TargetNavigator { +namespace Attributes { +EmberAfStatus GetCurrentNavigatorTarget(chip::EndpointId endpoint, uint8_t * currentNavigatorTarget); // int8u +EmberAfStatus SetCurrentNavigatorTarget(chip::EndpointId endpoint, uint8_t currentNavigatorTarget); +} // namespace Attributes +} // namespace TargetNavigator + +namespace MediaPlayback { +namespace Attributes { +EmberAfStatus GetPlaybackState(chip::EndpointId endpoint, uint8_t * playbackState); // enum8 +EmberAfStatus SetPlaybackState(chip::EndpointId endpoint, uint8_t playbackState); +EmberAfStatus GetStartTime(chip::EndpointId endpoint, uint64_t * startTime); // int64u +EmberAfStatus SetStartTime(chip::EndpointId endpoint, uint64_t startTime); +EmberAfStatus GetDuration(chip::EndpointId endpoint, uint64_t * duration); // int64u +EmberAfStatus SetDuration(chip::EndpointId endpoint, uint64_t duration); +EmberAfStatus GetUpdatedAt(chip::EndpointId endpoint, uint64_t * updatedAt); // int64u +EmberAfStatus SetUpdatedAt(chip::EndpointId endpoint, uint64_t updatedAt); +EmberAfStatus GetPosistion(chip::EndpointId endpoint, uint64_t * posistion); // int64u +EmberAfStatus SetPosistion(chip::EndpointId endpoint, uint64_t posistion); +EmberAfStatus GetPlaybackSpeed(chip::EndpointId endpoint, uint64_t * playbackSpeed); // int64u +EmberAfStatus SetPlaybackSpeed(chip::EndpointId endpoint, uint64_t playbackSpeed); +EmberAfStatus GetSeekRangeEnd(chip::EndpointId endpoint, uint64_t * seekRangeEnd); // int64u +EmberAfStatus SetSeekRangeEnd(chip::EndpointId endpoint, uint64_t seekRangeEnd); +EmberAfStatus GetSeekRangeStart(chip::EndpointId endpoint, uint64_t * seekRangeStart); // int64u +EmberAfStatus SetSeekRangeStart(chip::EndpointId endpoint, uint64_t seekRangeStart); +} // namespace Attributes +} // namespace MediaPlayback + +namespace MediaInput { +namespace Attributes { +EmberAfStatus GetCurrentMediaInput(chip::EndpointId endpoint, uint8_t * currentMediaInput); // int8u +EmberAfStatus SetCurrentMediaInput(chip::EndpointId endpoint, uint8_t currentMediaInput); +} // namespace Attributes +} // namespace MediaInput + +namespace ContentLauncher { +namespace Attributes { +} // namespace Attributes +} // namespace ContentLauncher + +namespace AudioOutput { +namespace Attributes { +EmberAfStatus GetCurrentAudioOutput(chip::EndpointId endpoint, uint8_t * currentAudioOutput); // int8u +EmberAfStatus SetCurrentAudioOutput(chip::EndpointId endpoint, uint8_t currentAudioOutput); +} // namespace Attributes +} // namespace AudioOutput + +namespace ApplicationLauncher { +namespace Attributes { +EmberAfStatus GetCatalogVendorId(chip::EndpointId endpoint, uint8_t * catalogVendorId); // int8u +EmberAfStatus SetCatalogVendorId(chip::EndpointId endpoint, uint8_t catalogVendorId); +EmberAfStatus GetApplicationId(chip::EndpointId endpoint, uint8_t * applicationId); // int8u +EmberAfStatus SetApplicationId(chip::EndpointId endpoint, uint8_t applicationId); +} // namespace Attributes +} // namespace ApplicationLauncher + +namespace ApplicationBasic { +namespace Attributes { +EmberAfStatus GetVendorId(chip::EndpointId endpoint, uint16_t * vendorId); // int16u +EmberAfStatus SetVendorId(chip::EndpointId endpoint, uint16_t vendorId); +EmberAfStatus GetProductId(chip::EndpointId endpoint, uint16_t * productId); // int16u +EmberAfStatus SetProductId(chip::EndpointId endpoint, uint16_t productId); +EmberAfStatus GetCatalogVendorId(chip::EndpointId endpoint, uint16_t * catalogVendorId); // int16u +EmberAfStatus SetCatalogVendorId(chip::EndpointId endpoint, uint16_t catalogVendorId); +EmberAfStatus GetApplicationStatus(chip::EndpointId endpoint, uint8_t * applicationStatus); // enum8 +EmberAfStatus SetApplicationStatus(chip::EndpointId endpoint, uint8_t applicationStatus); +} // namespace Attributes +} // namespace ApplicationBasic + +namespace TestCluster { +namespace Attributes { +EmberAfStatus GetBoolean(chip::EndpointId endpoint, uint8_t * boolean); // boolean +EmberAfStatus SetBoolean(chip::EndpointId endpoint, uint8_t boolean); +EmberAfStatus GetBitmap8(chip::EndpointId endpoint, uint8_t * bitmap8); // bitmap8 +EmberAfStatus SetBitmap8(chip::EndpointId endpoint, uint8_t bitmap8); +EmberAfStatus GetBitmap16(chip::EndpointId endpoint, uint16_t * bitmap16); // bitmap16 +EmberAfStatus SetBitmap16(chip::EndpointId endpoint, uint16_t bitmap16); +EmberAfStatus GetBitmap32(chip::EndpointId endpoint, uint32_t * bitmap32); // bitmap32 +EmberAfStatus SetBitmap32(chip::EndpointId endpoint, uint32_t bitmap32); +EmberAfStatus GetBitmap64(chip::EndpointId endpoint, uint64_t * bitmap64); // bitmap64 +EmberAfStatus SetBitmap64(chip::EndpointId endpoint, uint64_t bitmap64); +EmberAfStatus GetInt8u(chip::EndpointId endpoint, uint8_t * int8u); // int8u +EmberAfStatus SetInt8u(chip::EndpointId endpoint, uint8_t int8u); +EmberAfStatus GetInt16u(chip::EndpointId endpoint, uint16_t * int16u); // int16u +EmberAfStatus SetInt16u(chip::EndpointId endpoint, uint16_t int16u); +EmberAfStatus GetInt32u(chip::EndpointId endpoint, uint32_t * int32u); // int32u +EmberAfStatus SetInt32u(chip::EndpointId endpoint, uint32_t int32u); +EmberAfStatus GetInt64u(chip::EndpointId endpoint, uint64_t * int64u); // int64u +EmberAfStatus SetInt64u(chip::EndpointId endpoint, uint64_t int64u); +EmberAfStatus GetInt8s(chip::EndpointId endpoint, int8_t * int8s); // int8s +EmberAfStatus SetInt8s(chip::EndpointId endpoint, int8_t int8s); +EmberAfStatus GetInt16s(chip::EndpointId endpoint, int16_t * int16s); // int16s +EmberAfStatus SetInt16s(chip::EndpointId endpoint, int16_t int16s); +EmberAfStatus GetInt32s(chip::EndpointId endpoint, int32_t * int32s); // int32s +EmberAfStatus SetInt32s(chip::EndpointId endpoint, int32_t int32s); +EmberAfStatus GetInt64s(chip::EndpointId endpoint, int64_t * int64s); // int64s +EmberAfStatus SetInt64s(chip::EndpointId endpoint, int64_t int64s); +EmberAfStatus GetEnum8(chip::EndpointId endpoint, uint8_t * enum8); // enum8 +EmberAfStatus SetEnum8(chip::EndpointId endpoint, uint8_t enum8); +EmberAfStatus GetEnum16(chip::EndpointId endpoint, uint16_t * enum16); // enum16 +EmberAfStatus SetEnum16(chip::EndpointId endpoint, uint16_t enum16); +EmberAfStatus GetUnsupported(chip::EndpointId endpoint, uint8_t * unsupported); // boolean +EmberAfStatus SetUnsupported(chip::EndpointId endpoint, uint8_t unsupported); +} // namespace Attributes +} // namespace TestCluster + +namespace ApplianceIdentification { +namespace Attributes { +EmberAfStatus GetCompanyId(chip::EndpointId endpoint, uint16_t * companyId); // int16u +EmberAfStatus SetCompanyId(chip::EndpointId endpoint, uint16_t companyId); +EmberAfStatus GetBrandId(chip::EndpointId endpoint, uint16_t * brandId); // int16u +EmberAfStatus SetBrandId(chip::EndpointId endpoint, uint16_t brandId); +EmberAfStatus GetProductTypeId(chip::EndpointId endpoint, uint16_t * productTypeId); // int16u +EmberAfStatus SetProductTypeId(chip::EndpointId endpoint, uint16_t productTypeId); +EmberAfStatus GetCecedSpecificationVersion(chip::EndpointId endpoint, uint8_t * cecedSpecificationVersion); // int8u +EmberAfStatus SetCecedSpecificationVersion(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion); +} // namespace Attributes +} // namespace ApplianceIdentification + +namespace MeterIdentification { +namespace Attributes { +EmberAfStatus GetMeterTypeId(chip::EndpointId endpoint, uint16_t * meterTypeId); // int16u +EmberAfStatus SetMeterTypeId(chip::EndpointId endpoint, uint16_t meterTypeId); +EmberAfStatus GetDataQualityId(chip::EndpointId endpoint, uint16_t * dataQualityId); // int16u +EmberAfStatus SetDataQualityId(chip::EndpointId endpoint, uint16_t dataQualityId); +} // namespace Attributes +} // namespace MeterIdentification + +namespace ApplianceStatistics { +namespace Attributes { +EmberAfStatus GetLogMaxSize(chip::EndpointId endpoint, uint32_t * logMaxSize); // int32u +EmberAfStatus SetLogMaxSize(chip::EndpointId endpoint, uint32_t logMaxSize); +EmberAfStatus GetLogQueueMaxSize(chip::EndpointId endpoint, uint8_t * logQueueMaxSize); // int8u +EmberAfStatus SetLogQueueMaxSize(chip::EndpointId endpoint, uint8_t logQueueMaxSize); +} // namespace Attributes +} // namespace ApplianceStatistics + +namespace ElectricalMeasurement { +namespace Attributes { +EmberAfStatus GetMeasurementType(chip::EndpointId endpoint, uint32_t * measurementType); // bitmap32 +EmberAfStatus SetMeasurementType(chip::EndpointId endpoint, uint32_t measurementType); +EmberAfStatus GetDcVoltage(chip::EndpointId endpoint, int16_t * dcVoltage); // int16s +EmberAfStatus SetDcVoltage(chip::EndpointId endpoint, int16_t dcVoltage); +EmberAfStatus GetDcVoltageMin(chip::EndpointId endpoint, int16_t * dcVoltageMin); // int16s +EmberAfStatus SetDcVoltageMin(chip::EndpointId endpoint, int16_t dcVoltageMin); +EmberAfStatus GetDcVoltageMax(chip::EndpointId endpoint, int16_t * dcVoltageMax); // int16s +EmberAfStatus SetDcVoltageMax(chip::EndpointId endpoint, int16_t dcVoltageMax); +EmberAfStatus GetDcCurrent(chip::EndpointId endpoint, int16_t * dcCurrent); // int16s +EmberAfStatus SetDcCurrent(chip::EndpointId endpoint, int16_t dcCurrent); +EmberAfStatus GetDcCurrentMin(chip::EndpointId endpoint, int16_t * dcCurrentMin); // int16s +EmberAfStatus SetDcCurrentMin(chip::EndpointId endpoint, int16_t dcCurrentMin); +EmberAfStatus GetDcCurrentMax(chip::EndpointId endpoint, int16_t * dcCurrentMax); // int16s +EmberAfStatus SetDcCurrentMax(chip::EndpointId endpoint, int16_t dcCurrentMax); +EmberAfStatus GetDcPower(chip::EndpointId endpoint, int16_t * dcPower); // int16s +EmberAfStatus SetDcPower(chip::EndpointId endpoint, int16_t dcPower); +EmberAfStatus GetDcPowerMin(chip::EndpointId endpoint, int16_t * dcPowerMin); // int16s +EmberAfStatus SetDcPowerMin(chip::EndpointId endpoint, int16_t dcPowerMin); +EmberAfStatus GetDcPowerMax(chip::EndpointId endpoint, int16_t * dcPowerMax); // int16s +EmberAfStatus SetDcPowerMax(chip::EndpointId endpoint, int16_t dcPowerMax); +EmberAfStatus GetDcVoltageMultiplier(chip::EndpointId endpoint, uint16_t * dcVoltageMultiplier); // int16u +EmberAfStatus SetDcVoltageMultiplier(chip::EndpointId endpoint, uint16_t dcVoltageMultiplier); +EmberAfStatus GetDcVoltageDivisor(chip::EndpointId endpoint, uint16_t * dcVoltageDivisor); // int16u +EmberAfStatus SetDcVoltageDivisor(chip::EndpointId endpoint, uint16_t dcVoltageDivisor); +EmberAfStatus GetDcCurrentMultiplier(chip::EndpointId endpoint, uint16_t * dcCurrentMultiplier); // int16u +EmberAfStatus SetDcCurrentMultiplier(chip::EndpointId endpoint, uint16_t dcCurrentMultiplier); +EmberAfStatus GetDcCurrentDivisor(chip::EndpointId endpoint, uint16_t * dcCurrentDivisor); // int16u +EmberAfStatus SetDcCurrentDivisor(chip::EndpointId endpoint, uint16_t dcCurrentDivisor); +EmberAfStatus GetDcPowerMultiplier(chip::EndpointId endpoint, uint16_t * dcPowerMultiplier); // int16u +EmberAfStatus SetDcPowerMultiplier(chip::EndpointId endpoint, uint16_t dcPowerMultiplier); +EmberAfStatus GetDcPowerDivisor(chip::EndpointId endpoint, uint16_t * dcPowerDivisor); // int16u +EmberAfStatus SetDcPowerDivisor(chip::EndpointId endpoint, uint16_t dcPowerDivisor); +EmberAfStatus GetAcFrequency(chip::EndpointId endpoint, uint16_t * acFrequency); // int16u +EmberAfStatus SetAcFrequency(chip::EndpointId endpoint, uint16_t acFrequency); +EmberAfStatus GetAcFrequencyMin(chip::EndpointId endpoint, uint16_t * acFrequencyMin); // int16u +EmberAfStatus SetAcFrequencyMin(chip::EndpointId endpoint, uint16_t acFrequencyMin); +EmberAfStatus GetAcFrequencyMax(chip::EndpointId endpoint, uint16_t * acFrequencyMax); // int16u +EmberAfStatus SetAcFrequencyMax(chip::EndpointId endpoint, uint16_t acFrequencyMax); +EmberAfStatus GetNeutralCurrent(chip::EndpointId endpoint, uint16_t * neutralCurrent); // int16u +EmberAfStatus SetNeutralCurrent(chip::EndpointId endpoint, uint16_t neutralCurrent); +EmberAfStatus GetTotalActivePower(chip::EndpointId endpoint, int32_t * totalActivePower); // int32s +EmberAfStatus SetTotalActivePower(chip::EndpointId endpoint, int32_t totalActivePower); +EmberAfStatus GetTotalReactivePower(chip::EndpointId endpoint, int32_t * totalReactivePower); // int32s +EmberAfStatus SetTotalReactivePower(chip::EndpointId endpoint, int32_t totalReactivePower); +EmberAfStatus GetTotalApparentPower(chip::EndpointId endpoint, uint32_t * totalApparentPower); // int32u +EmberAfStatus SetTotalApparentPower(chip::EndpointId endpoint, uint32_t totalApparentPower); +EmberAfStatus GetMeasured1stHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured1stHarmonicCurrent); // int16s +EmberAfStatus SetMeasured1stHarmonicCurrent(chip::EndpointId endpoint, int16_t measured1stHarmonicCurrent); +EmberAfStatus GetMeasured3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured3rdHarmonicCurrent); // int16s +EmberAfStatus SetMeasured3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t measured3rdHarmonicCurrent); +EmberAfStatus GetMeasured5thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured5thHarmonicCurrent); // int16s +EmberAfStatus SetMeasured5thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured5thHarmonicCurrent); +EmberAfStatus GetMeasured7thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured7thHarmonicCurrent); // int16s +EmberAfStatus SetMeasured7thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured7thHarmonicCurrent); +EmberAfStatus GetMeasured9thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured9thHarmonicCurrent); // int16s +EmberAfStatus SetMeasured9thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured9thHarmonicCurrent); +EmberAfStatus GetMeasured11thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measured11thHarmonicCurrent); // int16s +EmberAfStatus SetMeasured11thHarmonicCurrent(chip::EndpointId endpoint, int16_t measured11thHarmonicCurrent); +EmberAfStatus GetMeasuredPhase1stHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase1stHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase1stHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase1stHarmonicCurrent); +EmberAfStatus GetMeasuredPhase3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase3rdHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase3rdHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase3rdHarmonicCurrent); +EmberAfStatus GetMeasuredPhase5thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase5thHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase5thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase5thHarmonicCurrent); +EmberAfStatus GetMeasuredPhase7thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase7thHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase7thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase7thHarmonicCurrent); +EmberAfStatus GetMeasuredPhase9thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase9thHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase9thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase9thHarmonicCurrent); +EmberAfStatus GetMeasuredPhase11thHarmonicCurrent(chip::EndpointId endpoint, int16_t * measuredPhase11thHarmonicCurrent); // int16s +EmberAfStatus SetMeasuredPhase11thHarmonicCurrent(chip::EndpointId endpoint, int16_t measuredPhase11thHarmonicCurrent); +EmberAfStatus GetAcFrequencyMultiplier(chip::EndpointId endpoint, uint16_t * acFrequencyMultiplier); // int16u +EmberAfStatus SetAcFrequencyMultiplier(chip::EndpointId endpoint, uint16_t acFrequencyMultiplier); +EmberAfStatus GetAcFrequencyDivisor(chip::EndpointId endpoint, uint16_t * acFrequencyDivisor); // int16u +EmberAfStatus SetAcFrequencyDivisor(chip::EndpointId endpoint, uint16_t acFrequencyDivisor); +EmberAfStatus GetPowerMultiplier(chip::EndpointId endpoint, uint32_t * powerMultiplier); // int32u +EmberAfStatus SetPowerMultiplier(chip::EndpointId endpoint, uint32_t powerMultiplier); +EmberAfStatus GetPowerDivisor(chip::EndpointId endpoint, uint32_t * powerDivisor); // int32u +EmberAfStatus SetPowerDivisor(chip::EndpointId endpoint, uint32_t powerDivisor); +EmberAfStatus GetHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t * harmonicCurrentMultiplier); // int8s +EmberAfStatus SetHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t harmonicCurrentMultiplier); +EmberAfStatus GetPhaseHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t * phaseHarmonicCurrentMultiplier); // int8s +EmberAfStatus SetPhaseHarmonicCurrentMultiplier(chip::EndpointId endpoint, int8_t phaseHarmonicCurrentMultiplier); +EmberAfStatus GetInstantaneousVoltage(chip::EndpointId endpoint, int16_t * instantaneousVoltage); // int16s +EmberAfStatus SetInstantaneousVoltage(chip::EndpointId endpoint, int16_t instantaneousVoltage); +EmberAfStatus GetInstantaneousLineCurrent(chip::EndpointId endpoint, uint16_t * instantaneousLineCurrent); // int16u +EmberAfStatus SetInstantaneousLineCurrent(chip::EndpointId endpoint, uint16_t instantaneousLineCurrent); +EmberAfStatus GetInstantaneousActiveCurrent(chip::EndpointId endpoint, int16_t * instantaneousActiveCurrent); // int16s +EmberAfStatus SetInstantaneousActiveCurrent(chip::EndpointId endpoint, int16_t instantaneousActiveCurrent); +EmberAfStatus GetInstantaneousReactiveCurrent(chip::EndpointId endpoint, int16_t * instantaneousReactiveCurrent); // int16s +EmberAfStatus SetInstantaneousReactiveCurrent(chip::EndpointId endpoint, int16_t instantaneousReactiveCurrent); +EmberAfStatus GetInstantaneousPower(chip::EndpointId endpoint, int16_t * instantaneousPower); // int16s +EmberAfStatus SetInstantaneousPower(chip::EndpointId endpoint, int16_t instantaneousPower); +EmberAfStatus GetRmsVoltage(chip::EndpointId endpoint, uint16_t * rmsVoltage); // int16u +EmberAfStatus SetRmsVoltage(chip::EndpointId endpoint, uint16_t rmsVoltage); +EmberAfStatus GetRmsVoltageMin(chip::EndpointId endpoint, uint16_t * rmsVoltageMin); // int16u +EmberAfStatus SetRmsVoltageMin(chip::EndpointId endpoint, uint16_t rmsVoltageMin); +EmberAfStatus GetRmsVoltageMax(chip::EndpointId endpoint, uint16_t * rmsVoltageMax); // int16u +EmberAfStatus SetRmsVoltageMax(chip::EndpointId endpoint, uint16_t rmsVoltageMax); +EmberAfStatus GetRmsCurrent(chip::EndpointId endpoint, uint16_t * rmsCurrent); // int16u +EmberAfStatus SetRmsCurrent(chip::EndpointId endpoint, uint16_t rmsCurrent); +EmberAfStatus GetRmsCurrentMin(chip::EndpointId endpoint, uint16_t * rmsCurrentMin); // int16u +EmberAfStatus SetRmsCurrentMin(chip::EndpointId endpoint, uint16_t rmsCurrentMin); +EmberAfStatus GetRmsCurrentMax(chip::EndpointId endpoint, uint16_t * rmsCurrentMax); // int16u +EmberAfStatus SetRmsCurrentMax(chip::EndpointId endpoint, uint16_t rmsCurrentMax); +EmberAfStatus GetActivePower(chip::EndpointId endpoint, int16_t * activePower); // int16s +EmberAfStatus SetActivePower(chip::EndpointId endpoint, int16_t activePower); +EmberAfStatus GetActivePowerMin(chip::EndpointId endpoint, int16_t * activePowerMin); // int16s +EmberAfStatus SetActivePowerMin(chip::EndpointId endpoint, int16_t activePowerMin); +EmberAfStatus GetActivePowerMax(chip::EndpointId endpoint, int16_t * activePowerMax); // int16s +EmberAfStatus SetActivePowerMax(chip::EndpointId endpoint, int16_t activePowerMax); +EmberAfStatus GetReactivePower(chip::EndpointId endpoint, int16_t * reactivePower); // int16s +EmberAfStatus SetReactivePower(chip::EndpointId endpoint, int16_t reactivePower); +EmberAfStatus GetApparentPower(chip::EndpointId endpoint, uint16_t * apparentPower); // int16u +EmberAfStatus SetApparentPower(chip::EndpointId endpoint, uint16_t apparentPower); +EmberAfStatus GetPowerFactor(chip::EndpointId endpoint, int8_t * powerFactor); // int8s +EmberAfStatus SetPowerFactor(chip::EndpointId endpoint, int8_t powerFactor); +EmberAfStatus GetAverageRmsVoltageMeasurementPeriod(chip::EndpointId endpoint, + uint16_t * averageRmsVoltageMeasurementPeriod); // int16u +EmberAfStatus SetAverageRmsVoltageMeasurementPeriod(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriod); +EmberAfStatus GetAverageRmsUnderVoltageCounter(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounter); // int16u +EmberAfStatus SetAverageRmsUnderVoltageCounter(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounter); +EmberAfStatus GetRmsExtremeOverVoltagePeriod(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriod); // int16u +EmberAfStatus SetRmsExtremeOverVoltagePeriod(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriod); +EmberAfStatus GetRmsExtremeUnderVoltagePeriod(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriod); // int16u +EmberAfStatus SetRmsExtremeUnderVoltagePeriod(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriod); +EmberAfStatus GetRmsVoltageSagPeriod(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriod); // int16u +EmberAfStatus SetRmsVoltageSagPeriod(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriod); +EmberAfStatus GetRmsVoltageSwellPeriod(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriod); // int16u +EmberAfStatus SetRmsVoltageSwellPeriod(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriod); +EmberAfStatus GetAcVoltageMultiplier(chip::EndpointId endpoint, uint16_t * acVoltageMultiplier); // int16u +EmberAfStatus SetAcVoltageMultiplier(chip::EndpointId endpoint, uint16_t acVoltageMultiplier); +EmberAfStatus GetAcVoltageDivisor(chip::EndpointId endpoint, uint16_t * acVoltageDivisor); // int16u +EmberAfStatus SetAcVoltageDivisor(chip::EndpointId endpoint, uint16_t acVoltageDivisor); +EmberAfStatus GetAcCurrentMultiplier(chip::EndpointId endpoint, uint16_t * acCurrentMultiplier); // int16u +EmberAfStatus SetAcCurrentMultiplier(chip::EndpointId endpoint, uint16_t acCurrentMultiplier); +EmberAfStatus GetAcCurrentDivisor(chip::EndpointId endpoint, uint16_t * acCurrentDivisor); // int16u +EmberAfStatus SetAcCurrentDivisor(chip::EndpointId endpoint, uint16_t acCurrentDivisor); +EmberAfStatus GetAcPowerMultiplier(chip::EndpointId endpoint, uint16_t * acPowerMultiplier); // int16u +EmberAfStatus SetAcPowerMultiplier(chip::EndpointId endpoint, uint16_t acPowerMultiplier); +EmberAfStatus GetAcPowerDivisor(chip::EndpointId endpoint, uint16_t * acPowerDivisor); // int16u +EmberAfStatus SetAcPowerDivisor(chip::EndpointId endpoint, uint16_t acPowerDivisor); +EmberAfStatus GetOverloadAlarmsMask(chip::EndpointId endpoint, uint8_t * overloadAlarmsMask); // bitmap8 +EmberAfStatus SetOverloadAlarmsMask(chip::EndpointId endpoint, uint8_t overloadAlarmsMask); +EmberAfStatus GetVoltageOverload(chip::EndpointId endpoint, int16_t * voltageOverload); // int16s +EmberAfStatus SetVoltageOverload(chip::EndpointId endpoint, int16_t voltageOverload); +EmberAfStatus GetCurrentOverload(chip::EndpointId endpoint, int16_t * currentOverload); // int16s +EmberAfStatus SetCurrentOverload(chip::EndpointId endpoint, int16_t currentOverload); +EmberAfStatus GetAcOverloadAlarmsMask(chip::EndpointId endpoint, uint16_t * acOverloadAlarmsMask); // bitmap16 +EmberAfStatus SetAcOverloadAlarmsMask(chip::EndpointId endpoint, uint16_t acOverloadAlarmsMask); +EmberAfStatus GetAcVoltageOverload(chip::EndpointId endpoint, int16_t * acVoltageOverload); // int16s +EmberAfStatus SetAcVoltageOverload(chip::EndpointId endpoint, int16_t acVoltageOverload); +EmberAfStatus GetAcCurrentOverload(chip::EndpointId endpoint, int16_t * acCurrentOverload); // int16s +EmberAfStatus SetAcCurrentOverload(chip::EndpointId endpoint, int16_t acCurrentOverload); +EmberAfStatus GetAcActivePowerOverload(chip::EndpointId endpoint, int16_t * acActivePowerOverload); // int16s +EmberAfStatus SetAcActivePowerOverload(chip::EndpointId endpoint, int16_t acActivePowerOverload); +EmberAfStatus GetAcReactivePowerOverload(chip::EndpointId endpoint, int16_t * acReactivePowerOverload); // int16s +EmberAfStatus SetAcReactivePowerOverload(chip::EndpointId endpoint, int16_t acReactivePowerOverload); +EmberAfStatus GetAverageRmsOverVoltage(chip::EndpointId endpoint, int16_t * averageRmsOverVoltage); // int16s +EmberAfStatus SetAverageRmsOverVoltage(chip::EndpointId endpoint, int16_t averageRmsOverVoltage); +EmberAfStatus GetAverageRmsUnderVoltage(chip::EndpointId endpoint, int16_t * averageRmsUnderVoltage); // int16s +EmberAfStatus SetAverageRmsUnderVoltage(chip::EndpointId endpoint, int16_t averageRmsUnderVoltage); +EmberAfStatus GetRmsExtremeOverVoltage(chip::EndpointId endpoint, int16_t * rmsExtremeOverVoltage); // int16s +EmberAfStatus SetRmsExtremeOverVoltage(chip::EndpointId endpoint, int16_t rmsExtremeOverVoltage); +EmberAfStatus GetRmsExtremeUnderVoltage(chip::EndpointId endpoint, int16_t * rmsExtremeUnderVoltage); // int16s +EmberAfStatus SetRmsExtremeUnderVoltage(chip::EndpointId endpoint, int16_t rmsExtremeUnderVoltage); +EmberAfStatus GetRmsVoltageSag(chip::EndpointId endpoint, int16_t * rmsVoltageSag); // int16s +EmberAfStatus SetRmsVoltageSag(chip::EndpointId endpoint, int16_t rmsVoltageSag); +EmberAfStatus GetRmsVoltageSwell(chip::EndpointId endpoint, int16_t * rmsVoltageSwell); // int16s +EmberAfStatus SetRmsVoltageSwell(chip::EndpointId endpoint, int16_t rmsVoltageSwell); +EmberAfStatus GetLineCurrentPhaseB(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseB); // int16u +EmberAfStatus SetLineCurrentPhaseB(chip::EndpointId endpoint, uint16_t lineCurrentPhaseB); +EmberAfStatus GetActiveCurrentPhaseB(chip::EndpointId endpoint, int16_t * activeCurrentPhaseB); // int16s +EmberAfStatus SetActiveCurrentPhaseB(chip::EndpointId endpoint, int16_t activeCurrentPhaseB); +EmberAfStatus GetReactiveCurrentPhaseB(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseB); // int16s +EmberAfStatus SetReactiveCurrentPhaseB(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseB); +EmberAfStatus GetRmsVoltagePhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseB); // int16u +EmberAfStatus SetRmsVoltagePhaseB(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseB); +EmberAfStatus GetRmsVoltageMinPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseB); // int16u +EmberAfStatus SetRmsVoltageMinPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseB); +EmberAfStatus GetRmsVoltageMaxPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseB); // int16u +EmberAfStatus SetRmsVoltageMaxPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseB); +EmberAfStatus GetRmsCurrentPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseB); // int16u +EmberAfStatus SetRmsCurrentPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseB); +EmberAfStatus GetRmsCurrentMinPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseB); // int16u +EmberAfStatus SetRmsCurrentMinPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseB); +EmberAfStatus GetRmsCurrentMaxPhaseB(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseB); // int16u +EmberAfStatus SetRmsCurrentMaxPhaseB(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseB); +EmberAfStatus GetActivePowerPhaseB(chip::EndpointId endpoint, int16_t * activePowerPhaseB); // int16s +EmberAfStatus SetActivePowerPhaseB(chip::EndpointId endpoint, int16_t activePowerPhaseB); +EmberAfStatus GetActivePowerMinPhaseB(chip::EndpointId endpoint, int16_t * activePowerMinPhaseB); // int16s +EmberAfStatus SetActivePowerMinPhaseB(chip::EndpointId endpoint, int16_t activePowerMinPhaseB); +EmberAfStatus GetActivePowerMaxPhaseB(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseB); // int16s +EmberAfStatus SetActivePowerMaxPhaseB(chip::EndpointId endpoint, int16_t activePowerMaxPhaseB); +EmberAfStatus GetReactivePowerPhaseB(chip::EndpointId endpoint, int16_t * reactivePowerPhaseB); // int16s +EmberAfStatus SetReactivePowerPhaseB(chip::EndpointId endpoint, int16_t reactivePowerPhaseB); +EmberAfStatus GetApparentPowerPhaseB(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseB); // int16u +EmberAfStatus SetApparentPowerPhaseB(chip::EndpointId endpoint, uint16_t apparentPowerPhaseB); +EmberAfStatus GetPowerFactorPhaseB(chip::EndpointId endpoint, int8_t * powerFactorPhaseB); // int8s +EmberAfStatus SetPowerFactorPhaseB(chip::EndpointId endpoint, int8_t powerFactorPhaseB); +EmberAfStatus GetAverageRmsVoltageMeasurementPeriodPhaseB(chip::EndpointId endpoint, + uint16_t * averageRmsVoltageMeasurementPeriodPhaseB); // int16u +EmberAfStatus SetAverageRmsVoltageMeasurementPeriodPhaseB(chip::EndpointId endpoint, + uint16_t averageRmsVoltageMeasurementPeriodPhaseB); +EmberAfStatus GetAverageRmsOverVoltageCounterPhaseB(chip::EndpointId endpoint, + uint16_t * averageRmsOverVoltageCounterPhaseB); // int16u +EmberAfStatus SetAverageRmsOverVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseB); +EmberAfStatus GetAverageRmsUnderVoltageCounterPhaseB(chip::EndpointId endpoint, + uint16_t * averageRmsUnderVoltageCounterPhaseB); // int16u +EmberAfStatus SetAverageRmsUnderVoltageCounterPhaseB(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseB); +EmberAfStatus GetRmsExtremeOverVoltagePeriodPhaseB(chip::EndpointId endpoint, + uint16_t * rmsExtremeOverVoltagePeriodPhaseB); // int16u +EmberAfStatus SetRmsExtremeOverVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseB); +EmberAfStatus GetRmsExtremeUnderVoltagePeriodPhaseB(chip::EndpointId endpoint, + uint16_t * rmsExtremeUnderVoltagePeriodPhaseB); // int16u +EmberAfStatus SetRmsExtremeUnderVoltagePeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseB); +EmberAfStatus GetRmsVoltageSagPeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseB); // int16u +EmberAfStatus SetRmsVoltageSagPeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseB); +EmberAfStatus GetRmsVoltageSwellPeriodPhaseB(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseB); // int16u +EmberAfStatus SetRmsVoltageSwellPeriodPhaseB(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseB); +EmberAfStatus GetLineCurrentPhaseC(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseC); // int16u +EmberAfStatus SetLineCurrentPhaseC(chip::EndpointId endpoint, uint16_t lineCurrentPhaseC); +EmberAfStatus GetActiveCurrentPhaseC(chip::EndpointId endpoint, int16_t * activeCurrentPhaseC); // int16s +EmberAfStatus SetActiveCurrentPhaseC(chip::EndpointId endpoint, int16_t activeCurrentPhaseC); +EmberAfStatus GetReactiveCurrentPhaseC(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseC); // int16s +EmberAfStatus SetReactiveCurrentPhaseC(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseC); +EmberAfStatus GetRmsVoltagePhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseC); // int16u +EmberAfStatus SetRmsVoltagePhaseC(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseC); +EmberAfStatus GetRmsVoltageMinPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseC); // int16u +EmberAfStatus SetRmsVoltageMinPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseC); +EmberAfStatus GetRmsVoltageMaxPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseC); // int16u +EmberAfStatus SetRmsVoltageMaxPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseC); +EmberAfStatus GetRmsCurrentPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseC); // int16u +EmberAfStatus SetRmsCurrentPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseC); +EmberAfStatus GetRmsCurrentMinPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseC); // int16u +EmberAfStatus SetRmsCurrentMinPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseC); +EmberAfStatus GetRmsCurrentMaxPhaseC(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseC); // int16u +EmberAfStatus SetRmsCurrentMaxPhaseC(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseC); +EmberAfStatus GetActivePowerPhaseC(chip::EndpointId endpoint, int16_t * activePowerPhaseC); // int16s +EmberAfStatus SetActivePowerPhaseC(chip::EndpointId endpoint, int16_t activePowerPhaseC); +EmberAfStatus GetActivePowerMinPhaseC(chip::EndpointId endpoint, int16_t * activePowerMinPhaseC); // int16s +EmberAfStatus SetActivePowerMinPhaseC(chip::EndpointId endpoint, int16_t activePowerMinPhaseC); +EmberAfStatus GetActivePowerMaxPhaseC(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseC); // int16s +EmberAfStatus SetActivePowerMaxPhaseC(chip::EndpointId endpoint, int16_t activePowerMaxPhaseC); +EmberAfStatus GetReactivePowerPhaseC(chip::EndpointId endpoint, int16_t * reactivePowerPhaseC); // int16s +EmberAfStatus SetReactivePowerPhaseC(chip::EndpointId endpoint, int16_t reactivePowerPhaseC); +EmberAfStatus GetApparentPowerPhaseC(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseC); // int16u +EmberAfStatus SetApparentPowerPhaseC(chip::EndpointId endpoint, uint16_t apparentPowerPhaseC); +EmberAfStatus GetPowerFactorPhaseC(chip::EndpointId endpoint, int8_t * powerFactorPhaseC); // int8s +EmberAfStatus SetPowerFactorPhaseC(chip::EndpointId endpoint, int8_t powerFactorPhaseC); +EmberAfStatus GetAverageRmsVoltageMeasurementPeriodPhaseC(chip::EndpointId endpoint, + uint16_t * averageRmsVoltageMeasurementPeriodPhaseC); // int16u +EmberAfStatus SetAverageRmsVoltageMeasurementPeriodPhaseC(chip::EndpointId endpoint, + uint16_t averageRmsVoltageMeasurementPeriodPhaseC); +EmberAfStatus GetAverageRmsOverVoltageCounterPhaseC(chip::EndpointId endpoint, + uint16_t * averageRmsOverVoltageCounterPhaseC); // int16u +EmberAfStatus SetAverageRmsOverVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseC); +EmberAfStatus GetAverageRmsUnderVoltageCounterPhaseC(chip::EndpointId endpoint, + uint16_t * averageRmsUnderVoltageCounterPhaseC); // int16u +EmberAfStatus SetAverageRmsUnderVoltageCounterPhaseC(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseC); +EmberAfStatus GetRmsExtremeOverVoltagePeriodPhaseC(chip::EndpointId endpoint, + uint16_t * rmsExtremeOverVoltagePeriodPhaseC); // int16u +EmberAfStatus SetRmsExtremeOverVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseC); +EmberAfStatus GetRmsExtremeUnderVoltagePeriodPhaseC(chip::EndpointId endpoint, + uint16_t * rmsExtremeUnderVoltagePeriodPhaseC); // int16u +EmberAfStatus SetRmsExtremeUnderVoltagePeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseC); +EmberAfStatus GetRmsVoltageSagPeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseC); // int16u +EmberAfStatus SetRmsVoltageSagPeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseC); +EmberAfStatus GetRmsVoltageSwellPeriodPhaseC(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseC); // int16u +EmberAfStatus SetRmsVoltageSwellPeriodPhaseC(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseC); +} // namespace Attributes +} // namespace ElectricalMeasurement + +namespace GroupKeyManagement { +namespace Attributes { +} // namespace Attributes +} // namespace GroupKeyManagement + +namespace SampleMfgSpecificCluster { +namespace Attributes { +EmberAfStatus GetEmberSampleAttribute(chip::EndpointId endpoint, uint8_t * emberSampleAttribute); // int8u +EmberAfStatus SetEmberSampleAttribute(chip::EndpointId endpoint, uint8_t emberSampleAttribute); +EmberAfStatus GetEmberSampleAttribute2(chip::EndpointId endpoint, uint8_t * emberSampleAttribute2); // int8u +EmberAfStatus SetEmberSampleAttribute2(chip::EndpointId endpoint, uint8_t emberSampleAttribute2); +} // namespace Attributes +} // namespace SampleMfgSpecificCluster + +namespace SampleMfgSpecificCluster2 { +namespace Attributes { +EmberAfStatus GetEmberSampleAttribute3(chip::EndpointId endpoint, uint16_t * emberSampleAttribute3); // int16u +EmberAfStatus SetEmberSampleAttribute3(chip::EndpointId endpoint, uint16_t emberSampleAttribute3); +EmberAfStatus GetEmberSampleAttribute4(chip::EndpointId endpoint, uint16_t * emberSampleAttribute4); // int16u +EmberAfStatus SetEmberSampleAttribute4(chip::EndpointId endpoint, uint16_t emberSampleAttribute4); +} // namespace Attributes +} // namespace SampleMfgSpecificCluster2 + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/common/gen/callback.h b/src/app/common/gen/callback.h index 1e77125c389a75..f1d48e5d1549c2 100644 --- a/src/app/common/gen/callback.h +++ b/src/app/common/gen/callback.h @@ -15824,7 +15824,7 @@ bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(chip::app::Command */ bool emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(chip::app::Command * commandObj, uint8_t status, chip::ByteSpan content, - /* TYPE WARNING: unknown defaults to */ uint8_t * timeStamp, + /* TYPE WARNING: utc defaults to */ uint8_t * timeStamp, uint32_t timeSinceBoot); /** @@ -16854,7 +16854,7 @@ bool emberAfTestClusterClusterTestUnknownCommandCallback(chip::app::Command * co * @brief Cluster DisplayMessage Command callback */ bool emberAfMessagingClusterDisplayMessageCallback(chip::app::Command * commandObj, uint32_t messageId, uint8_t messageControl, - /* TYPE WARNING: unknown defaults to */ uint8_t * startTime, + /* TYPE WARNING: utc defaults to */ uint8_t * startTime, uint16_t durationInMinutes, uint8_t * message, uint8_t optionalExtendedMessageControl); @@ -16872,7 +16872,7 @@ bool emberAfMessagingClusterCancelMessageCallback(chip::app::Command * commandOb * @brief Cluster MessageConfirmation Command callback */ bool emberAfMessagingClusterMessageConfirmationCallback(chip::app::Command * commandObj, uint32_t messageId, - /* TYPE WARNING: unknown defaults to */ uint8_t * confirmationTime, + /* TYPE WARNING: utc defaults to */ uint8_t * confirmationTime, uint8_t messageConfirmationControl, chip::ByteSpan messageResponse); /** @@ -16880,7 +16880,7 @@ bool emberAfMessagingClusterMessageConfirmationCallback(chip::app::Command * com */ bool emberAfMessagingClusterDisplayProtectedMessageCallback(chip::app::Command * commandObj, uint32_t messageId, uint8_t messageControl, - /* TYPE WARNING: unknown defaults to */ uint8_t * startTime, + /* TYPE WARNING: utc defaults to */ uint8_t * startTime, uint16_t durationInMinutes, uint8_t * message, uint8_t optionalExtendedMessageControl); @@ -16888,13 +16888,13 @@ bool emberAfMessagingClusterDisplayProtectedMessageCallback(chip::app::Command * * @brief Cluster GetMessageCancellation Command callback */ bool emberAfMessagingClusterGetMessageCancellationCallback( - chip::app::Command * commandObj, /* TYPE WARNING: unknown defaults to */ uint8_t * earliestImplementationTime); + chip::app::Command * commandObj, /* TYPE WARNING: utc defaults to */ uint8_t * earliestImplementationTime); /** * @brief Cluster CancelAllMessages Command callback */ bool emberAfMessagingClusterCancelAllMessagesCallback(chip::app::Command * commandObj, - /* TYPE WARNING: unknown defaults to */ uint8_t * implementationDateTime); + /* TYPE WARNING: utc defaults to */ uint8_t * implementationDateTime); /** * @brief Cluster GetAlerts Command callback diff --git a/src/app/common/gen/client-command-macro.h b/src/app/common/gen/client-command-macro.h index d34670af04310d..a271b5f619d55c 100644 --- a/src/app/common/gen/client-command-macro.h +++ b/src/app/common/gen/client-command-macro.h @@ -2130,7 +2130,7 @@ * Command: RetrieveLogsResponse * @param status LogsStatus * @param content OCTET_STRING - * @param timeStamp UTC_TIME + * @param timeStamp UTC * @param timeSinceBoot INT32U */ #define emberAfFillCommandDiagnostic \ @@ -4675,7 +4675,7 @@ * Command: DisplayMessage * @param messageId INT32U * @param messageControl MessagingControlMask - * @param startTime UTC_TIME + * @param startTime UTC * @param durationInMinutes INT16U * @param message CHAR_STRING * @param optionalExtendedMessageControl MessagingExtendedControlMask @@ -4720,7 +4720,7 @@ /** @brief Command description for MessageConfirmation * * Command: MessageConfirmation - * @param confirmationTime UTC_TIME + * @param confirmationTime UTC * @param messageConfirmationControl BITMAP8 * @param messageResponse OCTET_STRING */ @@ -4743,7 +4743,7 @@ /** @brief Command description for GetMessageCancellation * * Command: GetMessageCancellation - * @param earliestImplementationTime UTC_TIME + * @param earliestImplementationTime UTC */ #define emberAfFillCommandMessagingClusterGetMessageCancellation(earliestImplementationTime) \ emberAfFillExternalBuffer(mask, \ @@ -4754,7 +4754,7 @@ * * Command: DisplayProtectedMessage * @param messageControl MessagingControlMask - * @param startTime UTC_TIME + * @param startTime UTC * @param durationInMinutes INT16U * @param message CHAR_STRING * @param optionalExtendedMessageControl MessagingExtendedControlMask @@ -4769,7 +4769,7 @@ /** @brief Command description for CancelAllMessages * * Command: CancelAllMessages - * @param implementationDateTime UTC_TIME + * @param implementationDateTime UTC */ #define emberAfFillCommandMessagingClusterCancelAllMessages(implementationDateTime) \ emberAfFillExternalBuffer(mask, \ diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 663085f33744d8..63ed2b78d09f81 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -4,6 +4,7 @@ "helpers": [ "../../zap-templates/partials/helper.js", "../../zap-templates/common/StringHelper.js", + "../../zap-templates/common/attributes/Accessors.js", "../../zap-templates/templates/app/helper.js", "../../zap-templates/templates/chip/helper.js" ], @@ -70,6 +71,16 @@ "name": "ZCL print-cluster header", "output": "src/app/common/gen/print-cluster.h" }, + { + "path": "../../zap-templates/templates/app/attributes/Accessors.zapt", + "name": "Attributes Accessors header", + "output": "src/app/common/gen/attributes/Accessors.h" + }, + { + "path": "../../zap-templates/templates/app/attributes/Accessors-src.zapt", + "name": "Attributes Accessors", + "output": "src/app/common/gen/attributes/Accessors.cpp" + }, { "path": "../../zap-templates/templates/app/ids/Attributes.zapt", "name": "Attributes Ids header", diff --git a/src/app/zap-templates/common/StructHelper.js b/src/app/zap-templates/common/StructHelper.js new file mode 100644 index 00000000000000..8e37a6ba056295 --- /dev/null +++ b/src/app/zap-templates/common/StructHelper.js @@ -0,0 +1,28 @@ +/* + * + * 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. + */ + +const kType = 'STRUCT'; + +function isStruct(type) +{ + return type.toUpperCase() == kType; +} + +// +// Module exports +// +exports.isStruct = isStruct; diff --git a/src/app/zap-templates/common/attributes/Accessors.js b/src/app/zap-templates/common/attributes/Accessors.js new file mode 100644 index 00000000000000..5f5937f19cc0af --- /dev/null +++ b/src/app/zap-templates/common/attributes/Accessors.js @@ -0,0 +1,56 @@ +/* + * + * 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. + */ + +const ListHelper = require('../../common/ListHelper.js'); +const StringHelper = require('../../common/StringHelper.js'); +const StructHelper = require('../../common/StructHelper.js'); + +// Issue #8202 +// The specification allow non-standard signed and unsigned integer with a width of 24, 40, 48 or 56, but those types does not have +// proper support yet into the codebase and the resulting generated code can not be built with them. +// Once they are supported, the following method could be removed. +const unsupportedTypes = [ 'INT24S', 'INT40S', 'INT48S', 'INT56S', 'INT24U', 'INT40U', 'INT48U', 'INT56U' ]; +function isUnsupportedType(type) +{ + return unsupportedTypes.includes(type.toUpperCase()); +} + +function canHaveSimpleAccessors(type) +{ + if (StringHelper.isString(type)) { + return false; + } + + if (ListHelper.isList(type)) { + return false; + } + + if (StructHelper.isStruct(type)) { + return false; + } + + if (isUnsupportedType(type)) { + return false; + } + + return true; +} + +// +// Module exports +// +exports.canHaveSimpleAccessors = canHaveSimpleAccessors; diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index ea3c1a99e41508..143ad8880d0313 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -46,6 +46,8 @@ function atomicType(arg) case 'octet_string': case 'long_octet_string': return 'chip::ByteSpan'; + case 'eui64': + return 'chip::node_id'; default: throw 'not overriding'; } diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt new file mode 100644 index 00000000000000..634b6a5b9c6628 --- /dev/null +++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt @@ -0,0 +1,50 @@ +{{>header}} + +/** + * @file + * This file contains definitions for accessors around clusters attributes. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +{{#zcl_clusters}} +{{#zcl_attributes_server}} +{{#if (hasSpecificAttributes)}} +{{#first}} +namespace {{asUpperCamelCase parent.label}} { +namespace Attributes { +{{/first}} +{{#if clusterRef}} +{{#if (canHaveSimpleAccessors type)}} +EmberAfStatus Get{{asUpperCamelCase label}}(chip::EndpointId endpoint, {{asUnderlyingZclType type}} * {{asLowerCamelCase label}}) +{ + return emberAfReadServerAttribute(endpoint, {{asUpperCamelCase parent.label}}::Id, Ids::{{asUpperCamelCase label}}, (uint8_t *) {{asLowerCamelCase label}}, sizeof(*{{asLowerCamelCase label}})); + +} +EmberAfStatus Set{{asUpperCamelCase label}}(chip::EndpointId endpoint, {{asUnderlyingZclType type}} {{asLowerCamelCase label}}) +{ + return emberAfWriteServerAttribute(endpoint, {{asUpperCamelCase parent.label}}::Id, Ids::{{asUpperCamelCase label}}, (uint8_t *) &{{asLowerCamelCase label}}, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); +} +{{/if}} +{{/if}} +{{#last}} +} // namespace Attributes +} // {{asUpperCamelCase parent.label}} + +{{/last}} +{{/if}} +{{/zcl_attributes_server}} +{{/zcl_clusters}} + +} // Clusters +} // app +} // chip diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt new file mode 100644 index 00000000000000..e4e8ee1c3ddddf --- /dev/null +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -0,0 +1,41 @@ +{{>header}} + +/** + * @file + * This file contains declarations for accessors around clusters attributes. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +{{#zcl_clusters}} +{{#zcl_attributes_server}} +{{#if (hasSpecificAttributes)}} +{{#first}} +namespace {{asUpperCamelCase parent.label}} { +namespace Attributes { +{{/first}} +{{#if clusterRef}} +{{#if (canHaveSimpleAccessors type)}} +EmberAfStatus Get{{asUpperCamelCase label}}(chip::EndpointId endpoint, {{asUnderlyingZclType type}} * {{asLowerCamelCase label}}); // {{type}} {{isArray}} +EmberAfStatus Set{{asUpperCamelCase label}}(chip::EndpointId endpoint, {{asUnderlyingZclType type}} {{asLowerCamelCase label}}); +{{/if}} +{{/if}} +{{#last}} +} // namespace Attributes +} // {{asUpperCamelCase parent.label}} + +{{/last}} +{{/if}} +{{/zcl_attributes_server}} +{{/zcl_clusters}} + +} // Clusters +} // app +} // chip diff --git a/src/app/zap-templates/templates/app/ids/Attributes.zapt b/src/app/zap-templates/templates/app/ids/Attributes.zapt index 7fabae1fc786bc..6a3901f4b70e57 100644 --- a/src/app/zap-templates/templates/app/ids/Attributes.zapt +++ b/src/app/zap-templates/templates/app/ids/Attributes.zapt @@ -9,13 +9,11 @@ namespace Clusters { namespace Globals { namespace Attributes { namespace Ids { -{{#zcl_attributes}} -{{#if (isServer side)}} +{{#zcl_attributes_server}} {{#unless clusterRef}} static constexpr AttributeId {{asUpperCamelCase label}} = {{asHex code 4}}; {{/unless}} -{{/if}} -{{/zcl_attributes}} +{{/zcl_attributes_server}} } // namespace Ids } // namespace Attributes } // namespace Globals diff --git a/src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml index 89db19d93bfab8..6ee8ec6e663b48 100644 --- a/src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml @@ -50,7 +50,7 @@ limitations under the License. Response to the RetrieveLogsRequest - + diff --git a/src/app/zap-templates/zcl/data-model/silabs/ami.xml b/src/app/zap-templates/zcl/data-model/silabs/ami.xml index d2ba0e57653bf3..9df7328e3572d6 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ami.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ami.xml @@ -77,7 +77,7 @@ limitations under the License. - + @@ -95,7 +95,7 @@ limitations under the License. - + @@ -104,7 +104,7 @@ limitations under the License. The CancelAllMessages command indicates to a client device that it should cancel all display messages currently held by it. - + @@ -117,7 +117,7 @@ limitations under the License. The Message Confirmation command provides an indication that a Utility Customer has acknowledged and/or accepted the contents of a previously sent message. Enhanced Message Confirmation commands shall contain an answer of 'NO', 'YES' and/or a message confirmation string. - + @@ -125,7 +125,7 @@ limitations under the License. This command initiates the return of the first (and maybe only) Cancel All Messages command held on the associated server, and which has an implementation time equal to or later than the value indicated in the payload. - + diff --git a/src/app/zap-templates/zcl/data-model/silabs/general.xml b/src/app/zap-templates/zcl/data-model/silabs/general.xml index 578bc757d363f9..e0fa27b0a59596 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/general.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/general.xml @@ -389,7 +389,7 @@ limitations under the License. scene valid name support - last configured by + last configured by Add a scene to the scene table. Extension field sets are supported, and are inputed as arrays of the form [[cluster ID] [length] [value0...n] ...] diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index fab7113b9d3bb1..ec335aab92acd1 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -90,7 +90,7 @@ limitations under the License. hvac relay state setpoint change source setpoint change amount - setpoint change source timestamp + setpoint change source timestamp ac type ac capacity ac refrigerant type @@ -505,13 +505,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -523,13 +523,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -541,13 +541,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -559,13 +559,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -577,13 +577,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -595,13 +595,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -613,13 +613,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -631,13 +631,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -649,13 +649,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -667,13 +667,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -685,13 +685,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -703,13 +703,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -721,13 +721,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -739,13 +739,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -757,13 +757,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -775,13 +775,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -793,13 +793,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -811,13 +811,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -829,13 +829,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -847,13 +847,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -865,13 +865,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -883,13 +883,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -901,13 +901,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -919,13 +919,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -937,13 +937,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -955,13 +955,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -973,13 +973,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -991,13 +991,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -1009,13 +1009,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance @@ -1027,13 +1027,13 @@ limitations under the License. true true - measured value + measured value - min measured value + min measured value - max measured value + max measured value - tolerance + tolerance From d2f2409e10548ec9826699e0d0b441ad46e24aae Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Thu, 8 Jul 2021 16:02:25 -0400 Subject: [PATCH 18/47] Fix more style and comments in src/crypto (#8215) - Address comments from @bzbarsky-apple Fixes #8208 --- src/crypto/CHIPCryptoPAL.h | 48 ++++++++++++++++++++++++++--- src/crypto/CHIPCryptoPALOpenSSL.cpp | 2 +- src/crypto/CHIPCryptoPALmbedTLS.cpp | 2 +- src/crypto/hsm/CHIPCryptoPALHsm.h | 10 +----- 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 1f98534704a1f5..566b834ac946db 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -293,7 +293,13 @@ class P256Keypair : public ECPKeypair 0, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_length >= CHIP_CRYPTO_HASH_LEN_BYTES, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); CHIP_ERROR error = CHIP_ERROR_INTERNAL; diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index ceb7c5f5b978a6..c51868896f1364 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -281,7 +281,7 @@ CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const u VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_length >= CHIP_CRYPTO_HASH_LEN_BYTES, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); const mbedtls_md_info_t * const md = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); diff --git a/src/crypto/hsm/CHIPCryptoPALHsm.h b/src/crypto/hsm/CHIPCryptoPALHsm.h index a00106a1540093..214b7ef583be6d 100644 --- a/src/crypto/hsm/CHIPCryptoPALHsm.h +++ b/src/crypto/hsm/CHIPCryptoPALHsm.h @@ -176,10 +176,6 @@ class HKDF_shaHSM : public HKDF_sha const size_t salt_length, const uint8_t * info, const size_t info_length, uint8_t * out_buffer, size_t out_length) override; - void SetKeyId(uint32_t id) { keyid = id; } - - uint32_t GetKeyId() { return keyid; } - private: uint32_t keyid; }; @@ -195,11 +191,7 @@ class HMAC_shaHSM : public HMAC_sha ~HMAC_shaHSM(); virtual CHIP_ERROR HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, - uint8_t * out_buffer, size_t out_length); - - void SetKeyId(uint32_t id) { keyid = id; } - - uint32_t GetKeyId() { return keyid; } + uint8_t * out_buffer, size_t out_length) override; private: uint32_t keyid; From e55ad303338b15260503cef933b94416279ce178 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Thu, 8 Jul 2021 13:51:57 -0700 Subject: [PATCH 19/47] Add ObjC Thread Operational Dataset (#8172) * Add an ObjC wrapper for the CHIP Thread Operational Dataset * Restyled by clang-format * Address review comments * Restyled by clang-format * address comments * Restyled by clang-format Co-authored-by: Restyled.io --- .../Framework/CHIP.xcodeproj/project.pbxproj | 13 +- src/darwin/Framework/CHIP/CHIP.h | 1 + .../CHIP/CHIPThreadOperationalDataset.h | 81 ++++++++++++ .../CHIP/CHIPThreadOperationalDataset.mm | 119 ++++++++++++++++++ .../CHIPThreadOperationalDatasetTests.mm | 68 ++++++++++ 5 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h create mode 100644 src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm create mode 100644 src/darwin/Framework/CHIPTests/CHIPThreadOperationalDatasetTests.mm diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index 1c5b57f67a9369..46c561108c8a30 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -53,6 +53,9 @@ 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 */; }; + 997DED162695343400975E97 /* CHIPThreadOperationalDataset.mm in Sources */ = {isa = PBXBuildFile; fileRef = 997DED152695343400975E97 /* CHIPThreadOperationalDataset.mm */; }; + 997DED182695344800975E97 /* CHIPThreadOperationalDataset.h in Headers */ = {isa = PBXBuildFile; fileRef = 997DED172695344800975E97 /* CHIPThreadOperationalDataset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 997DED1A26955D0200975E97 /* CHIPThreadOperationalDatasetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 997DED1926955D0200975E97 /* CHIPThreadOperationalDatasetTests.mm */; }; 99C65E10267282F1003402F6 /* CHIPControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C65E0F267282F1003402F6 /* CHIPControllerTests.m */; }; 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, ); }; }; @@ -127,6 +130,9 @@ 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 = ""; }; + 997DED152695343400975E97 /* CHIPThreadOperationalDataset.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPThreadOperationalDataset.mm; sourceTree = ""; }; + 997DED172695344800975E97 /* CHIPThreadOperationalDataset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPThreadOperationalDataset.h; sourceTree = ""; }; + 997DED1926955D0200975E97 /* CHIPThreadOperationalDatasetTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPThreadOperationalDatasetTests.mm; sourceTree = ""; }; 99C65E0F267282F1003402F6 /* CHIPControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHIPControllerTests.m; 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 = ""; }; @@ -243,6 +249,8 @@ 2C222ACE255C620600E446B9 /* CHIPDevice.h */, 2C222ACF255C620600E446B9 /* CHIPDevice.mm */, 2C8C8FBE253E0C2100797F05 /* CHIPPersistentStorageDelegate.h */, + 997DED152695343400975E97 /* CHIPThreadOperationalDataset.mm */, + 997DED172695344800975E97 /* CHIPThreadOperationalDataset.h */, 2C8C8FBD253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.h */, 2C8C8FBF253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.mm */, 2CB7163E252F731E0026E2BB /* CHIPDevicePairingDelegate.h */, @@ -274,6 +282,7 @@ 1EB41B7A263C4CC60048E4C1 /* CHIPClustersTests.m */, 99C65E0F267282F1003402F6 /* CHIPControllerTests.m */, B2F53AF1245B0DCF0010745E /* CHIPSetupPayloadParserTests.m */, + 997DED1926955D0200975E97 /* CHIPThreadOperationalDatasetTests.mm */, B202529D2459E34F00F97062 /* Info.plist */, ); path = CHIPTests; @@ -304,6 +313,7 @@ B2E0D7B2245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h in Headers */, B2E0D7B1245B0B5C003C5B48 /* CHIP.h in Headers */, B2E0D7B8245B0B5C003C5B48 /* CHIPSetupPayload.h in Headers */, + 997DED182695344800975E97 /* CHIPThreadOperationalDataset.h in Headers */, 9956064426420367000C28DE /* CHIPSetupPayload_Internal.h in Headers */, 2C8C8FC1253E0C2100797F05 /* CHIPPersistentStorageDelegate.h in Headers */, B2E0D7B5245B0B5C003C5B48 /* CHIPQRCodeSetupPayloadParser.h in Headers */, @@ -438,6 +448,7 @@ files = ( 2C8C8FC2253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.mm in Sources */, 2CB7163C252E8A7C0026E2BB /* CHIPDevicePairingDelegateBridge.mm in Sources */, + 997DED162695343400975E97 /* CHIPThreadOperationalDataset.mm in Sources */, 1E85732426551A490050A4D9 /* attribute-list-byte-span.cpp in Sources */, 1E85730E265519AE0050A4D9 /* CHIPClusters.cpp in Sources */, 1E85732326551A490050A4D9 /* process-global-message.cpp in Sources */, @@ -481,6 +492,7 @@ buildActionMask = 2147483647; files = ( 1EB41B7B263C4CC60048E4C1 /* CHIPClustersTests.m in Sources */, + 997DED1A26955D0200975E97 /* CHIPThreadOperationalDatasetTests.mm in Sources */, 99C65E10267282F1003402F6 /* CHIPControllerTests.m in Sources */, B2F53AF2245B0DCF0010745E /* CHIPSetupPayloadParserTests.m in Sources */, ); @@ -630,7 +642,6 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = CHIPTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/src/darwin/Framework/CHIP/CHIP.h b/src/darwin/Framework/CHIP/CHIP.h index 25b9e374dcffa3..d8bee0039a25e5 100644 --- a/src/darwin/Framework/CHIP/CHIP.h +++ b/src/darwin/Framework/CHIP/CHIP.h @@ -25,6 +25,7 @@ #import #import #import +#import #import //! Project version number for CHIP. diff --git a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h new file mode 100644 index 00000000000000..6543d9b9ede86f --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h @@ -0,0 +1,81 @@ +/** + * + * 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. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface CHIPThreadOperationalDataset : NSObject + +/** + * The expected lengths of each of the NSData fields in the CHIPThreadOperationalDataset + * + * initWithNetworkName must be provided NSData fields with at least these lengths otherwise + * the object will fail to init. + */ +extern size_t const CHIPSizeThreadNetworkName; +extern size_t const CHIPSizeThreadExtendedPanId; +extern size_t const CHIPSizeThreadMasterKey; +extern size_t const CHIPSizeThreadPSKc; + +/** + * The Thread Network name + */ +@property (nonatomic, nullable, readwrite) NSString * networkName; +/** + * The Thread Network extendended PAN ID + */ +@property (nonatomic, nullable, readwrite) NSData * extendedPANID; +/** + * The 16 byte Master Key + */ +@property (nonatomic, nullable, readwrite) NSData * masterKey; +/** + * The Thread PSKc + */ +@property (nonatomic, nullable, readwrite) NSData * PSKc; +/** + * The Thread network channel + */ +@property (nonatomic, readwrite) uint16_t channel; +/** + * The Thread PAN ID + */ +@property (nonatomic, nullable, readwrite) NSData * panID; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/** + * Create a Thread Operational Dataset object with the individual network fields. + * This initializer will return nil if any of the NSData fields are smaller than expected. + */ +- (nullable instancetype)initWithNetworkName:(NSString *)networkName + extendedPANID:(NSData *)extendedPANID + masterKey:(NSData *)masterKey + PSKc:(NSData *)PSKc + channel:(uint16_t)channel + panID:(NSData *)panID; + +/** + * Get the underlying data that represents the Thread Active Operational Dataset + */ +- (NSData *)asData; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm new file mode 100644 index 00000000000000..461af9ea113af4 --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm @@ -0,0 +1,119 @@ +/** + * + * 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. + */ + +#import "CHIPThreadOperationalDataset.h" + +#include "CHIPLogging.h" +#include +#include + +size_t const CHIPSizeThreadNetworkName = chip::Thread::kSizeNetworkName; +size_t const CHIPSizeThreadExtendedPanId = chip::Thread::kSizeExtendedPanId; +size_t const CHIPSizeThreadMasterKey = chip::Thread::kSizeMasterKey; +size_t const CHIPSizeThreadPSKc = chip::Thread::kSizePSKc; + +@interface CHIPThreadOperationalDataset () + +@property (readonly) chip::Thread::OperationalDataset cppThreadOperationalDataset; + +@end + +@implementation CHIPThreadOperationalDataset + +- (nullable instancetype)initWithNetworkName:(NSString *)networkName + extendedPANID:(NSData *)extendedPANID + masterKey:(NSData *)masterKey + PSKc:(NSData *)PSKc + channel:(uint16_t)channel + panID:(NSData *)panID +{ + if (self = [super init]) { + _networkName = networkName; + _extendedPANID = extendedPANID; + _masterKey = masterKey; + _PSKc = PSKc; + _channel = channel; + _panID = panID; + _cppThreadOperationalDataset = chip::Thread::OperationalDataset(); + if ([self _populateCppOperationalDataset]) { + return self; + } + } + return nil; +} + +- (BOOL)_populateCppOperationalDataset +{ + _cppThreadOperationalDataset.Clear(); + _cppThreadOperationalDataset.SetNetworkName([self.networkName cStringUsingEncoding:NSUTF8StringEncoding]); + + if (![self _checkDataLength:self.extendedPANID expectedLength:chip::Thread::kSizeExtendedPanId]) { + CHIP_LOG_ERROR("Invalid ExtendedPANID"); + return NO; + } + uint8_t extendedPanId[chip::Thread::kSizeExtendedPanId]; + [self.extendedPANID getBytes:&extendedPanId length:chip::Thread::kSizeExtendedPanId]; + _cppThreadOperationalDataset.SetExtendedPanId(extendedPanId); + + if (![self _checkDataLength:self.masterKey expectedLength:chip::Thread::kSizeMasterKey]) { + CHIP_LOG_ERROR("Invalid MasterKey"); + return NO; + } + uint8_t masterKey[chip::Thread::kSizeMasterKey]; + [self.masterKey getBytes:&masterKey length:chip::Thread::kSizeMasterKey]; + _cppThreadOperationalDataset.SetMasterKey(masterKey); + + if (![self _checkDataLength:self.PSKc expectedLength:chip::Thread::kSizePSKc]) { + CHIP_LOG_ERROR("Invalid PKSc"); + return NO; + } + uint8_t PSKc[chip::Thread::kSizePSKc]; + [self.PSKc getBytes:&PSKc length:chip::Thread::kSizePSKc]; + _cppThreadOperationalDataset.SetPSKc(PSKc); + + _cppThreadOperationalDataset.SetChannel(self.channel); + + // Thread's PAN ID is 2 bytes + if (![self _checkDataLength:self.panID expectedLength:2]) { + CHIP_LOG_ERROR("Invalid PAN ID"); + return NO; + } + uint16_t * valuePtr = (uint16_t *) [self.panID bytes]; + if (valuePtr == nullptr) { + return NO; + } + _cppThreadOperationalDataset.SetPanId(*valuePtr); + + return YES; +} + +- (BOOL)_checkDataLength:(NSData *)data expectedLength:(size_t)expectedLength +{ + if (data.length != expectedLength) { + CHIP_LOG_ERROR("Length Check Failed. Length:%tu is too short, must be at least %tu", data.length, expectedLength); + return NO; + } + return YES; +} + +- (NSData *)asData +{ + chip::ByteSpan span = _cppThreadOperationalDataset.AsByteSpan(); + return [NSData dataWithBytes:span.data() length:span.size()]; +} + +@end diff --git a/src/darwin/Framework/CHIPTests/CHIPThreadOperationalDatasetTests.mm b/src/darwin/Framework/CHIPTests/CHIPThreadOperationalDatasetTests.mm new file mode 100644 index 00000000000000..1f1b2390308a64 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/CHIPThreadOperationalDatasetTests.mm @@ -0,0 +1,68 @@ +// +// CHIPControllerTests.m +// CHIPControllerTests +/** + * + * 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. + */ + +#import + +// system dependencies +#import + +@interface CHIPThreadOperationalDatasetTests : XCTestCase + +@end + +@implementation CHIPThreadOperationalDatasetTests + +- (void)testThreadOperationalDataset +{ + const unsigned char extendedPANID[] = { 0x68, 0x09, 0x45, 0x04, 0xae, 0xef, 0x42, 0x67 }; + const unsigned char masterKey[] + = { 0x7c, 0x77, 0x08, 0x70, 0xeb, 0x05, 0xcc, 0x6d, 0xbe, 0xcc, 0x6d, 0x62, 0x32, 0xea, 0xb8, 0xb9 }; + const unsigned char PKSc[] = { 0xc4, 0xa3, 0x81, 0x25, 0x94, 0x77, 0x81, 0x99, 0x6e, 0xf5, 0x61, 0xdf, 0x8f, 0xb7, 0x8d, 0x23 }; + const uint16_t panID = 0x28f4; + CHIPThreadOperationalDataset * dataset = [[CHIPThreadOperationalDataset alloc] + initWithNetworkName:@"TestNetwork" + extendedPANID:[NSData dataWithBytes:&extendedPANID length:CHIPSizeThreadExtendedPanId] + masterKey:[NSData dataWithBytes:&masterKey length:CHIPSizeThreadMasterKey] + PSKc:[NSData dataWithBytes:&PKSc length:CHIPSizeThreadPSKc] + channel:25 + panID:[NSData dataWithBytes:&panID length:sizeof(panID)]]; + XCTAssertNotNil(dataset); + NSData * data = [dataset asData]; + XCTAssertNotNil(data); +} + +- (void)testThreadOperationalDatasetInvalid +{ + const unsigned char extendedPANID[] = { 0x67 }; + const unsigned char masterKey[] = {}; + const unsigned char PKSc[] = { 0xb7, 0x8d, 0x23 }; + const uint16_t panID = 0x0; + CHIPThreadOperationalDataset * dataset = + [[CHIPThreadOperationalDataset alloc] initWithNetworkName:@"TestNetwork" + extendedPANID:[NSData dataWithBytes:&extendedPANID length:sizeof(extendedPANID)] + masterKey:[NSData dataWithBytes:&masterKey length:sizeof(masterKey)] + PSKc:[NSData dataWithBytes:&PKSc length:sizeof(PKSc)] + channel:25 + panID:[NSData dataWithBytes:&panID length:sizeof(panID)]]; + + XCTAssertNil(dataset); +} + +@end From 046f46a2b8cce407f26d61e026908829419b3c86 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 9 Jul 2021 01:35:35 +0200 Subject: [PATCH 20/47] Zap use chip::ErrorStr into the BasicFilter template of CHIPClientCallbacks.h (#8213) * Use %s for logging the error instead of %d into CHIPClientCallbacks.zapt * Update gen/ folders --- examples/pump-app/pump-common/gen/CHIPClientCallbacks.h | 2 +- .../pump-controller-common/gen/CHIPClientCallbacks.h | 2 +- src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt | 2 +- src/controller/data_model/gen/CHIPClientCallbacks.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h index f83f7fa2d10158..07a3daae5d919b 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h @@ -69,7 +69,7 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelabl } else { - ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %d", err); + ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %s", chip::ErrorStr(err)); chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onFailure); cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.h b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.h index f83f7fa2d10158..07a3daae5d919b 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.h +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.h @@ -69,7 +69,7 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelabl } else { - ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %d", err); + ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %s", chip::ErrorStr(err)); chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onFailure); cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt index 7d0290f374b125..cd9cb2700da856 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt @@ -52,7 +52,7 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelabl } else { - ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %d", err); + ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %s", chip::ErrorStr(err)); chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onFailure); cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.h b/src/controller/data_model/gen/CHIPClientCallbacks.h index 2146f9207f3320..baec826308041b 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.h +++ b/src/controller/data_model/gen/CHIPClientCallbacks.h @@ -69,7 +69,7 @@ void BasicAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelabl } else { - ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %d", err); + ChipLogError(Zcl, "Failed to get value from TLV data for attribute reading response: %s", chip::ErrorStr(err)); chip::Callback::Callback * cb = chip::Callback::Callback::FromCancelable(onFailure); cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); From b9620ec71cd4475aabce13df6e5c25c0c3bcdccd Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 01:11:59 -0400 Subject: [PATCH 21/47] Add CI for disabling detail logging. (#8171) This way we won't have to worry about problems popping up if/when someone tries to do that. For now assuming no one really plans to disable error logging. --- .github/workflows/build.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index efe7ec04a0343a..86f382d23a0b06 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,9 +30,12 @@ jobs: strategy: matrix: - type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental] + type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental, no_detail_logging] + # Disabling progress logging does not compile yet. Once it does, we can add the no_progress_logging type. env: BUILD_TYPE: ${{ matrix.type }} + DETAIL_LOGGING: ${{ matrix.type != 'no_detail_logging' && matrix.type != 'no_progress_logging' }} + PROGRESS_LOGGING: ${{ matrix.type != 'no_progress_logging' }} runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -85,7 +88,7 @@ jobs: *) ;; esac - scripts/build/gn_gen.sh --args="$GN_ARGS" + scripts/build/gn_gen.sh --args="$GN_ARGS chip_detail_logging=${DETAIL_LOGGING} chip_progress_logging=${PROGRESS_LOGGING}" - name: Run Build timeout-minutes: 10 run: scripts/build/gn_build.sh From 742472b2420f077d5bfdc045028636d5870bd02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Fri, 9 Jul 2021 09:32:18 +0200 Subject: [PATCH 22/47] [workflows] Use shallow git clone in workflows (#8166) Some our github workflows fetch the entire commit history, allegedly to make bloat reports work, but after examining the bloat check script it appears that the requirement may be no longer valid. The bloat check script used to be run as part of the PR workflows, but now there's a separate workflow for the bloat report. Let's try if we can safely switch to the shallow cloning. --- .github/workflows/examples-efr32.yaml | 2 -- .github/workflows/examples-esp32.yaml | 2 -- .github/workflows/examples-k32w.yaml | 2 -- .github/workflows/examples-linux-standalone.yaml | 2 -- .github/workflows/examples-mbed.yaml | 2 -- .github/workflows/examples-nrfconnect.yaml | 2 -- .github/workflows/examples-qpg.yaml | 2 -- 7 files changed, 14 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 44dd78421cc4f1..6dadcf107ac576 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -42,9 +42,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true # - name: Initialize CodeQL # uses: github/codeql-action/init@v1 diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index ca2881cc02195b..83cb08898b0467 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -43,9 +43,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true # - name: Initialize CodeQL # uses: github/codeql-action/init@v1 diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 8d8c83352a70f4..7d7def5c6bdb67 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -41,9 +41,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true # - name: Initialize CodeQL # uses: github/codeql-action/init@v1 diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 1e3fccaa3c71de..11cbc4ff32f5b6 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -42,9 +42,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true # - name: Initialize CodeQL # uses: github/codeql-action/init@v1 diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index b9813a88f37c78..2a7c46bbb37211 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -47,9 +47,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true - name: Build example diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 0291ac42baff5d..136d47e2036e5c 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -42,9 +42,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true - name: Bootstrap timeout-minutes: 25 diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 774678f3bd2ea2..63a959fe333481 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -41,9 +41,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Fetch depth 0 to get all history and be able to check mergepoint for bloat report with: - fetch-depth: 0 submodules: true # - name: Initialize CodeQL # uses: github/codeql-action/init@v1 From 6628298a7372a0d73b9977df0c44963e4b9e0bc3 Mon Sep 17 00:00:00 2001 From: sujaygkulkarni-nxp <77627602+sujaygkulkarni-nxp@users.noreply.github.com> Date: Fri, 9 Jul 2021 18:51:42 +0530 Subject: [PATCH 23/47] using p256 key from HSM for CASE (#8217) --- src/credentials/CHIPOperationalCredentials.h | 7 +++++++ src/protocols/secure_channel/CASESession.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/credentials/CHIPOperationalCredentials.h b/src/credentials/CHIPOperationalCredentials.h index f6717781f57ebb..ced686114ef86b 100644 --- a/src/credentials/CHIPOperationalCredentials.h +++ b/src/credentials/CHIPOperationalCredentials.h @@ -28,6 +28,9 @@ #include #include #include +#if CHIP_CRYPTO_HSM +#include +#endif #include #include @@ -66,7 +69,11 @@ struct NodeCredentialMap struct NodeKeypairMap { CertificateKeyId trustedRootId; +#ifdef ENABLE_HSM_CASE_OPS_KEY + P256KeypairHSM keypair; +#else P256Keypair keypair; +#endif }; /** diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index 14b9b7fb27b51b..9080bea035b75e 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -254,7 +254,7 @@ class DLL_EXPORT CASESession : public Messaging::ExchangeDelegate, public Pairin Crypto::Hash_SHA256_stream mCommissioningHash; Crypto::P256PublicKey mRemotePubKey; #ifdef ENABLE_HSM_CASE_EPHERMAL_KEY - P256KeypairHSM mEphemeralKey; + Crypto::P256KeypairHSM mEphemeralKey; #else Crypto::P256Keypair mEphemeralKey; #endif From 2374d806b26ea35fbdd65107c03cf8d0a08ace61 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Fri, 9 Jul 2021 07:45:19 -0700 Subject: [PATCH 24/47] Fix log and add slight clarification (#8225) --- src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h | 6 ++++-- src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h index 6543d9b9ede86f..ae37aa90d2c6f5 100644 --- a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h +++ b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.h @@ -53,7 +53,7 @@ extern size_t const CHIPSizeThreadPSKc; */ @property (nonatomic, readwrite) uint16_t channel; /** - * The Thread PAN ID + * A uint16_t stored as 2-bytes in host order representing the Thread PAN ID */ @property (nonatomic, nullable, readwrite) NSData * panID; @@ -62,7 +62,9 @@ extern size_t const CHIPSizeThreadPSKc; /** * Create a Thread Operational Dataset object with the individual network fields. - * This initializer will return nil if any of the NSData fields are smaller than expected. + * This initializer will return nil if any of the NSData fields don't match the expected size. + * + * Note: The panID is expected to be a uint16_t stored as 2-bytes in host order */ - (nullable instancetype)initWithNetworkName:(NSString *)networkName extendedPANID:(NSData *)extendedPANID diff --git a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm index 461af9ea113af4..b48dcb0dc647bb 100644 --- a/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm +++ b/src/darwin/Framework/CHIP/CHIPThreadOperationalDataset.mm @@ -104,7 +104,7 @@ - (BOOL)_populateCppOperationalDataset - (BOOL)_checkDataLength:(NSData *)data expectedLength:(size_t)expectedLength { if (data.length != expectedLength) { - CHIP_LOG_ERROR("Length Check Failed. Length:%tu is too short, must be at least %tu", data.length, expectedLength); + CHIP_LOG_ERROR("Length Check Failed. Length:%tu is incorrect, must be %tu", data.length, expectedLength); return NO; } return YES; From 5537680e54c8d47a45dc9b8c638de5b80fd92b64 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel <67607049+kpschoedel@users.noreply.github.com> Date: Fri, 9 Jul 2021 10:45:28 -0400 Subject: [PATCH 25/47] Fix PacketBuffer allocation size when using LwIP (#8226) #### Problem LwIP `pbuf_alloc()` was called with a size including the `struct pbuf` header, but expects the size to exclude that. #### Change overview Call `pbuf_alloc()` with the correct size. This imports a fragment of https://github.com/openweave/openweave-core/pull/608 #### Testing Added `PacketBuffer::kMaxSizeWithoutReserve` to the cases checked by `PacketBufferTest::CheckNew()`. --- src/system/SystemPacketBuffer.cpp | 2 +- src/system/tests/TestSystemPacketBuffer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/SystemPacketBuffer.cpp b/src/system/SystemPacketBuffer.cpp index 076410d39af4f6..4cc91b5dff326e 100644 --- a/src/system/SystemPacketBuffer.cpp +++ b/src/system/SystemPacketBuffer.cpp @@ -466,7 +466,7 @@ PacketBufferHandle PacketBufferHandle::New(size_t aAvailableSize, uint16_t aRese #if CHIP_SYSTEM_PACKETBUFFER_STORE == CHIP_SYSTEM_PACKETBUFFER_STORE_LWIP_POOL || \ CHIP_SYSTEM_PACKETBUFFER_STORE == CHIP_SYSTEM_PACKETBUFFER_STORE_LWIP_CUSTOM - lPacket = static_cast(pbuf_alloc(PBUF_RAW, static_cast(lBlockSize), PBUF_POOL)); + lPacket = static_cast(pbuf_alloc(PBUF_RAW, static_cast(lAllocSize), PBUF_POOL)); SYSTEM_STATS_UPDATE_LWIP_PBUF_COUNTS(); diff --git a/src/system/tests/TestSystemPacketBuffer.cpp b/src/system/tests/TestSystemPacketBuffer.cpp index e2c199c34f966f..aaa35b214ac463 100644 --- a/src/system/tests/TestSystemPacketBuffer.cpp +++ b/src/system/tests/TestSystemPacketBuffer.cpp @@ -191,7 +191,7 @@ class PacketBufferTest std::vector handles; }; -const uint16_t sTestReservedSizes[] = { 0, 10, 128, 1536, PacketBufferTest::kBlockSize }; +const uint16_t sTestReservedSizes[] = { 0, 10, 128, 1536, PacketBuffer::kMaxSizeWithoutReserve, PacketBufferTest::kBlockSize }; const uint16_t sTestLengths[] = { 0, 1, 10, 128, PacketBufferTest::kBlockSize, UINT16_MAX }; PacketBufferTest::TestContext sContext = { From ae63e8179d9eb8618f80978deaae940cb07b09a4 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Fri, 9 Jul 2021 22:45:35 +0800 Subject: [PATCH 26/47] Optimize BitMapObjectPool::ForEachActiveObject for code size (#8192) --- src/lib/support/Pool.cpp | 28 ++++++++++++++++++++++ src/lib/support/Pool.h | 51 +++++++++++++++++++--------------------- 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/src/lib/support/Pool.cpp b/src/lib/support/Pool.cpp index b794bb4080f577..9a08a928f43025 100644 --- a/src/lib/support/Pool.cpp +++ b/src/lib/support/Pool.cpp @@ -73,4 +73,32 @@ void StaticAllocatorBitmap::Deallocate(void * element) mAllocated--; } +size_t StaticAllocatorBitmap::IndexOf(void * element) +{ + std::ptrdiff_t diff = static_cast(element) - static_cast(mElements); + assert(diff >= 0); + assert(static_cast(diff) % mElementSize == 0); + auto index = static_cast(diff) / mElementSize; + assert(index < Capacity()); + return index; +} + +bool StaticAllocatorBitmap::ForEachActiveObjectInner(void * context, Lambda lambda) +{ + for (size_t word = 0; word * kBitChunkSize < Capacity(); ++word) + { + auto & usage = mUsage[word]; + auto value = usage.load(std::memory_order_relaxed); + for (size_t offset = 0; offset < kBitChunkSize && offset + word * kBitChunkSize < Capacity(); ++offset) + { + if ((value & (kBit1 << offset)) != 0) + { + if (!lambda(context, At(word * kBitChunkSize + offset))) + return false; + } + } + } + return true; +} + } // namespace chip diff --git a/src/lib/support/Pool.h b/src/lib/support/Pool.h index 29466b0206e88e..2158929ca216ee 100644 --- a/src/lib/support/Pool.h +++ b/src/lib/support/Pool.h @@ -65,15 +65,10 @@ class StaticAllocatorBitmap : public StaticAllocatorBase protected: void * At(size_t index) { return static_cast(mElements) + mElementSize * index; } - size_t IndexOf(void * element) - { - std::ptrdiff_t diff = static_cast(element) - static_cast(mElements); - assert(diff >= 0); - assert(static_cast(diff) % mElementSize == 0); - auto index = static_cast(diff) / mElementSize; - assert(index < Capacity()); - return index; - } + size_t IndexOf(void * element); + + using Lambda = bool (*)(void *, void *); + bool ForEachActiveObjectInner(void * context, Lambda lambda); private: void * mElements; @@ -119,33 +114,35 @@ class BitMapObjectPool : public StaticAllocatorBitmap * @brief * Run a functor for each active object in the pool * - * @param f The functor of type `bool (*)(T*)`, return false to break the iteration - * @return bool Returns false if broke during iteration + * @param function The functor of type `bool (*)(T*)`, return false to break the iteration + * @return bool Returns false if broke during iteration * * caution * this function is not thread-safe, make sure all usage of the * pool is protected by a lock, or else avoid using this function */ - template - bool ForEachActiveObject(F f) + template + bool ForEachActiveObject(Function && function) { - for (size_t word = 0; word * kBitChunkSize < Capacity(); ++word) - { - auto & usage = mUsage[word]; - auto value = usage.load(std::memory_order_relaxed); - for (size_t offset = 0; offset < kBitChunkSize && offset + word * kBitChunkSize < Capacity(); ++offset) - { - if ((value & (kBit1 << offset)) != 0) - { - if (!f(static_cast(At(word * kBitChunkSize + offset)))) - return false; - } - } - } - return true; + LambdaProxy proxy(std::forward(function)); + return ForEachActiveObjectInner(&proxy, &LambdaProxy::Call); } private: + template + class LambdaProxy + { + public: + LambdaProxy(Function && function) : mFunction(std::move(function)) {} + static bool Call(void * context, void * target) + { + return static_cast(context)->mFunction(static_cast(target)); + } + + private: + Function mFunction; + }; + std::atomic mUsage[(N + kBitChunkSize - 1) / kBitChunkSize]; alignas(alignof(T)) uint8_t mMemory[N * sizeof(T)]; }; From 81f0519494482a4a6d5db93cbbb4fc5ebe301a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=A9gevand?= <77852424+jmeg-sfy@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:14:13 +0200 Subject: [PATCH 27/47] WindowCovering: Add Target Positions support to scenes (#8032) * WC: Add Target Positions support to scenes * Restyle fixing * Empty commit to kick restyled Co-authored-by: Michael Spang --- src/app/clusters/scenes/scenes.cpp | 67 ++++++++++++++++++++++++++---- src/app/util/af-types.h | 4 ++ 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/app/clusters/scenes/scenes.cpp b/src/app/clusters/scenes/scenes.cpp index 72393ff7f42b61..2d21912a3153df 100644 --- a/src/app/clusters/scenes/scenes.cpp +++ b/src/app/clusters/scenes/scenes.cpp @@ -206,7 +206,10 @@ void emAfPluginScenesServerPrintInfo(void) emberAfCorePrint(" door %x", entry.lockStateValue); #endif #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER - emberAfCorePrint(" window %x %x", entry.currentPositionLiftPercentageValue, entry.currentPositionTiltPercentageValue); + emberAfCorePrint(" Window percentage Lift %3u, Tilt %3u", entry.currentPositionLiftPercentageValue, + entry.currentPositionTiltPercentageValue); + emberAfCorePrint(" Window percent100ths Lift %5u, Tilt %5u", entry.targetPositionLiftPercent100thsValue, + entry.targetPositionTiltPercent100thsValue); #endif } emberAfCorePrintln(""); @@ -538,12 +541,20 @@ EmberAfStatus emberAfScenesClusterStoreCurrentSceneCallback(EndpointId endpoint, #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER entry.hasCurrentPositionLiftPercentageValue = readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, - "current position lift percentage", (uint8_t *) &entry.currentPositionLiftPercentageValue, + "currentPositionLiftPercentage", (uint8_t *) &entry.currentPositionLiftPercentageValue, sizeof(entry.currentPositionLiftPercentageValue)); entry.hasCurrentPositionTiltPercentageValue = readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, - "current position tilt percentage", (uint8_t *) &entry.currentPositionTiltPercentageValue, + "currentPositionTiltPercentage", (uint8_t *) &entry.currentPositionTiltPercentageValue, sizeof(entry.currentPositionTiltPercentageValue)); + entry.hasTargetPositionLiftPercent100thsValue = + readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, + "targetPositionLiftPercent100ths", (uint8_t *) &entry.targetPositionLiftPercent100thsValue, + sizeof(entry.targetPositionLiftPercent100thsValue)); + entry.hasTargetPositionTiltPercent100thsValue = + readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, + "targetPositionTiltPercent100ths", (uint8_t *) &entry.targetPositionTiltPercent100thsValue, + sizeof(entry.targetPositionTiltPercent100thsValue)); #endif // When creating a new entry, the name is set to the null string (i.e., the @@ -676,15 +687,27 @@ EmberAfStatus emberAfScenesClusterRecallSavedSceneCallback(EndpointId endpoint, if (entry.hasCurrentPositionLiftPercentageValue) { writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, - ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, "current position lift percentage", + ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, "CurrentPositionLiftPercentage", (uint8_t *) &entry.currentPositionLiftPercentageValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasCurrentPositionTiltPercentageValue) { writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, - ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, "current position tilt percentage", + ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, "CurrentPositionTiltPercentage", (uint8_t *) &entry.currentPositionTiltPercentageValue, ZCL_INT8U_ATTRIBUTE_TYPE); } + if (entry.hasTargetPositionLiftPercent100thsValue) + { + writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, + ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, "TargetPositionLiftPercent100ths", + (uint8_t *) &entry.targetPositionLiftPercent100thsValue, ZCL_INT16U_ATTRIBUTE_TYPE); + } + if (entry.hasTargetPositionTiltPercent100thsValue) + { + writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, + ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, "TargetPositionTiltPercent100ths", + (uint8_t *) &entry.targetPositionTiltPercent100thsValue, ZCL_INT16U_ATTRIBUTE_TYPE); + } #endif emberAfScenesMakeValid(endpoint, sceneId, groupId); return EMBER_ZCL_STATUS_SUCCESS; @@ -793,8 +816,10 @@ bool emberAfPluginScenesServerParseAddScene(chip::app::Command * commandObj, con entry.hasLockStateValue = false; #endif #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER - entry.hasCurrentPositionLiftPercentageValue = false; - entry.hasCurrentPositionTiltPercentageValue = false; + entry.hasCurrentPositionLiftPercentageValue = false; + entry.hasCurrentPositionTiltPercentageValue = false; + entry.hasTargetPositionLiftPercent100thsValue = false; + entry.hasTargetPositionTiltPercent100thsValue = false; #endif } @@ -978,6 +1003,24 @@ bool emberAfPluginScenesServerParseAddScene(chip::app::Command * commandObj, con entry.hasCurrentPositionTiltPercentageValue = true; entry.currentPositionTiltPercentageValue = emberAfGetInt8u(extensionFieldSets, extensionFieldSetsIndex, extensionFieldSetsLen); + extensionFieldSetsIndex++; + length--; + if (length < 2) + { + break; + } + entry.hasTargetPositionLiftPercent100thsValue = true; + entry.targetPositionLiftPercent100thsValue = + emberAfGetInt16u(extensionFieldSets, extensionFieldSetsIndex, extensionFieldSetsLen); + extensionFieldSetsIndex = static_cast(extensionFieldSetsIndex + 2); + length = static_cast(length - 2); + if (length < 2) + { + break; + } + entry.hasTargetPositionTiltPercent100thsValue = true; + entry.targetPositionTiltPercent100thsValue = + emberAfGetInt16u(extensionFieldSets, extensionFieldSetsIndex, extensionFieldSetsLen); // If additional Window Covering extensions are added, adjust the index // and length variables here. break; @@ -1210,6 +1253,16 @@ bool emberAfPluginScenesServerParseViewScene(chip::app::Command * commandObj, co { emberAfPutInt8uInResp(entry.currentPositionTiltPercentageValue); (*length)++; + if (entry.hasTargetPositionLiftPercent100thsValue) + { + emberAfPutInt16uInResp(entry.targetPositionLiftPercent100thsValue); + *length = static_cast(*length + 2); + if (entry.hasTargetPositionTiltPercent100thsValue) + { + emberAfPutInt16uInResp(entry.targetPositionTiltPercent100thsValue); + *length = static_cast(*length + 2); + } + } } } #endif diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 23df492ff91e77..0db1d517f8b4c7 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -943,6 +943,10 @@ typedef struct uint8_t currentPositionLiftPercentageValue; bool hasCurrentPositionTiltPercentageValue; uint8_t currentPositionTiltPercentageValue; + bool hasTargetPositionLiftPercent100thsValue; + uint16_t targetPositionLiftPercent100thsValue; + bool hasTargetPositionTiltPercent100thsValue; + uint16_t targetPositionTiltPercent100thsValue; #endif } EmberAfSceneTableEntry; From 630fd1de0ab5c2857b335924aa7c110831bb46db Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Fri, 9 Jul 2021 23:15:35 +0800 Subject: [PATCH 28/47] fix compilation errors for lock-app(enable pw rpc) and ipv6only-app with idf v4.3 (#8129) --- examples/ipv6only-app/esp32/CMakeLists.txt | 7 ++++++- examples/ipv6only-app/esp32/include/gdm_wifi_service.h | 4 ++-- examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp | 2 +- examples/lock-app/esp32/CMakeLists.txt | 5 +++++ examples/lock-app/esp32/main/CMakeLists.txt | 1 + examples/lock-app/esp32/main/Kconfig.projbuild | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/ipv6only-app/esp32/CMakeLists.txt b/examples/ipv6only-app/esp32/CMakeLists.txt index b5f8d8ed6b0c4b..817f75e9e7da9f 100644 --- a/examples/ipv6only-app/esp32/CMakeLists.txt +++ b/examples/ipv6only-app/esp32/CMakeLists.txt @@ -24,7 +24,7 @@ set(EXTRA_COMPONENT_DIRS ) project(chip-ipv6only-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) @@ -36,3 +36,8 @@ pw_set_backend(pw_sys_io pw_sys_io.esp32) add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo) add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo) add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io) + +get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS) +list(REMOVE_ITEM _target_cxx_flags $<$:-std=c++17>) +list(APPEND _target_cxx_flags $<$:-std=gnu++17>) +set_target_properties(pw_build.cpp17 PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}") diff --git a/examples/ipv6only-app/esp32/include/gdm_wifi_service.h b/examples/ipv6only-app/esp32/include/gdm_wifi_service.h index 798ea1b556cac5..99bcd0dffcc165 100644 --- a/examples/ipv6only-app/esp32/include/gdm_wifi_service.h +++ b/examples/ipv6only-app/esp32/include/gdm_wifi_service.h @@ -58,7 +58,7 @@ class GDMWifiBase final : public generated::GDMWifiBase pw::Status GetSsid(ServerContext &, const chip_rpc_Empty & request, chip_rpc_Ssid & response) { wifi_config_t config; - PW_TRY(EspToPwStatus(esp_wifi_get_config(ESP_IF_WIFI_STA, &config))); + PW_TRY(EspToPwStatus(esp_wifi_get_config(WIFI_IF_STA, &config))); size_t size = std::min(sizeof(response.ssid.bytes), sizeof(config.sta.ssid)); memcpy(response.ssid.bytes, config.sta.ssid, sizeof(response.ssid.bytes)); response.ssid.size = size; @@ -77,7 +77,7 @@ class GDMWifiBase final : public generated::GDMWifiBase pw::Status GetMacAddress(ServerContext &, const chip_rpc_Empty & request, chip_rpc_MacAddress & response) { uint8_t mac[6]; - PW_TRY(EspToPwStatus(esp_wifi_get_mac(ESP_IF_WIFI_STA, mac))); + PW_TRY(EspToPwStatus(esp_wifi_get_mac(WIFI_IF_STA, mac))); sprintf(response.mac_address, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); return pw::OkStatus(); } diff --git a/examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp b/examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp index 147d273bb36228..79e48541f2ee8b 100644 --- a/examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp +++ b/examples/ipv6only-app/esp32/main/gdm_wifi_service.cpp @@ -241,7 +241,7 @@ pw::Status GDMWifiBase::Connect(ServerContext &, const chip_rpc_ConnectionData & std::min(sizeof(wifi_config.sta.password), static_cast(request.secret.size))); WifiConnectionEventHandler event_handler(esp_netif_); - PW_TRY(EspToPwStatus(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config))); + PW_TRY(EspToPwStatus(esp_wifi_set_config(WIFI_IF_STA, &wifi_config))); esp_err_t err = esp_wifi_connect(); if (ESP_ERR_WIFI_SSID == err) diff --git a/examples/lock-app/esp32/CMakeLists.txt b/examples/lock-app/esp32/CMakeLists.txt index 16bf65433041a1..459d17a1ce2fed 100644 --- a/examples/lock-app/esp32/CMakeLists.txt +++ b/examples/lock-app/esp32/CMakeLists.txt @@ -42,4 +42,9 @@ pw_set_backend(pw_sys_io pw_sys_io.esp32) add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo) add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo) add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io) + +get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS) +list(REMOVE_ITEM _target_cxx_flags $<$:-std=c++17>) +list(APPEND _target_cxx_flags $<$:-std=gnu++17>) +set_target_properties(pw_build.cpp17 PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}") endif(CONFIG_ENABLE_PW_RPC) diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index 00654fb126393c..67c5523d071d0f 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -70,6 +70,7 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" PRIV_REQUIRES bt chip QRCode tft spidriver screen-framework) idf_component_get_property(chip_lib chip COMPONENT_LIB) diff --git a/examples/lock-app/esp32/main/Kconfig.projbuild b/examples/lock-app/esp32/main/Kconfig.projbuild index c38116f056963f..bedb74e299d5b4 100644 --- a/examples/lock-app/esp32/main/Kconfig.projbuild +++ b/examples/lock-app/esp32/main/Kconfig.projbuild @@ -64,6 +64,7 @@ menu "Demo" endmenu menu "PW RPC Debug channel" +depends on ENABLE_PW_RPC config EXAMPLE_UART_PORT_NUM int "UART port number" range 0 2 if IDF_TARGET_ESP32 From ce3ea56259b1fd94c1af5bb9a18f5567428ec441 Mon Sep 17 00:00:00 2001 From: "Mathias K. Garbus" Date: Fri, 9 Jul 2021 17:54:59 +0200 Subject: [PATCH 29/47] Increasing CHIP_TASK_STACK_SIZE from 4096 -> 5120 (#8216) * Increasing HANDLER_STACK_SIZE from 4096 -> 5120 * increase CHIP_TASK_STACK_SIZE 4096 - > 5120 * Increasing the Stack size on platform level instead of globally --- src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h index 4700846fe96aaa..965bde2f9db848 100644 --- a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h @@ -39,6 +39,8 @@ // ========== CHIP Platform Configuration ========= +#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (5120) + #define BLEMANAGER_EVENT_HANDLER_STACK_SIZE (4096) #define BLEMANAGER_EVENT_HANDLER_PRIORITY (2) From 7e88aaa2a40b600d993277ca10ca494c107c5cd1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 12:07:43 -0400 Subject: [PATCH 30/47] Address review comments from PR 8073 (#8231) * Address review comments from PR 8073 * Regenerate generated files --- examples/chip-tool/commands/tests/Commands.h | 5850 +++++------------ .../templates/partials/test_cluster.zapt | 27 +- 2 files changed, 1668 insertions(+), 4209 deletions(-) diff --git a/examples/chip-tool/commands/tests/Commands.h b/examples/chip-tool/commands/tests/Commands.h index ecd75e9c96cf12..df60e3b6924a8e 100644 --- a/examples/chip-tool/commands/tests/Commands.h +++ b/examples/chip-tool/commands/tests/Commands.h @@ -67,32 +67,25 @@ class TV_TargetNavigatorCluster : public TestCommand // // Test Read attribute Target Navigator list - typedef void (*SuccessCallback_0)(void * context, uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t count, _NavigateTargetTargetInfo * targetNavigatorList); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterTargetNavigatorCommandReadAttribute_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterTargetNavigatorCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterTargetNavigatorCommandReadAttribute_0() { ChipLogProgress(chipTool, "Target Navigator - Read attribute Target Navigator list: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterTargetNavigatorCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterTargetNavigatorCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::TargetNavigatorCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeTargetNavigatorList(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeTargetNavigatorList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -103,9 +96,6 @@ class TV_TargetNavigatorCluster : public TestCommand TV_TargetNavigatorCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -124,9 +114,6 @@ class TV_TargetNavigatorCluster : public TestCommand TV_TargetNavigatorCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -145,20 +132,19 @@ class TV_TargetNavigatorCluster : public TestCommand } // Test Navigate Target Command - typedef void (*SuccessCallback_1)(void * context, uint8_t status, chip::ByteSpan data); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint8_t status, chip::ByteSpan data); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterTargetNavigatorCommandNavigateTarget_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterTargetNavigatorCommandNavigateTarget_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterTargetNavigatorCommandNavigateTarget_1() { ChipLogProgress(chipTool, "Target Navigator - Navigate Target Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTargetNavigatorCommandNavigateTarget_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTargetNavigatorCommandNavigateTarget_1_SuccessResponse, this); - chip::Controller::TargetNavigatorCluster cluster; cluster.Associate(mDevice, 1); @@ -166,13 +152,7 @@ class TV_TargetNavigatorCluster : public TestCommand uint8_t targetArgument = 1; chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("1"), strlen("1")); - err = cluster.NavigateTarget(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), targetArgument, dataArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.NavigateTarget(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), targetArgument, dataArgument); return err; } @@ -183,9 +163,6 @@ class TV_TargetNavigatorCluster : public TestCommand TV_TargetNavigatorCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -203,9 +180,6 @@ class TV_TargetNavigatorCluster : public TestCommand TV_TargetNavigatorCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -266,32 +240,25 @@ class TV_AudioOutputCluster : public TestCommand // // Test Read attribute Audio Output list - typedef void (*SuccessCallback_0)(void * context, uint16_t count, _AudioOutputInfo * audioOutputList); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t count, _AudioOutputInfo * audioOutputList); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterAudioOutputCommandReadAttribute_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterAudioOutputCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterAudioOutputCommandReadAttribute_0() { ChipLogProgress(chipTool, "Audio Output - Read attribute Audio Output list: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::AudioOutputCluster cluster; cluster.Associate(mDevice, 2); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeAudioOutputList(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeAudioOutputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -302,9 +269,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -322,9 +286,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -343,33 +304,26 @@ class TV_AudioOutputCluster : public TestCommand } // Test Select Output Command - typedef void (*SuccessCallback_1)(void * context); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterAudioOutputCommandSelectOutput_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterAudioOutputCommandSelectOutput_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterAudioOutputCommandSelectOutput_1() { ChipLogProgress(chipTool, "Audio Output - Select Output Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandSelectOutput_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandSelectOutput_1_SuccessResponse, this); - chip::Controller::AudioOutputCluster cluster; cluster.Associate(mDevice, 2); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t indexArgument = 1; - err = cluster.SelectOutput(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), indexArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.SelectOutput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); return err; } @@ -380,9 +334,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -399,9 +350,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -413,20 +361,19 @@ class TV_AudioOutputCluster : public TestCommand } // Test Rename Output Command - typedef void (*SuccessCallback_2)(void * context); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterAudioOutputCommandRenameOutput_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterAudioOutputCommandRenameOutput_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterAudioOutputCommandRenameOutput_2() { ChipLogProgress(chipTool, "Audio Output - Rename Output Command: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandRenameOutput_2_FailureResponse, this); - mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterAudioOutputCommandRenameOutput_2_SuccessResponse, this); - chip::Controller::AudioOutputCluster cluster; cluster.Associate(mDevice, 2); @@ -434,13 +381,7 @@ class TV_AudioOutputCluster : public TestCommand uint8_t indexArgument = 1; chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleName"), strlen("exampleName")); - err = cluster.RenameOutput(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel(), indexArgument, nameArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.RenameOutput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), indexArgument, nameArgument); return err; } @@ -451,9 +392,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -470,9 +408,6 @@ class TV_AudioOutputCluster : public TestCommand TV_AudioOutputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -536,32 +471,25 @@ class TV_ApplicationLauncherCluster : public TestCommand // // Test Read attribute Application Launcher list - typedef void (*SuccessCallback_0)(void * context, uint16_t count, uint16_t * applicationLauncherList); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t count, uint16_t * applicationLauncherList); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterApplicationLauncherCommandReadAttribute_0() { ChipLogProgress(chipTool, "Application Launcher - Read attribute Application Launcher list: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::ApplicationLauncherCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeApplicationLauncherList(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeApplicationLauncherList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -572,9 +500,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -592,9 +517,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -613,20 +535,19 @@ class TV_ApplicationLauncherCluster : public TestCommand } // Test Launch App Command - typedef void (*SuccessCallback_1)(void * context, uint8_t status, chip::ByteSpan data); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint8_t status, chip::ByteSpan data); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterApplicationLauncherCommandLaunchApp_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterApplicationLauncherCommandLaunchApp_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterApplicationLauncherCommandLaunchApp_1() { ChipLogProgress(chipTool, "Application Launcher - Launch App Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandLaunchApp_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandLaunchApp_1_SuccessResponse, this); - chip::Controller::ApplicationLauncherCluster cluster; cluster.Associate(mDevice, 1); @@ -635,14 +556,8 @@ class TV_ApplicationLauncherCluster : public TestCommand chip::ByteSpan dataArgument = chip::ByteSpan(chip::Uint8::from_const_char("exampleData"), strlen("exampleData")); uint16_t catalogVendorIdArgument = 1U; chip::ByteSpan applicationIdArgument = chip::ByteSpan(chip::Uint8::from_const_char("appId"), strlen("appId")); - err = cluster.LaunchApp(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), dataArgument, - catalogVendorIdArgument, applicationIdArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.LaunchApp(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), dataArgument, catalogVendorIdArgument, + applicationIdArgument); return err; } @@ -653,9 +568,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -673,9 +585,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -687,32 +596,25 @@ class TV_ApplicationLauncherCluster : public TestCommand } // Test Read attribute catalog vendor id - typedef void (*SuccessCallback_2)(void * context, uint8_t catalogVendorId); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint8_t catalogVendorId); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterApplicationLauncherCommandReadAttribute_2() { ChipLogProgress(chipTool, "Application Launcher - Read attribute catalog vendor id: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::ApplicationLauncherCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -723,9 +625,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -742,9 +641,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -763,32 +659,25 @@ class TV_ApplicationLauncherCluster : public TestCommand } // Test Read attribute application id - typedef void (*SuccessCallback_3)(void * context, uint8_t applicationId); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint8_t applicationId); + chip::Callback::Callback mOnSuccessCallback_3{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_3_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterApplicationLauncherCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterApplicationLauncherCommandReadAttribute_3() { ChipLogProgress(chipTool, "Application Launcher - Read attribute application id: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterApplicationLauncherCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::ApplicationLauncherCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeApplicationId(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeApplicationId(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -799,9 +688,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -818,9 +704,6 @@ class TV_ApplicationLauncherCluster : public TestCommand TV_ApplicationLauncherCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -882,33 +765,25 @@ class TV_KeypadInputCluster : public TestCommand // // Test Send Key Command - typedef void (*SuccessCallback_0)(void * context, uint8_t status); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint8_t status); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterKeypadInputCommandSendKey_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterKeypadInputCommandSendKey_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterKeypadInputCommandSendKey_0() { ChipLogProgress(chipTool, "Keypad Input - Send Key Command: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterKeypadInputCommandSendKey_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterKeypadInputCommandSendKey_0_SuccessResponse, this); - chip::Controller::KeypadInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t keyCodeArgument = 3; - err = cluster.SendKey(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel(), keyCodeArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.SendKey(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), keyCodeArgument); return err; } @@ -919,9 +794,6 @@ class TV_KeypadInputCluster : public TestCommand TV_KeypadInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -938,9 +810,6 @@ class TV_KeypadInputCluster : public TestCommand TV_KeypadInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -998,33 +867,26 @@ class TV_AccountLoginCluster : public TestCommand // // Test Get Setup PIN Command - typedef void (*SuccessCallback_0)(void * context, chip::ByteSpan setupPIN); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, chip::ByteSpan setupPIN); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterAccountLoginCommandGetSetupPIN_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterAccountLoginCommandGetSetupPIN_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterAccountLoginCommandGetSetupPIN_0() { ChipLogProgress(chipTool, "Account Login - Get Setup PIN Command: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterAccountLoginCommandGetSetupPIN_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterAccountLoginCommandGetSetupPIN_0_SuccessResponse, this); - chip::Controller::AccountLoginCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); - err = cluster.GetSetupPIN(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel(), tempAccountIdentifierArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.GetSetupPIN(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), tempAccountIdentifierArgument); return err; } @@ -1035,9 +897,6 @@ class TV_AccountLoginCluster : public TestCommand TV_AccountLoginCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1054,9 +913,6 @@ class TV_AccountLoginCluster : public TestCommand TV_AccountLoginCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1068,20 +924,18 @@ class TV_AccountLoginCluster : public TestCommand } // Test Login Command - typedef void (*SuccessCallback_1)(void * context); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_1{ OnTestSendClusterAccountLoginCommandLogin_1_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterAccountLoginCommandLogin_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterAccountLoginCommandLogin_1() { ChipLogProgress(chipTool, "Account Login - Login Command: Sending command..."); - mOnFailureCallback_1 = - new chip::Callback::Callback(OnTestSendClusterAccountLoginCommandLogin_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterAccountLoginCommandLogin_1_SuccessResponse, this); - chip::Controller::AccountLoginCluster cluster; cluster.Associate(mDevice, 3); @@ -1089,15 +943,9 @@ class TV_AccountLoginCluster : public TestCommand chip::ByteSpan tempAccountIdentifierArgument = chip::ByteSpan(chip::Uint8::from_const_char("asdf"), strlen("asdf")); chip::ByteSpan setupPINArgument = chip::ByteSpan(chip::Uint8::from_const_char("tempPin123"), strlen("tempPin123")); - err = cluster.Login(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), tempAccountIdentifierArgument, + err = cluster.Login(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), tempAccountIdentifierArgument, setupPINArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } - return err; } @@ -1107,9 +955,6 @@ class TV_AccountLoginCluster : public TestCommand TV_AccountLoginCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1126,9 +971,6 @@ class TV_AccountLoginCluster : public TestCommand TV_AccountLoginCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1201,33 +1043,26 @@ class TV_ApplicationBasicCluster : public TestCommand // // Test Change Status Command - typedef void (*SuccessCallback_0)(void * context); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterApplicationBasicCommandChangeStatus_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterApplicationBasicCommandChangeStatus_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandChangeStatus_0() { ChipLogProgress(chipTool, "Application Basic - Change Status Command: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandChangeStatus_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandChangeStatus_0_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t statusArgument = 1; - err = cluster.ChangeStatus(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel(), statusArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ChangeStatus(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), statusArgument); return err; } @@ -1238,9 +1073,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1257,9 +1089,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1271,32 +1100,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute vendor name - typedef void (*SuccessCallback_1)(void * context, chip::ByteSpan vendorName); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, chip::ByteSpan vendorName); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterApplicationBasicCommandReadAttribute_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterApplicationBasicCommandReadAttribute_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_1() { ChipLogProgress(chipTool, "Application Basic - Read attribute vendor name: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_1_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeVendorName(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.ReadAttributeVendorName(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -1307,9 +1129,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1326,9 +1145,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1340,32 +1156,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute vendor id - typedef void (*SuccessCallback_2)(void * context, uint16_t vendorId); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint16_t vendorId); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterApplicationBasicCommandReadAttribute_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterApplicationBasicCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_2() { ChipLogProgress(chipTool, "Application Basic - Read attribute vendor id: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeVendorId(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeVendorId(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -1376,9 +1185,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1395,9 +1201,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1416,32 +1219,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute name - typedef void (*SuccessCallback_3)(void * context, chip::ByteSpan applicationName); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, chip::ByteSpan applicationName); + chip::Callback::Callback mOnSuccessCallback_3{ + OnTestSendClusterApplicationBasicCommandReadAttribute_3_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterApplicationBasicCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_3() { ChipLogProgress(chipTool, "Application Basic - Read attribute name: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeApplicationName(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeApplicationName(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -1452,9 +1248,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1472,9 +1265,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1486,32 +1276,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute product id - typedef void (*SuccessCallback_4)(void * context, uint16_t productId); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context, uint16_t productId); + chip::Callback::Callback mOnSuccessCallback_4{ + OnTestSendClusterApplicationBasicCommandReadAttribute_4_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterApplicationBasicCommandReadAttribute_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_4() { ChipLogProgress(chipTool, "Application Basic - Read attribute product id: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_4_FailureResponse, this); - mOnSuccessCallback_4 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_4_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeProductId(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.ReadAttributeProductId(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -1522,9 +1305,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1541,9 +1321,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1562,32 +1339,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute id - typedef void (*SuccessCallback_5)(void * context, chip::ByteSpan applicationId); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, chip::ByteSpan applicationId); + chip::Callback::Callback mOnSuccessCallback_5{ + OnTestSendClusterApplicationBasicCommandReadAttribute_5_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterApplicationBasicCommandReadAttribute_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_5() { ChipLogProgress(chipTool, "Application Basic - Read attribute id: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_5_FailureResponse, this); - mOnSuccessCallback_5 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_5_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeApplicationId(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.ReadAttributeApplicationId(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -1598,9 +1368,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1618,9 +1385,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1632,32 +1396,25 @@ class TV_ApplicationBasicCluster : public TestCommand } // Test Read attribute catalog vendor id - typedef void (*SuccessCallback_6)(void * context, uint16_t catalogVendorId); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context, uint16_t catalogVendorId); + chip::Callback::Callback mOnSuccessCallback_6{ + OnTestSendClusterApplicationBasicCommandReadAttribute_6_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_6{ + OnTestSendClusterApplicationBasicCommandReadAttribute_6_FailureResponse, this + }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterApplicationBasicCommandReadAttribute_6() { ChipLogProgress(chipTool, "Application Basic - Read attribute catalog vendor id: Sending command..."); - mOnFailureCallback_6 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_6_FailureResponse, this); - mOnSuccessCallback_6 = new chip::Callback::Callback( - OnTestSendClusterApplicationBasicCommandReadAttribute_6_SuccessResponse, this); - chip::Controller::ApplicationBasicCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.ReadAttributeCatalogVendorId(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); return err; } @@ -1668,9 +1425,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1687,9 +1441,6 @@ class TV_ApplicationBasicCluster : public TestCommand TV_ApplicationBasicCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1781,32 +1532,25 @@ class TV_MediaPlaybackCluster : public TestCommand // // Test Media Playback Play Command - typedef void (*SuccessCallback_0)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterMediaPlaybackCommandMediaPlay_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterMediaPlaybackCommandMediaPlay_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaPlay_0() { ChipLogProgress(chipTool, "Media Playback - Media Playback Play Command: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaPlay_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterMediaPlaybackCommandMediaPlay_0_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaPlay(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.MediaPlay(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -1817,9 +1561,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1836,9 +1577,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1857,32 +1595,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Pause Command - typedef void (*SuccessCallback_1)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterMediaPlaybackCommandMediaPause_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterMediaPlaybackCommandMediaPause_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaPause_1() { ChipLogProgress(chipTool, "Media Playback - Media Playback Pause Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaPause_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaPause_1_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaPause(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.MediaPause(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -1893,9 +1624,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1912,9 +1640,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -1933,32 +1658,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Stop Command - typedef void (*SuccessCallback_2)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterMediaPlaybackCommandMediaStop_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterMediaPlaybackCommandMediaStop_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaStop_2() { ChipLogProgress(chipTool, "Media Playback - Media Playback Stop Command: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaStop_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterMediaPlaybackCommandMediaStop_2_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaStop(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.MediaStop(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -1969,9 +1687,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -1988,9 +1703,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2009,32 +1721,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Start Over Command - typedef void (*SuccessCallback_3)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_3{ + OnTestSendClusterMediaPlaybackCommandMediaStartOver_3_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterMediaPlaybackCommandMediaStartOver_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaStartOver_3() { ChipLogProgress(chipTool, "Media Playback - Media Playback Start Over Command: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaStartOver_3_FailureResponse, this); - mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaStartOver_3_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaStartOver(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.MediaStartOver(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -2045,9 +1750,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2064,9 +1766,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2085,32 +1784,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Previous Command - typedef void (*SuccessCallback_4)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_4{ + OnTestSendClusterMediaPlaybackCommandMediaPrevious_4_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterMediaPlaybackCommandMediaPrevious_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaPrevious_4() { ChipLogProgress(chipTool, "Media Playback - Media Playback Previous Command: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaPrevious_4_FailureResponse, this); - mOnSuccessCallback_4 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaPrevious_4_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaPrevious(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.MediaPrevious(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -2121,9 +1813,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2140,9 +1829,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2161,32 +1847,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Next Command - typedef void (*SuccessCallback_5)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_5{ + OnTestSendClusterMediaPlaybackCommandMediaNext_5_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterMediaPlaybackCommandMediaNext_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaNext_5() { ChipLogProgress(chipTool, "Media Playback - Media Playback Next Command: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaNext_5_FailureResponse, this); - mOnSuccessCallback_5 = - new chip::Callback::Callback(OnTestSendClusterMediaPlaybackCommandMediaNext_5_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaNext(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.MediaNext(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -2197,9 +1876,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2216,9 +1892,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2237,32 +1910,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Rewind Command - typedef void (*SuccessCallback_6)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_6{ + OnTestSendClusterMediaPlaybackCommandMediaRewind_6_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_6{ + OnTestSendClusterMediaPlaybackCommandMediaRewind_6_FailureResponse, this + }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaRewind_6() { ChipLogProgress(chipTool, "Media Playback - Media Playback Rewind Command: Sending command..."); - mOnFailureCallback_6 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaRewind_6_FailureResponse, this); - mOnSuccessCallback_6 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaRewind_6_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaRewind(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.MediaRewind(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); return err; } @@ -2273,9 +1939,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2292,9 +1955,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2313,32 +1973,25 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Fast Forward Command - typedef void (*SuccessCallback_7)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_7 = nullptr; - chip::Callback::Callback * mOnFailureCallback_7 = nullptr; - bool mIsFailureExpected_7 = 0; + using SuccessCallback_7 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_7{ + OnTestSendClusterMediaPlaybackCommandMediaFastForward_7_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_7{ + OnTestSendClusterMediaPlaybackCommandMediaFastForward_7_FailureResponse, this + }; + bool mIsFailureExpected_7 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaFastForward_7() { ChipLogProgress(chipTool, "Media Playback - Media Playback Fast Forward Command: Sending command..."); - mOnFailureCallback_7 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaFastForward_7_FailureResponse, this); - mOnSuccessCallback_7 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaFastForward_7_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.MediaFastForward(mOnSuccessCallback_7->Cancel(), mOnFailureCallback_7->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_7; - delete mOnSuccessCallback_7; - } + err = cluster.MediaFastForward(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); return err; } @@ -2349,9 +2002,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2368,9 +2018,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2389,35 +2036,28 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Skip Forward Command - typedef void (*SuccessCallback_8)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_8 = nullptr; - chip::Callback::Callback * mOnFailureCallback_8 = nullptr; - bool mIsFailureExpected_8 = 0; + using SuccessCallback_8 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_8{ + OnTestSendClusterMediaPlaybackCommandMediaSkipForward_8_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_8{ + OnTestSendClusterMediaPlaybackCommandMediaSkipForward_8_FailureResponse, this + }; + bool mIsFailureExpected_8 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaSkipForward_8() { ChipLogProgress(chipTool, "Media Playback - Media Playback Skip Forward Command: Sending command..."); - mOnFailureCallback_8 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipForward_8_FailureResponse, this); - mOnSuccessCallback_8 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipForward_8_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t deltaPositionMillisecondsArgument = 100ULL; - err = cluster.MediaSkipForward(mOnSuccessCallback_8->Cancel(), mOnFailureCallback_8->Cancel(), + err = cluster.MediaSkipForward(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), deltaPositionMillisecondsArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_8; - delete mOnSuccessCallback_8; - } - return err; } @@ -2427,9 +2067,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2446,9 +2083,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2467,35 +2101,28 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Skip Backward Command - typedef void (*SuccessCallback_9)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_9 = nullptr; - chip::Callback::Callback * mOnFailureCallback_9 = nullptr; - bool mIsFailureExpected_9 = 0; + using SuccessCallback_9 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_9{ + OnTestSendClusterMediaPlaybackCommandMediaSkipBackward_9_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_9{ + OnTestSendClusterMediaPlaybackCommandMediaSkipBackward_9_FailureResponse, this + }; + bool mIsFailureExpected_9 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaSkipBackward_9() { ChipLogProgress(chipTool, "Media Playback - Media Playback Skip Backward Command: Sending command..."); - mOnFailureCallback_9 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipBackward_9_FailureResponse, this); - mOnSuccessCallback_9 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipBackward_9_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t deltaPositionMillisecondsArgument = 100ULL; - err = cluster.MediaSkipBackward(mOnSuccessCallback_9->Cancel(), mOnFailureCallback_9->Cancel(), + err = cluster.MediaSkipBackward(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), deltaPositionMillisecondsArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_9; - delete mOnSuccessCallback_9; - } - return err; } @@ -2505,9 +2132,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2525,9 +2149,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2546,33 +2167,26 @@ class TV_MediaPlaybackCluster : public TestCommand } // Test Media Playback Seek Command - typedef void (*SuccessCallback_10)(void * context, uint8_t mediaPlaybackStatus); - chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; - chip::Callback::Callback * mOnFailureCallback_10 = nullptr; - bool mIsFailureExpected_10 = 0; + using SuccessCallback_10 = void (*)(void * context, uint8_t mediaPlaybackStatus); + chip::Callback::Callback mOnSuccessCallback_10{ + OnTestSendClusterMediaPlaybackCommandMediaSeek_10_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_10{ + OnTestSendClusterMediaPlaybackCommandMediaSeek_10_FailureResponse, this + }; + bool mIsFailureExpected_10 = 0; CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaSeek_10() { ChipLogProgress(chipTool, "Media Playback - Media Playback Seek Command: Sending command..."); - mOnFailureCallback_10 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSeek_10_FailureResponse, this); - mOnSuccessCallback_10 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSeek_10_SuccessResponse, this); - chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t positionArgument = 100ULL; - err = cluster.MediaSeek(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel(), positionArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_10; - delete mOnSuccessCallback_10; - } + err = cluster.MediaSeek(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel(), positionArgument); return err; } @@ -2583,9 +2197,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2602,9 +2213,6 @@ class TV_MediaPlaybackCluster : public TestCommand TV_MediaPlaybackCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2672,32 +2280,25 @@ class TV_TvChannelCluster : public TestCommand // // Test Read attribute TV Channel list - typedef void (*SuccessCallback_0)(void * context, uint16_t count, _TvChannelInfo * tvChannelList); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t count, _TvChannelInfo * tvChannelList); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterTvChannelCommandReadAttribute_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterTvChannelCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterTvChannelCommandReadAttribute_0() { ChipLogProgress(chipTool, "TV Channel - Read attribute TV Channel list: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterTvChannelCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterTvChannelCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::TvChannelCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeTvChannelList(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeTvChannelList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -2708,9 +2309,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2728,9 +2326,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2749,20 +2344,19 @@ class TV_TvChannelCluster : public TestCommand } // Test Change Channel By Number Command - typedef void (*SuccessCallback_1)(void * context); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterTvChannelCommandChangeChannelByNumber_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterTvChannelCommandChangeChannelByNumber_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterTvChannelCommandChangeChannelByNumber_1() { ChipLogProgress(chipTool, "TV Channel - Change Channel By Number Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTvChannelCommandChangeChannelByNumber_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTvChannelCommandChangeChannelByNumber_1_SuccessResponse, this); - chip::Controller::TvChannelCluster cluster; cluster.Associate(mDevice, 1); @@ -2770,15 +2364,9 @@ class TV_TvChannelCluster : public TestCommand uint16_t majorNumberArgument = 1U; uint16_t minorNumberArgument = 2U; - err = cluster.ChangeChannelByNumber(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), majorNumberArgument, + err = cluster.ChangeChannelByNumber(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), majorNumberArgument, minorNumberArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } - return err; } @@ -2788,9 +2376,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2807,9 +2392,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2821,33 +2403,26 @@ class TV_TvChannelCluster : public TestCommand } // Test Skip Channel Command - typedef void (*SuccessCallback_2)(void * context); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterTvChannelCommandSkipChannel_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterTvChannelCommandSkipChannel_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterTvChannelCommandSkipChannel_2() { ChipLogProgress(chipTool, "TV Channel - Skip Channel Command: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterTvChannelCommandSkipChannel_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterTvChannelCommandSkipChannel_2_SuccessResponse, this); - chip::Controller::TvChannelCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t countArgument = 1U; - err = cluster.SkipChannel(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel(), countArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.SkipChannel(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), countArgument); return err; } @@ -2858,9 +2433,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2877,9 +2449,6 @@ class TV_TvChannelCluster : public TestCommand TV_TvChannelCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -2934,32 +2503,23 @@ class TV_LowPowerCluster : public TestCommand // // Test Sleep Input Status Command - typedef void (*SuccessCallback_0)(void * context); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterLowPowerCommandSleep_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ OnTestSendClusterLowPowerCommandSleep_0_FailureResponse, + this }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterLowPowerCommandSleep_0() { ChipLogProgress(chipTool, "Low Power - Sleep Input Status Command: Sending command..."); - mOnFailureCallback_0 = - new chip::Callback::Callback(OnTestSendClusterLowPowerCommandSleep_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterLowPowerCommandSleep_0_SuccessResponse, this); - chip::Controller::LowPowerCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Sleep(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.Sleep(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -2970,9 +2530,6 @@ class TV_LowPowerCluster : public TestCommand TV_LowPowerCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -2989,9 +2546,6 @@ class TV_LowPowerCluster : public TestCommand TV_LowPowerCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3061,32 +2615,25 @@ class TV_MediaInputCluster : public TestCommand // // Test Read attribute media input list - typedef void (*SuccessCallback_0)(void * context, uint16_t count, _MediaInputInfo * mediaInputList); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t count, _MediaInputInfo * mediaInputList); + chip::Callback::Callback mOnSuccessCallback_0{ + OnTestSendClusterMediaInputCommandReadAttribute_0_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterMediaInputCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterMediaInputCommandReadAttribute_0() { ChipLogProgress(chipTool, "Media Input - Read attribute media input list: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeMediaInputList(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeMediaInputList(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -3097,9 +2644,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3117,9 +2661,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3138,33 +2679,26 @@ class TV_MediaInputCluster : public TestCommand } // Test Select Input Command - typedef void (*SuccessCallback_1)(void * context); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterMediaInputCommandSelectInput_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterMediaInputCommandSelectInput_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterMediaInputCommandSelectInput_1() { ChipLogProgress(chipTool, "Media Input - Select Input Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandSelectInput_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterMediaInputCommandSelectInput_1_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t indexArgument = 1; - err = cluster.SelectInput(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel(), indexArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.SelectInput(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), indexArgument); return err; } @@ -3175,9 +2709,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3194,9 +2725,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3208,32 +2736,25 @@ class TV_MediaInputCluster : public TestCommand } // Test Read current input list - typedef void (*SuccessCallback_2)(void * context, uint8_t currentMediaInput); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint8_t currentMediaInput); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterMediaInputCommandReadAttribute_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterMediaInputCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterMediaInputCommandReadAttribute_2() { ChipLogProgress(chipTool, "Media Input - Read current input list: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeCurrentMediaInput(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeCurrentMediaInput(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -3244,9 +2765,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3263,9 +2781,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3284,32 +2799,25 @@ class TV_MediaInputCluster : public TestCommand } // Test Hide Input Status Command - typedef void (*SuccessCallback_3)(void * context); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_3{ + OnTestSendClusterMediaInputCommandHideInputStatus_3_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterMediaInputCommandHideInputStatus_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterMediaInputCommandHideInputStatus_3() { ChipLogProgress(chipTool, "Media Input - Hide Input Status Command: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandHideInputStatus_3_FailureResponse, this); - mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandHideInputStatus_3_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.HideInputStatus(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.HideInputStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -3320,9 +2828,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3339,9 +2844,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3353,32 +2855,25 @@ class TV_MediaInputCluster : public TestCommand } // Test Show Input Status Command - typedef void (*SuccessCallback_4)(void * context); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_4{ + OnTestSendClusterMediaInputCommandShowInputStatus_4_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterMediaInputCommandShowInputStatus_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterMediaInputCommandShowInputStatus_4() { ChipLogProgress(chipTool, "Media Input - Show Input Status Command: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandShowInputStatus_4_FailureResponse, this); - mOnSuccessCallback_4 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandShowInputStatus_4_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ShowInputStatus(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.ShowInputStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -3389,9 +2884,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3408,9 +2900,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3422,20 +2911,19 @@ class TV_MediaInputCluster : public TestCommand } // Test Rename Input Command - typedef void (*SuccessCallback_5)(void * context); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_5{ + OnTestSendClusterMediaInputCommandRenameInput_5_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterMediaInputCommandRenameInput_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterMediaInputCommandRenameInput_5() { ChipLogProgress(chipTool, "Media Input - Rename Input Command: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterMediaInputCommandRenameInput_5_FailureResponse, this); - mOnSuccessCallback_5 = - new chip::Callback::Callback(OnTestSendClusterMediaInputCommandRenameInput_5_SuccessResponse, this); - chip::Controller::MediaInputCluster cluster; cluster.Associate(mDevice, 1); @@ -3443,13 +2931,7 @@ class TV_MediaInputCluster : public TestCommand uint8_t indexArgument = 1; chip::ByteSpan nameArgument = chip::ByteSpan(chip::Uint8::from_const_char("newName"), strlen("newName")); - err = cluster.RenameInput(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel(), indexArgument, nameArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.RenameInput(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), indexArgument, nameArgument); return err; } @@ -3460,9 +2942,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3479,9 +2958,6 @@ class TV_MediaInputCluster : public TestCommand TV_MediaInputCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3839,32 +3315,24 @@ class TestCluster : public TestCommand // // Test Send Test Command - typedef void (*SuccessCallback_0)(void * context); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterTestClusterCommandTest_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterTestClusterCommandTest_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterTestClusterCommandTest_0() { ChipLogProgress(chipTool, "Test Cluster - Send Test Command: Sending command..."); - mOnFailureCallback_0 = - new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_0_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Test(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.Test(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -3875,9 +3343,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3894,9 +3359,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3908,32 +3370,25 @@ class TestCluster : public TestCommand } // Test Send Test Not Handled Command - typedef void (*SuccessCallback_1)(void * context); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 1; + using SuccessCallback_1 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_1{ + OnTestSendClusterTestClusterCommandTestNotHandled_1_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterTestClusterCommandTestNotHandled_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 1; CHIP_ERROR TestSendClusterTestClusterCommandTestNotHandled_1() { ChipLogProgress(chipTool, "Test Cluster - Send Test Not Handled Command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandTestNotHandled_1_FailureResponse, this); - mOnSuccessCallback_1 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandTestNotHandled_1_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.TestNotHandled(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.TestNotHandled(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -3944,9 +3399,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -3963,9 +3415,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -3977,32 +3426,25 @@ class TestCluster : public TestCommand } // Test Send Test Specific Command - typedef void (*SuccessCallback_2)(void * context, uint8_t returnValue); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint8_t returnValue); + chip::Callback::Callback mOnSuccessCallback_2{ + OnTestSendClusterTestClusterCommandTestSpecific_2_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterTestClusterCommandTestSpecific_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterTestClusterCommandTestSpecific_2() { ChipLogProgress(chipTool, "Test Cluster - Send Test Specific Command: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandTestSpecific_2_FailureResponse, this); - mOnSuccessCallback_2 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandTestSpecific_2_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.TestSpecific(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.TestSpecific(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -4013,9 +3455,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4032,9 +3471,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4053,32 +3489,25 @@ class TestCluster : public TestCommand } // Test Read attribute BOOLEAN Default Value - typedef void (*SuccessCallback_3)(void * context, uint8_t boolean); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint8_t boolean); + chip::Callback::Callback mOnSuccessCallback_3{ + OnTestSendClusterTestClusterCommandReadAttribute_3_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterTestClusterCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_3() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BOOLEAN Default Value: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBoolean(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeBoolean(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -4089,9 +3518,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4108,9 +3534,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4129,33 +3552,26 @@ class TestCluster : public TestCommand } // Test Write attribute BOOLEAN True - typedef void (*SuccessCallback_4)(void * context, uint8_t boolean); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context, uint8_t boolean); + chip::Callback::Callback mOnSuccessCallback_4{ + OnTestSendClusterTestClusterCommandWriteAttribute_4_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterTestClusterCommandWriteAttribute_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_4() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BOOLEAN True: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_4_FailureResponse, this); - mOnSuccessCallback_4 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_4_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t booleanArgument = 1; - err = cluster.WriteAttributeBoolean(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel(), booleanArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.WriteAttributeBoolean(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), booleanArgument); return err; } @@ -4166,9 +3582,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4185,9 +3598,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4199,32 +3609,25 @@ class TestCluster : public TestCommand } // Test Read attribute BOOLEAN True - typedef void (*SuccessCallback_5)(void * context, uint8_t boolean); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, uint8_t boolean); + chip::Callback::Callback mOnSuccessCallback_5{ + OnTestSendClusterTestClusterCommandReadAttribute_5_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterTestClusterCommandReadAttribute_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_5() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BOOLEAN True: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_5_FailureResponse, this); - mOnSuccessCallback_5 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_5_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBoolean(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.ReadAttributeBoolean(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -4235,9 +3638,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4254,9 +3654,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4275,33 +3672,26 @@ class TestCluster : public TestCommand } // Test Write attribute BOOLEAN False - typedef void (*SuccessCallback_6)(void * context, uint8_t boolean); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context, uint8_t boolean); + chip::Callback::Callback mOnSuccessCallback_6{ + OnTestSendClusterTestClusterCommandWriteAttribute_6_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_6{ + OnTestSendClusterTestClusterCommandWriteAttribute_6_FailureResponse, this + }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_6() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BOOLEAN False: Sending command..."); - mOnFailureCallback_6 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_6_FailureResponse, this); - mOnSuccessCallback_6 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_6_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t booleanArgument = 0; - err = cluster.WriteAttributeBoolean(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel(), booleanArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.WriteAttributeBoolean(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), booleanArgument); return err; } @@ -4312,9 +3702,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4331,9 +3718,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4345,32 +3729,25 @@ class TestCluster : public TestCommand } // Test Read attribute BOOLEAN False - typedef void (*SuccessCallback_7)(void * context, uint8_t boolean); - chip::Callback::Callback * mOnSuccessCallback_7 = nullptr; - chip::Callback::Callback * mOnFailureCallback_7 = nullptr; - bool mIsFailureExpected_7 = 0; + using SuccessCallback_7 = void (*)(void * context, uint8_t boolean); + chip::Callback::Callback mOnSuccessCallback_7{ + OnTestSendClusterTestClusterCommandReadAttribute_7_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_7{ + OnTestSendClusterTestClusterCommandReadAttribute_7_FailureResponse, this + }; + bool mIsFailureExpected_7 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_7() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BOOLEAN False: Sending command..."); - mOnFailureCallback_7 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_7_FailureResponse, this); - mOnSuccessCallback_7 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_7_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBoolean(mOnSuccessCallback_7->Cancel(), mOnFailureCallback_7->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_7; - delete mOnSuccessCallback_7; - } + err = cluster.ReadAttributeBoolean(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); return err; } @@ -4381,9 +3758,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4400,9 +3774,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4421,32 +3792,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP8 Default Value - typedef void (*SuccessCallback_8)(void * context, uint8_t bitmap8); - chip::Callback::Callback * mOnSuccessCallback_8 = nullptr; - chip::Callback::Callback * mOnFailureCallback_8 = nullptr; - bool mIsFailureExpected_8 = 0; + using SuccessCallback_8 = void (*)(void * context, uint8_t bitmap8); + chip::Callback::Callback mOnSuccessCallback_8{ + OnTestSendClusterTestClusterCommandReadAttribute_8_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_8{ + OnTestSendClusterTestClusterCommandReadAttribute_8_FailureResponse, this + }; + bool mIsFailureExpected_8 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_8() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP8 Default Value: Sending command..."); - mOnFailureCallback_8 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_8_FailureResponse, this); - mOnSuccessCallback_8 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_8_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_8->Cancel(), mOnFailureCallback_8->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_8; - delete mOnSuccessCallback_8; - } + err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); return err; } @@ -4457,9 +3821,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4476,9 +3837,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4497,33 +3855,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP8 Max Value - typedef void (*SuccessCallback_9)(void * context, uint8_t bitmap8); - chip::Callback::Callback * mOnSuccessCallback_9 = nullptr; - chip::Callback::Callback * mOnFailureCallback_9 = nullptr; - bool mIsFailureExpected_9 = 0; + using SuccessCallback_9 = void (*)(void * context, uint8_t bitmap8); + chip::Callback::Callback mOnSuccessCallback_9{ + OnTestSendClusterTestClusterCommandWriteAttribute_9_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_9{ + OnTestSendClusterTestClusterCommandWriteAttribute_9_FailureResponse, this + }; + bool mIsFailureExpected_9 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_9() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP8 Max Value: Sending command..."); - mOnFailureCallback_9 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_9_FailureResponse, this); - mOnSuccessCallback_9 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_9_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t bitmap8Argument = 255; - err = cluster.WriteAttributeBitmap8(mOnSuccessCallback_9->Cancel(), mOnFailureCallback_9->Cancel(), bitmap8Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_9; - delete mOnSuccessCallback_9; - } + err = cluster.WriteAttributeBitmap8(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), bitmap8Argument); return err; } @@ -4534,9 +3885,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4553,9 +3901,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4567,32 +3912,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP8 Max Value - typedef void (*SuccessCallback_10)(void * context, uint8_t bitmap8); - chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; - chip::Callback::Callback * mOnFailureCallback_10 = nullptr; - bool mIsFailureExpected_10 = 0; + using SuccessCallback_10 = void (*)(void * context, uint8_t bitmap8); + chip::Callback::Callback mOnSuccessCallback_10{ + OnTestSendClusterTestClusterCommandReadAttribute_10_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_10{ + OnTestSendClusterTestClusterCommandReadAttribute_10_FailureResponse, this + }; + bool mIsFailureExpected_10 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_10() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP8 Max Value: Sending command..."); - mOnFailureCallback_10 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_10_FailureResponse, this); - mOnSuccessCallback_10 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_10_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_10; - delete mOnSuccessCallback_10; - } + err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); return err; } @@ -4603,9 +3941,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4622,9 +3957,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4643,33 +3975,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP8 Min Value - typedef void (*SuccessCallback_11)(void * context, uint8_t bitmap8); - chip::Callback::Callback * mOnSuccessCallback_11 = nullptr; - chip::Callback::Callback * mOnFailureCallback_11 = nullptr; - bool mIsFailureExpected_11 = 0; + using SuccessCallback_11 = void (*)(void * context, uint8_t bitmap8); + chip::Callback::Callback mOnSuccessCallback_11{ + OnTestSendClusterTestClusterCommandWriteAttribute_11_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_11{ + OnTestSendClusterTestClusterCommandWriteAttribute_11_FailureResponse, this + }; + bool mIsFailureExpected_11 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_11() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP8 Min Value: Sending command..."); - mOnFailureCallback_11 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_11_FailureResponse, this); - mOnSuccessCallback_11 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_11_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t bitmap8Argument = 0; - err = cluster.WriteAttributeBitmap8(mOnSuccessCallback_11->Cancel(), mOnFailureCallback_11->Cancel(), bitmap8Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_11; - delete mOnSuccessCallback_11; - } + err = cluster.WriteAttributeBitmap8(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel(), bitmap8Argument); return err; } @@ -4680,9 +4005,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4699,9 +4021,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4713,32 +4032,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP8 Min Value - typedef void (*SuccessCallback_12)(void * context, uint8_t bitmap8); - chip::Callback::Callback * mOnSuccessCallback_12 = nullptr; - chip::Callback::Callback * mOnFailureCallback_12 = nullptr; - bool mIsFailureExpected_12 = 0; + using SuccessCallback_12 = void (*)(void * context, uint8_t bitmap8); + chip::Callback::Callback mOnSuccessCallback_12{ + OnTestSendClusterTestClusterCommandReadAttribute_12_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_12{ + OnTestSendClusterTestClusterCommandReadAttribute_12_FailureResponse, this + }; + bool mIsFailureExpected_12 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_12() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP8 Min Value: Sending command..."); - mOnFailureCallback_12 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_12_FailureResponse, this); - mOnSuccessCallback_12 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_12_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_12->Cancel(), mOnFailureCallback_12->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_12; - delete mOnSuccessCallback_12; - } + err = cluster.ReadAttributeBitmap8(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); return err; } @@ -4749,9 +4061,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (runner->mIsFailureExpected_12 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4768,9 +4077,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (runner->mIsFailureExpected_12 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4789,32 +4095,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP16 Default Value - typedef void (*SuccessCallback_13)(void * context, uint16_t bitmap16); - chip::Callback::Callback * mOnSuccessCallback_13 = nullptr; - chip::Callback::Callback * mOnFailureCallback_13 = nullptr; - bool mIsFailureExpected_13 = 0; + using SuccessCallback_13 = void (*)(void * context, uint16_t bitmap16); + chip::Callback::Callback mOnSuccessCallback_13{ + OnTestSendClusterTestClusterCommandReadAttribute_13_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_13{ + OnTestSendClusterTestClusterCommandReadAttribute_13_FailureResponse, this + }; + bool mIsFailureExpected_13 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_13() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP16 Default Value: Sending command..."); - mOnFailureCallback_13 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_13_FailureResponse, this); - mOnSuccessCallback_13 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_13_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_13->Cancel(), mOnFailureCallback_13->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_13; - delete mOnSuccessCallback_13; - } + err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); return err; } @@ -4825,9 +4124,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (runner->mIsFailureExpected_13 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4844,9 +4140,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (runner->mIsFailureExpected_13 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4865,33 +4158,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP16 Max Value - typedef void (*SuccessCallback_14)(void * context, uint16_t bitmap16); - chip::Callback::Callback * mOnSuccessCallback_14 = nullptr; - chip::Callback::Callback * mOnFailureCallback_14 = nullptr; - bool mIsFailureExpected_14 = 0; + using SuccessCallback_14 = void (*)(void * context, uint16_t bitmap16); + chip::Callback::Callback mOnSuccessCallback_14{ + OnTestSendClusterTestClusterCommandWriteAttribute_14_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_14{ + OnTestSendClusterTestClusterCommandWriteAttribute_14_FailureResponse, this + }; + bool mIsFailureExpected_14 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_14() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP16 Max Value: Sending command..."); - mOnFailureCallback_14 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_14_FailureResponse, this); - mOnSuccessCallback_14 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_14_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t bitmap16Argument = 65535U; - err = cluster.WriteAttributeBitmap16(mOnSuccessCallback_14->Cancel(), mOnFailureCallback_14->Cancel(), bitmap16Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_14; - delete mOnSuccessCallback_14; - } + err = cluster.WriteAttributeBitmap16(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel(), bitmap16Argument); return err; } @@ -4902,9 +4188,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_14; - delete runner->mOnSuccessCallback_14; - if (runner->mIsFailureExpected_14 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4921,9 +4204,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_14; - delete runner->mOnSuccessCallback_14; - if (runner->mIsFailureExpected_14 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -4935,32 +4215,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP16 Max Value - typedef void (*SuccessCallback_15)(void * context, uint16_t bitmap16); - chip::Callback::Callback * mOnSuccessCallback_15 = nullptr; - chip::Callback::Callback * mOnFailureCallback_15 = nullptr; - bool mIsFailureExpected_15 = 0; + using SuccessCallback_15 = void (*)(void * context, uint16_t bitmap16); + chip::Callback::Callback mOnSuccessCallback_15{ + OnTestSendClusterTestClusterCommandReadAttribute_15_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_15{ + OnTestSendClusterTestClusterCommandReadAttribute_15_FailureResponse, this + }; + bool mIsFailureExpected_15 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_15() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP16 Max Value: Sending command..."); - mOnFailureCallback_15 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_15_FailureResponse, this); - mOnSuccessCallback_15 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_15_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_15->Cancel(), mOnFailureCallback_15->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_15; - delete mOnSuccessCallback_15; - } + err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); return err; } @@ -4971,9 +4244,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_15; - delete runner->mOnSuccessCallback_15; - if (runner->mIsFailureExpected_15 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -4990,9 +4260,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_15; - delete runner->mOnSuccessCallback_15; - if (runner->mIsFailureExpected_15 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5011,33 +4278,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP16 Min Value - typedef void (*SuccessCallback_16)(void * context, uint16_t bitmap16); - chip::Callback::Callback * mOnSuccessCallback_16 = nullptr; - chip::Callback::Callback * mOnFailureCallback_16 = nullptr; - bool mIsFailureExpected_16 = 0; + using SuccessCallback_16 = void (*)(void * context, uint16_t bitmap16); + chip::Callback::Callback mOnSuccessCallback_16{ + OnTestSendClusterTestClusterCommandWriteAttribute_16_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_16{ + OnTestSendClusterTestClusterCommandWriteAttribute_16_FailureResponse, this + }; + bool mIsFailureExpected_16 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_16() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP16 Min Value: Sending command..."); - mOnFailureCallback_16 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_16_FailureResponse, this); - mOnSuccessCallback_16 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_16_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t bitmap16Argument = 0U; - err = cluster.WriteAttributeBitmap16(mOnSuccessCallback_16->Cancel(), mOnFailureCallback_16->Cancel(), bitmap16Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_16; - delete mOnSuccessCallback_16; - } + err = cluster.WriteAttributeBitmap16(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel(), bitmap16Argument); return err; } @@ -5048,9 +4308,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_16; - delete runner->mOnSuccessCallback_16; - if (runner->mIsFailureExpected_16 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5067,9 +4324,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_16; - delete runner->mOnSuccessCallback_16; - if (runner->mIsFailureExpected_16 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5081,32 +4335,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP16 Min Value - typedef void (*SuccessCallback_17)(void * context, uint16_t bitmap16); - chip::Callback::Callback * mOnSuccessCallback_17 = nullptr; - chip::Callback::Callback * mOnFailureCallback_17 = nullptr; - bool mIsFailureExpected_17 = 0; + using SuccessCallback_17 = void (*)(void * context, uint16_t bitmap16); + chip::Callback::Callback mOnSuccessCallback_17{ + OnTestSendClusterTestClusterCommandReadAttribute_17_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_17{ + OnTestSendClusterTestClusterCommandReadAttribute_17_FailureResponse, this + }; + bool mIsFailureExpected_17 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_17() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP16 Min Value: Sending command..."); - mOnFailureCallback_17 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_17_FailureResponse, this); - mOnSuccessCallback_17 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_17_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_17->Cancel(), mOnFailureCallback_17->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_17; - delete mOnSuccessCallback_17; - } + err = cluster.ReadAttributeBitmap16(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); return err; } @@ -5117,9 +4364,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_17; - delete runner->mOnSuccessCallback_17; - if (runner->mIsFailureExpected_17 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5136,9 +4380,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_17; - delete runner->mOnSuccessCallback_17; - if (runner->mIsFailureExpected_17 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5157,32 +4398,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP32 Default Value - typedef void (*SuccessCallback_18)(void * context, uint32_t bitmap32); - chip::Callback::Callback * mOnSuccessCallback_18 = nullptr; - chip::Callback::Callback * mOnFailureCallback_18 = nullptr; - bool mIsFailureExpected_18 = 0; + using SuccessCallback_18 = void (*)(void * context, uint32_t bitmap32); + chip::Callback::Callback mOnSuccessCallback_18{ + OnTestSendClusterTestClusterCommandReadAttribute_18_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_18{ + OnTestSendClusterTestClusterCommandReadAttribute_18_FailureResponse, this + }; + bool mIsFailureExpected_18 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_18() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP32 Default Value: Sending command..."); - mOnFailureCallback_18 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_18_FailureResponse, this); - mOnSuccessCallback_18 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_18_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_18->Cancel(), mOnFailureCallback_18->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_18; - delete mOnSuccessCallback_18; - } + err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_18.Cancel(), mOnFailureCallback_18.Cancel()); return err; } @@ -5193,9 +4427,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_18; - delete runner->mOnSuccessCallback_18; - if (runner->mIsFailureExpected_18 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5212,9 +4443,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_18; - delete runner->mOnSuccessCallback_18; - if (runner->mIsFailureExpected_18 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5233,33 +4461,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP32 Max Value - typedef void (*SuccessCallback_19)(void * context, uint32_t bitmap32); - chip::Callback::Callback * mOnSuccessCallback_19 = nullptr; - chip::Callback::Callback * mOnFailureCallback_19 = nullptr; - bool mIsFailureExpected_19 = 0; + using SuccessCallback_19 = void (*)(void * context, uint32_t bitmap32); + chip::Callback::Callback mOnSuccessCallback_19{ + OnTestSendClusterTestClusterCommandWriteAttribute_19_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_19{ + OnTestSendClusterTestClusterCommandWriteAttribute_19_FailureResponse, this + }; + bool mIsFailureExpected_19 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_19() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP32 Max Value: Sending command..."); - mOnFailureCallback_19 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_19_FailureResponse, this); - mOnSuccessCallback_19 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_19_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint32_t bitmap32Argument = 4294967295UL; - err = cluster.WriteAttributeBitmap32(mOnSuccessCallback_19->Cancel(), mOnFailureCallback_19->Cancel(), bitmap32Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_19; - delete mOnSuccessCallback_19; - } + err = cluster.WriteAttributeBitmap32(mOnSuccessCallback_19.Cancel(), mOnFailureCallback_19.Cancel(), bitmap32Argument); return err; } @@ -5270,9 +4491,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_19; - delete runner->mOnSuccessCallback_19; - if (runner->mIsFailureExpected_19 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5289,9 +4507,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_19; - delete runner->mOnSuccessCallback_19; - if (runner->mIsFailureExpected_19 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5303,32 +4518,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP32 Max Value - typedef void (*SuccessCallback_20)(void * context, uint32_t bitmap32); - chip::Callback::Callback * mOnSuccessCallback_20 = nullptr; - chip::Callback::Callback * mOnFailureCallback_20 = nullptr; - bool mIsFailureExpected_20 = 0; + using SuccessCallback_20 = void (*)(void * context, uint32_t bitmap32); + chip::Callback::Callback mOnSuccessCallback_20{ + OnTestSendClusterTestClusterCommandReadAttribute_20_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_20{ + OnTestSendClusterTestClusterCommandReadAttribute_20_FailureResponse, this + }; + bool mIsFailureExpected_20 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_20() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP32 Max Value: Sending command..."); - mOnFailureCallback_20 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_20_FailureResponse, this); - mOnSuccessCallback_20 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_20_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_20->Cancel(), mOnFailureCallback_20->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_20; - delete mOnSuccessCallback_20; - } + err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_20.Cancel(), mOnFailureCallback_20.Cancel()); return err; } @@ -5339,9 +4547,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_20; - delete runner->mOnSuccessCallback_20; - if (runner->mIsFailureExpected_20 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5358,9 +4563,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_20; - delete runner->mOnSuccessCallback_20; - if (runner->mIsFailureExpected_20 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5379,33 +4581,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP32 Min Value - typedef void (*SuccessCallback_21)(void * context, uint32_t bitmap32); - chip::Callback::Callback * mOnSuccessCallback_21 = nullptr; - chip::Callback::Callback * mOnFailureCallback_21 = nullptr; - bool mIsFailureExpected_21 = 0; + using SuccessCallback_21 = void (*)(void * context, uint32_t bitmap32); + chip::Callback::Callback mOnSuccessCallback_21{ + OnTestSendClusterTestClusterCommandWriteAttribute_21_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_21{ + OnTestSendClusterTestClusterCommandWriteAttribute_21_FailureResponse, this + }; + bool mIsFailureExpected_21 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_21() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP32 Min Value: Sending command..."); - mOnFailureCallback_21 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_21_FailureResponse, this); - mOnSuccessCallback_21 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_21_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint32_t bitmap32Argument = 0UL; - err = cluster.WriteAttributeBitmap32(mOnSuccessCallback_21->Cancel(), mOnFailureCallback_21->Cancel(), bitmap32Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_21; - delete mOnSuccessCallback_21; - } + err = cluster.WriteAttributeBitmap32(mOnSuccessCallback_21.Cancel(), mOnFailureCallback_21.Cancel(), bitmap32Argument); return err; } @@ -5416,9 +4611,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_21; - delete runner->mOnSuccessCallback_21; - if (runner->mIsFailureExpected_21 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5435,9 +4627,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_21; - delete runner->mOnSuccessCallback_21; - if (runner->mIsFailureExpected_21 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5449,32 +4638,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP32 Min Value - typedef void (*SuccessCallback_22)(void * context, uint32_t bitmap32); - chip::Callback::Callback * mOnSuccessCallback_22 = nullptr; - chip::Callback::Callback * mOnFailureCallback_22 = nullptr; - bool mIsFailureExpected_22 = 0; + using SuccessCallback_22 = void (*)(void * context, uint32_t bitmap32); + chip::Callback::Callback mOnSuccessCallback_22{ + OnTestSendClusterTestClusterCommandReadAttribute_22_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_22{ + OnTestSendClusterTestClusterCommandReadAttribute_22_FailureResponse, this + }; + bool mIsFailureExpected_22 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_22() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP32 Min Value: Sending command..."); - mOnFailureCallback_22 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_22_FailureResponse, this); - mOnSuccessCallback_22 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_22_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_22->Cancel(), mOnFailureCallback_22->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_22; - delete mOnSuccessCallback_22; - } + err = cluster.ReadAttributeBitmap32(mOnSuccessCallback_22.Cancel(), mOnFailureCallback_22.Cancel()); return err; } @@ -5485,9 +4667,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_22; - delete runner->mOnSuccessCallback_22; - if (runner->mIsFailureExpected_22 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5504,9 +4683,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_22; - delete runner->mOnSuccessCallback_22; - if (runner->mIsFailureExpected_22 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5525,32 +4701,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP64 Default Value - typedef void (*SuccessCallback_23)(void * context, uint64_t bitmap64); - chip::Callback::Callback * mOnSuccessCallback_23 = nullptr; - chip::Callback::Callback * mOnFailureCallback_23 = nullptr; - bool mIsFailureExpected_23 = 0; + using SuccessCallback_23 = void (*)(void * context, uint64_t bitmap64); + chip::Callback::Callback mOnSuccessCallback_23{ + OnTestSendClusterTestClusterCommandReadAttribute_23_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_23{ + OnTestSendClusterTestClusterCommandReadAttribute_23_FailureResponse, this + }; + bool mIsFailureExpected_23 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_23() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP64 Default Value: Sending command..."); - mOnFailureCallback_23 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_23_FailureResponse, this); - mOnSuccessCallback_23 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_23_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_23->Cancel(), mOnFailureCallback_23->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_23; - delete mOnSuccessCallback_23; - } + err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_23.Cancel(), mOnFailureCallback_23.Cancel()); return err; } @@ -5561,9 +4730,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_23; - delete runner->mOnSuccessCallback_23; - if (runner->mIsFailureExpected_23 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5580,9 +4746,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_23; - delete runner->mOnSuccessCallback_23; - if (runner->mIsFailureExpected_23 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5601,33 +4764,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP64 Max Value - typedef void (*SuccessCallback_24)(void * context, uint64_t bitmap64); - chip::Callback::Callback * mOnSuccessCallback_24 = nullptr; - chip::Callback::Callback * mOnFailureCallback_24 = nullptr; - bool mIsFailureExpected_24 = 0; + using SuccessCallback_24 = void (*)(void * context, uint64_t bitmap64); + chip::Callback::Callback mOnSuccessCallback_24{ + OnTestSendClusterTestClusterCommandWriteAttribute_24_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_24{ + OnTestSendClusterTestClusterCommandWriteAttribute_24_FailureResponse, this + }; + bool mIsFailureExpected_24 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_24() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP64 Max Value: Sending command..."); - mOnFailureCallback_24 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_24_FailureResponse, this); - mOnSuccessCallback_24 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_24_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t bitmap64Argument = 18446744073709551615ULL; - err = cluster.WriteAttributeBitmap64(mOnSuccessCallback_24->Cancel(), mOnFailureCallback_24->Cancel(), bitmap64Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_24; - delete mOnSuccessCallback_24; - } + err = cluster.WriteAttributeBitmap64(mOnSuccessCallback_24.Cancel(), mOnFailureCallback_24.Cancel(), bitmap64Argument); return err; } @@ -5638,9 +4794,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_24; - delete runner->mOnSuccessCallback_24; - if (runner->mIsFailureExpected_24 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5657,9 +4810,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_24; - delete runner->mOnSuccessCallback_24; - if (runner->mIsFailureExpected_24 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5671,32 +4821,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP64 Max Value - typedef void (*SuccessCallback_25)(void * context, uint64_t bitmap64); - chip::Callback::Callback * mOnSuccessCallback_25 = nullptr; - chip::Callback::Callback * mOnFailureCallback_25 = nullptr; - bool mIsFailureExpected_25 = 0; + using SuccessCallback_25 = void (*)(void * context, uint64_t bitmap64); + chip::Callback::Callback mOnSuccessCallback_25{ + OnTestSendClusterTestClusterCommandReadAttribute_25_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_25{ + OnTestSendClusterTestClusterCommandReadAttribute_25_FailureResponse, this + }; + bool mIsFailureExpected_25 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_25() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP64 Max Value: Sending command..."); - mOnFailureCallback_25 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_25_FailureResponse, this); - mOnSuccessCallback_25 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_25_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_25->Cancel(), mOnFailureCallback_25->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_25; - delete mOnSuccessCallback_25; - } + err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_25.Cancel(), mOnFailureCallback_25.Cancel()); return err; } @@ -5707,9 +4850,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_25; - delete runner->mOnSuccessCallback_25; - if (runner->mIsFailureExpected_25 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5726,9 +4866,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_25; - delete runner->mOnSuccessCallback_25; - if (runner->mIsFailureExpected_25 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5747,33 +4884,26 @@ class TestCluster : public TestCommand } // Test Write attribute BITMAP64 Min Value - typedef void (*SuccessCallback_26)(void * context, uint64_t bitmap64); - chip::Callback::Callback * mOnSuccessCallback_26 = nullptr; - chip::Callback::Callback * mOnFailureCallback_26 = nullptr; - bool mIsFailureExpected_26 = 0; + using SuccessCallback_26 = void (*)(void * context, uint64_t bitmap64); + chip::Callback::Callback mOnSuccessCallback_26{ + OnTestSendClusterTestClusterCommandWriteAttribute_26_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_26{ + OnTestSendClusterTestClusterCommandWriteAttribute_26_FailureResponse, this + }; + bool mIsFailureExpected_26 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_26() { ChipLogProgress(chipTool, "Test Cluster - Write attribute BITMAP64 Min Value: Sending command..."); - mOnFailureCallback_26 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_26_FailureResponse, this); - mOnSuccessCallback_26 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_26_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t bitmap64Argument = 0ULL; - err = cluster.WriteAttributeBitmap64(mOnSuccessCallback_26->Cancel(), mOnFailureCallback_26->Cancel(), bitmap64Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_26; - delete mOnSuccessCallback_26; - } + err = cluster.WriteAttributeBitmap64(mOnSuccessCallback_26.Cancel(), mOnFailureCallback_26.Cancel(), bitmap64Argument); return err; } @@ -5784,9 +4914,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_26; - delete runner->mOnSuccessCallback_26; - if (runner->mIsFailureExpected_26 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5803,9 +4930,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_26; - delete runner->mOnSuccessCallback_26; - if (runner->mIsFailureExpected_26 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5817,32 +4941,25 @@ class TestCluster : public TestCommand } // Test Read attribute BITMAP64 Min Value - typedef void (*SuccessCallback_27)(void * context, uint64_t bitmap64); - chip::Callback::Callback * mOnSuccessCallback_27 = nullptr; - chip::Callback::Callback * mOnFailureCallback_27 = nullptr; - bool mIsFailureExpected_27 = 0; + using SuccessCallback_27 = void (*)(void * context, uint64_t bitmap64); + chip::Callback::Callback mOnSuccessCallback_27{ + OnTestSendClusterTestClusterCommandReadAttribute_27_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_27{ + OnTestSendClusterTestClusterCommandReadAttribute_27_FailureResponse, this + }; + bool mIsFailureExpected_27 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_27() { ChipLogProgress(chipTool, "Test Cluster - Read attribute BITMAP64 Min Value: Sending command..."); - mOnFailureCallback_27 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_27_FailureResponse, this); - mOnSuccessCallback_27 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_27_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_27->Cancel(), mOnFailureCallback_27->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_27; - delete mOnSuccessCallback_27; - } + err = cluster.ReadAttributeBitmap64(mOnSuccessCallback_27.Cancel(), mOnFailureCallback_27.Cancel()); return err; } @@ -5853,9 +4970,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_27; - delete runner->mOnSuccessCallback_27; - if (runner->mIsFailureExpected_27 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5872,9 +4986,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_27; - delete runner->mOnSuccessCallback_27; - if (runner->mIsFailureExpected_27 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5893,32 +5004,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8U Default Value - typedef void (*SuccessCallback_28)(void * context, uint8_t int8u); - chip::Callback::Callback * mOnSuccessCallback_28 = nullptr; - chip::Callback::Callback * mOnFailureCallback_28 = nullptr; - bool mIsFailureExpected_28 = 0; + using SuccessCallback_28 = void (*)(void * context, uint8_t int8u); + chip::Callback::Callback mOnSuccessCallback_28{ + OnTestSendClusterTestClusterCommandReadAttribute_28_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_28{ + OnTestSendClusterTestClusterCommandReadAttribute_28_FailureResponse, this + }; + bool mIsFailureExpected_28 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_28() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8U Default Value: Sending command..."); - mOnFailureCallback_28 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_28_FailureResponse, this); - mOnSuccessCallback_28 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_28_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8u(mOnSuccessCallback_28->Cancel(), mOnFailureCallback_28->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_28; - delete mOnSuccessCallback_28; - } + err = cluster.ReadAttributeInt8u(mOnSuccessCallback_28.Cancel(), mOnFailureCallback_28.Cancel()); return err; } @@ -5929,9 +5033,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_28; - delete runner->mOnSuccessCallback_28; - if (runner->mIsFailureExpected_28 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -5948,9 +5049,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_28; - delete runner->mOnSuccessCallback_28; - if (runner->mIsFailureExpected_28 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -5969,33 +5067,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT8U Max Value - typedef void (*SuccessCallback_29)(void * context, uint8_t int8u); - chip::Callback::Callback * mOnSuccessCallback_29 = nullptr; - chip::Callback::Callback * mOnFailureCallback_29 = nullptr; - bool mIsFailureExpected_29 = 0; + using SuccessCallback_29 = void (*)(void * context, uint8_t int8u); + chip::Callback::Callback mOnSuccessCallback_29{ + OnTestSendClusterTestClusterCommandWriteAttribute_29_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_29{ + OnTestSendClusterTestClusterCommandWriteAttribute_29_FailureResponse, this + }; + bool mIsFailureExpected_29 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_29() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT8U Max Value: Sending command..."); - mOnFailureCallback_29 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_29_FailureResponse, this); - mOnSuccessCallback_29 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_29_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t int8uArgument = 255; - err = cluster.WriteAttributeInt8u(mOnSuccessCallback_29->Cancel(), mOnFailureCallback_29->Cancel(), int8uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_29; - delete mOnSuccessCallback_29; - } + err = cluster.WriteAttributeInt8u(mOnSuccessCallback_29.Cancel(), mOnFailureCallback_29.Cancel(), int8uArgument); return err; } @@ -6006,9 +5097,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_29; - delete runner->mOnSuccessCallback_29; - if (runner->mIsFailureExpected_29 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6025,9 +5113,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_29; - delete runner->mOnSuccessCallback_29; - if (runner->mIsFailureExpected_29 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6039,32 +5124,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8U Max Value - typedef void (*SuccessCallback_30)(void * context, uint8_t int8u); - chip::Callback::Callback * mOnSuccessCallback_30 = nullptr; - chip::Callback::Callback * mOnFailureCallback_30 = nullptr; - bool mIsFailureExpected_30 = 0; + using SuccessCallback_30 = void (*)(void * context, uint8_t int8u); + chip::Callback::Callback mOnSuccessCallback_30{ + OnTestSendClusterTestClusterCommandReadAttribute_30_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_30{ + OnTestSendClusterTestClusterCommandReadAttribute_30_FailureResponse, this + }; + bool mIsFailureExpected_30 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_30() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8U Max Value: Sending command..."); - mOnFailureCallback_30 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_30_FailureResponse, this); - mOnSuccessCallback_30 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_30_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8u(mOnSuccessCallback_30->Cancel(), mOnFailureCallback_30->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_30; - delete mOnSuccessCallback_30; - } + err = cluster.ReadAttributeInt8u(mOnSuccessCallback_30.Cancel(), mOnFailureCallback_30.Cancel()); return err; } @@ -6075,9 +5153,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_30; - delete runner->mOnSuccessCallback_30; - if (runner->mIsFailureExpected_30 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6094,9 +5169,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_30; - delete runner->mOnSuccessCallback_30; - if (runner->mIsFailureExpected_30 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6115,33 +5187,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT8U Min Value - typedef void (*SuccessCallback_31)(void * context, uint8_t int8u); - chip::Callback::Callback * mOnSuccessCallback_31 = nullptr; - chip::Callback::Callback * mOnFailureCallback_31 = nullptr; - bool mIsFailureExpected_31 = 0; + using SuccessCallback_31 = void (*)(void * context, uint8_t int8u); + chip::Callback::Callback mOnSuccessCallback_31{ + OnTestSendClusterTestClusterCommandWriteAttribute_31_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_31{ + OnTestSendClusterTestClusterCommandWriteAttribute_31_FailureResponse, this + }; + bool mIsFailureExpected_31 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_31() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT8U Min Value: Sending command..."); - mOnFailureCallback_31 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_31_FailureResponse, this); - mOnSuccessCallback_31 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_31_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t int8uArgument = 0; - err = cluster.WriteAttributeInt8u(mOnSuccessCallback_31->Cancel(), mOnFailureCallback_31->Cancel(), int8uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_31; - delete mOnSuccessCallback_31; - } + err = cluster.WriteAttributeInt8u(mOnSuccessCallback_31.Cancel(), mOnFailureCallback_31.Cancel(), int8uArgument); return err; } @@ -6152,9 +5217,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_31; - delete runner->mOnSuccessCallback_31; - if (runner->mIsFailureExpected_31 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6171,9 +5233,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_31; - delete runner->mOnSuccessCallback_31; - if (runner->mIsFailureExpected_31 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6185,32 +5244,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8U Min Value - typedef void (*SuccessCallback_32)(void * context, uint8_t int8u); - chip::Callback::Callback * mOnSuccessCallback_32 = nullptr; - chip::Callback::Callback * mOnFailureCallback_32 = nullptr; - bool mIsFailureExpected_32 = 0; + using SuccessCallback_32 = void (*)(void * context, uint8_t int8u); + chip::Callback::Callback mOnSuccessCallback_32{ + OnTestSendClusterTestClusterCommandReadAttribute_32_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_32{ + OnTestSendClusterTestClusterCommandReadAttribute_32_FailureResponse, this + }; + bool mIsFailureExpected_32 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_32() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8U Min Value: Sending command..."); - mOnFailureCallback_32 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_32_FailureResponse, this); - mOnSuccessCallback_32 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_32_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8u(mOnSuccessCallback_32->Cancel(), mOnFailureCallback_32->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_32; - delete mOnSuccessCallback_32; - } + err = cluster.ReadAttributeInt8u(mOnSuccessCallback_32.Cancel(), mOnFailureCallback_32.Cancel()); return err; } @@ -6221,9 +5273,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_32; - delete runner->mOnSuccessCallback_32; - if (runner->mIsFailureExpected_32 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6240,9 +5289,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_32; - delete runner->mOnSuccessCallback_32; - if (runner->mIsFailureExpected_32 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6261,32 +5307,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16U Default Value - typedef void (*SuccessCallback_33)(void * context, uint16_t int16u); - chip::Callback::Callback * mOnSuccessCallback_33 = nullptr; - chip::Callback::Callback * mOnFailureCallback_33 = nullptr; - bool mIsFailureExpected_33 = 0; + using SuccessCallback_33 = void (*)(void * context, uint16_t int16u); + chip::Callback::Callback mOnSuccessCallback_33{ + OnTestSendClusterTestClusterCommandReadAttribute_33_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_33{ + OnTestSendClusterTestClusterCommandReadAttribute_33_FailureResponse, this + }; + bool mIsFailureExpected_33 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_33() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16U Default Value: Sending command..."); - mOnFailureCallback_33 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_33_FailureResponse, this); - mOnSuccessCallback_33 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_33_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16u(mOnSuccessCallback_33->Cancel(), mOnFailureCallback_33->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_33; - delete mOnSuccessCallback_33; - } + err = cluster.ReadAttributeInt16u(mOnSuccessCallback_33.Cancel(), mOnFailureCallback_33.Cancel()); return err; } @@ -6297,9 +5336,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_33; - delete runner->mOnSuccessCallback_33; - if (runner->mIsFailureExpected_33 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6316,9 +5352,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_33; - delete runner->mOnSuccessCallback_33; - if (runner->mIsFailureExpected_33 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6337,33 +5370,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT16U Max Value - typedef void (*SuccessCallback_34)(void * context, uint16_t int16u); - chip::Callback::Callback * mOnSuccessCallback_34 = nullptr; - chip::Callback::Callback * mOnFailureCallback_34 = nullptr; - bool mIsFailureExpected_34 = 0; + using SuccessCallback_34 = void (*)(void * context, uint16_t int16u); + chip::Callback::Callback mOnSuccessCallback_34{ + OnTestSendClusterTestClusterCommandWriteAttribute_34_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_34{ + OnTestSendClusterTestClusterCommandWriteAttribute_34_FailureResponse, this + }; + bool mIsFailureExpected_34 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_34() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT16U Max Value: Sending command..."); - mOnFailureCallback_34 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_34_FailureResponse, this); - mOnSuccessCallback_34 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_34_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t int16uArgument = 65535U; - err = cluster.WriteAttributeInt16u(mOnSuccessCallback_34->Cancel(), mOnFailureCallback_34->Cancel(), int16uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_34; - delete mOnSuccessCallback_34; - } + err = cluster.WriteAttributeInt16u(mOnSuccessCallback_34.Cancel(), mOnFailureCallback_34.Cancel(), int16uArgument); return err; } @@ -6374,9 +5400,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_34; - delete runner->mOnSuccessCallback_34; - if (runner->mIsFailureExpected_34 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6393,9 +5416,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_34; - delete runner->mOnSuccessCallback_34; - if (runner->mIsFailureExpected_34 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6407,32 +5427,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16U Max Value - typedef void (*SuccessCallback_35)(void * context, uint16_t int16u); - chip::Callback::Callback * mOnSuccessCallback_35 = nullptr; - chip::Callback::Callback * mOnFailureCallback_35 = nullptr; - bool mIsFailureExpected_35 = 0; + using SuccessCallback_35 = void (*)(void * context, uint16_t int16u); + chip::Callback::Callback mOnSuccessCallback_35{ + OnTestSendClusterTestClusterCommandReadAttribute_35_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_35{ + OnTestSendClusterTestClusterCommandReadAttribute_35_FailureResponse, this + }; + bool mIsFailureExpected_35 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_35() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16U Max Value: Sending command..."); - mOnFailureCallback_35 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_35_FailureResponse, this); - mOnSuccessCallback_35 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_35_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16u(mOnSuccessCallback_35->Cancel(), mOnFailureCallback_35->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_35; - delete mOnSuccessCallback_35; - } + err = cluster.ReadAttributeInt16u(mOnSuccessCallback_35.Cancel(), mOnFailureCallback_35.Cancel()); return err; } @@ -6443,9 +5456,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_35; - delete runner->mOnSuccessCallback_35; - if (runner->mIsFailureExpected_35 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6462,9 +5472,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_35; - delete runner->mOnSuccessCallback_35; - if (runner->mIsFailureExpected_35 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6483,33 +5490,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT16U Min Value - typedef void (*SuccessCallback_36)(void * context, uint16_t int16u); - chip::Callback::Callback * mOnSuccessCallback_36 = nullptr; - chip::Callback::Callback * mOnFailureCallback_36 = nullptr; - bool mIsFailureExpected_36 = 0; + using SuccessCallback_36 = void (*)(void * context, uint16_t int16u); + chip::Callback::Callback mOnSuccessCallback_36{ + OnTestSendClusterTestClusterCommandWriteAttribute_36_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_36{ + OnTestSendClusterTestClusterCommandWriteAttribute_36_FailureResponse, this + }; + bool mIsFailureExpected_36 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_36() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT16U Min Value: Sending command..."); - mOnFailureCallback_36 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_36_FailureResponse, this); - mOnSuccessCallback_36 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_36_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t int16uArgument = 0U; - err = cluster.WriteAttributeInt16u(mOnSuccessCallback_36->Cancel(), mOnFailureCallback_36->Cancel(), int16uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_36; - delete mOnSuccessCallback_36; - } + err = cluster.WriteAttributeInt16u(mOnSuccessCallback_36.Cancel(), mOnFailureCallback_36.Cancel(), int16uArgument); return err; } @@ -6520,9 +5520,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_36; - delete runner->mOnSuccessCallback_36; - if (runner->mIsFailureExpected_36 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6539,9 +5536,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_36; - delete runner->mOnSuccessCallback_36; - if (runner->mIsFailureExpected_36 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6553,32 +5547,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16U Min Value - typedef void (*SuccessCallback_37)(void * context, uint16_t int16u); - chip::Callback::Callback * mOnSuccessCallback_37 = nullptr; - chip::Callback::Callback * mOnFailureCallback_37 = nullptr; - bool mIsFailureExpected_37 = 0; + using SuccessCallback_37 = void (*)(void * context, uint16_t int16u); + chip::Callback::Callback mOnSuccessCallback_37{ + OnTestSendClusterTestClusterCommandReadAttribute_37_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_37{ + OnTestSendClusterTestClusterCommandReadAttribute_37_FailureResponse, this + }; + bool mIsFailureExpected_37 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_37() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16U Min Value: Sending command..."); - mOnFailureCallback_37 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_37_FailureResponse, this); - mOnSuccessCallback_37 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_37_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16u(mOnSuccessCallback_37->Cancel(), mOnFailureCallback_37->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_37; - delete mOnSuccessCallback_37; - } + err = cluster.ReadAttributeInt16u(mOnSuccessCallback_37.Cancel(), mOnFailureCallback_37.Cancel()); return err; } @@ -6589,9 +5576,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_37; - delete runner->mOnSuccessCallback_37; - if (runner->mIsFailureExpected_37 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6608,9 +5592,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_37; - delete runner->mOnSuccessCallback_37; - if (runner->mIsFailureExpected_37 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6629,32 +5610,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32U Default Value - typedef void (*SuccessCallback_38)(void * context, uint32_t int32u); - chip::Callback::Callback * mOnSuccessCallback_38 = nullptr; - chip::Callback::Callback * mOnFailureCallback_38 = nullptr; - bool mIsFailureExpected_38 = 0; + using SuccessCallback_38 = void (*)(void * context, uint32_t int32u); + chip::Callback::Callback mOnSuccessCallback_38{ + OnTestSendClusterTestClusterCommandReadAttribute_38_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_38{ + OnTestSendClusterTestClusterCommandReadAttribute_38_FailureResponse, this + }; + bool mIsFailureExpected_38 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_38() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32U Default Value: Sending command..."); - mOnFailureCallback_38 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_38_FailureResponse, this); - mOnSuccessCallback_38 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_38_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32u(mOnSuccessCallback_38->Cancel(), mOnFailureCallback_38->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_38; - delete mOnSuccessCallback_38; - } + err = cluster.ReadAttributeInt32u(mOnSuccessCallback_38.Cancel(), mOnFailureCallback_38.Cancel()); return err; } @@ -6665,9 +5639,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_38; - delete runner->mOnSuccessCallback_38; - if (runner->mIsFailureExpected_38 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6684,9 +5655,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_38; - delete runner->mOnSuccessCallback_38; - if (runner->mIsFailureExpected_38 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6705,33 +5673,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT32U Max Value - typedef void (*SuccessCallback_39)(void * context, uint32_t int32u); - chip::Callback::Callback * mOnSuccessCallback_39 = nullptr; - chip::Callback::Callback * mOnFailureCallback_39 = nullptr; - bool mIsFailureExpected_39 = 0; + using SuccessCallback_39 = void (*)(void * context, uint32_t int32u); + chip::Callback::Callback mOnSuccessCallback_39{ + OnTestSendClusterTestClusterCommandWriteAttribute_39_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_39{ + OnTestSendClusterTestClusterCommandWriteAttribute_39_FailureResponse, this + }; + bool mIsFailureExpected_39 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_39() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT32U Max Value: Sending command..."); - mOnFailureCallback_39 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_39_FailureResponse, this); - mOnSuccessCallback_39 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_39_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint32_t int32uArgument = 4294967295UL; - err = cluster.WriteAttributeInt32u(mOnSuccessCallback_39->Cancel(), mOnFailureCallback_39->Cancel(), int32uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_39; - delete mOnSuccessCallback_39; - } + err = cluster.WriteAttributeInt32u(mOnSuccessCallback_39.Cancel(), mOnFailureCallback_39.Cancel(), int32uArgument); return err; } @@ -6742,9 +5703,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_39; - delete runner->mOnSuccessCallback_39; - if (runner->mIsFailureExpected_39 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6761,9 +5719,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_39; - delete runner->mOnSuccessCallback_39; - if (runner->mIsFailureExpected_39 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6775,32 +5730,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32U Max Value - typedef void (*SuccessCallback_40)(void * context, uint32_t int32u); - chip::Callback::Callback * mOnSuccessCallback_40 = nullptr; - chip::Callback::Callback * mOnFailureCallback_40 = nullptr; - bool mIsFailureExpected_40 = 0; + using SuccessCallback_40 = void (*)(void * context, uint32_t int32u); + chip::Callback::Callback mOnSuccessCallback_40{ + OnTestSendClusterTestClusterCommandReadAttribute_40_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_40{ + OnTestSendClusterTestClusterCommandReadAttribute_40_FailureResponse, this + }; + bool mIsFailureExpected_40 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_40() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32U Max Value: Sending command..."); - mOnFailureCallback_40 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_40_FailureResponse, this); - mOnSuccessCallback_40 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_40_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32u(mOnSuccessCallback_40->Cancel(), mOnFailureCallback_40->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_40; - delete mOnSuccessCallback_40; - } + err = cluster.ReadAttributeInt32u(mOnSuccessCallback_40.Cancel(), mOnFailureCallback_40.Cancel()); return err; } @@ -6811,9 +5759,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_40; - delete runner->mOnSuccessCallback_40; - if (runner->mIsFailureExpected_40 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6830,9 +5775,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_40; - delete runner->mOnSuccessCallback_40; - if (runner->mIsFailureExpected_40 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6851,33 +5793,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT32U Min Value - typedef void (*SuccessCallback_41)(void * context, uint32_t int32u); - chip::Callback::Callback * mOnSuccessCallback_41 = nullptr; - chip::Callback::Callback * mOnFailureCallback_41 = nullptr; - bool mIsFailureExpected_41 = 0; + using SuccessCallback_41 = void (*)(void * context, uint32_t int32u); + chip::Callback::Callback mOnSuccessCallback_41{ + OnTestSendClusterTestClusterCommandWriteAttribute_41_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_41{ + OnTestSendClusterTestClusterCommandWriteAttribute_41_FailureResponse, this + }; + bool mIsFailureExpected_41 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_41() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT32U Min Value: Sending command..."); - mOnFailureCallback_41 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_41_FailureResponse, this); - mOnSuccessCallback_41 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_41_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint32_t int32uArgument = 0UL; - err = cluster.WriteAttributeInt32u(mOnSuccessCallback_41->Cancel(), mOnFailureCallback_41->Cancel(), int32uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_41; - delete mOnSuccessCallback_41; - } + err = cluster.WriteAttributeInt32u(mOnSuccessCallback_41.Cancel(), mOnFailureCallback_41.Cancel(), int32uArgument); return err; } @@ -6888,9 +5823,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_41; - delete runner->mOnSuccessCallback_41; - if (runner->mIsFailureExpected_41 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6907,9 +5839,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_41; - delete runner->mOnSuccessCallback_41; - if (runner->mIsFailureExpected_41 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6921,32 +5850,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32U Min Value - typedef void (*SuccessCallback_42)(void * context, uint32_t int32u); - chip::Callback::Callback * mOnSuccessCallback_42 = nullptr; - chip::Callback::Callback * mOnFailureCallback_42 = nullptr; - bool mIsFailureExpected_42 = 0; + using SuccessCallback_42 = void (*)(void * context, uint32_t int32u); + chip::Callback::Callback mOnSuccessCallback_42{ + OnTestSendClusterTestClusterCommandReadAttribute_42_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_42{ + OnTestSendClusterTestClusterCommandReadAttribute_42_FailureResponse, this + }; + bool mIsFailureExpected_42 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_42() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32U Min Value: Sending command..."); - mOnFailureCallback_42 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_42_FailureResponse, this); - mOnSuccessCallback_42 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_42_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32u(mOnSuccessCallback_42->Cancel(), mOnFailureCallback_42->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_42; - delete mOnSuccessCallback_42; - } + err = cluster.ReadAttributeInt32u(mOnSuccessCallback_42.Cancel(), mOnFailureCallback_42.Cancel()); return err; } @@ -6957,9 +5879,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_42; - delete runner->mOnSuccessCallback_42; - if (runner->mIsFailureExpected_42 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -6976,9 +5895,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_42; - delete runner->mOnSuccessCallback_42; - if (runner->mIsFailureExpected_42 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -6997,32 +5913,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64U Default Value - typedef void (*SuccessCallback_43)(void * context, uint64_t int64u); - chip::Callback::Callback * mOnSuccessCallback_43 = nullptr; - chip::Callback::Callback * mOnFailureCallback_43 = nullptr; - bool mIsFailureExpected_43 = 0; + using SuccessCallback_43 = void (*)(void * context, uint64_t int64u); + chip::Callback::Callback mOnSuccessCallback_43{ + OnTestSendClusterTestClusterCommandReadAttribute_43_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_43{ + OnTestSendClusterTestClusterCommandReadAttribute_43_FailureResponse, this + }; + bool mIsFailureExpected_43 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_43() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64U Default Value: Sending command..."); - mOnFailureCallback_43 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_43_FailureResponse, this); - mOnSuccessCallback_43 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_43_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64u(mOnSuccessCallback_43->Cancel(), mOnFailureCallback_43->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_43; - delete mOnSuccessCallback_43; - } + err = cluster.ReadAttributeInt64u(mOnSuccessCallback_43.Cancel(), mOnFailureCallback_43.Cancel()); return err; } @@ -7033,9 +5942,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_43; - delete runner->mOnSuccessCallback_43; - if (runner->mIsFailureExpected_43 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7052,9 +5958,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_43; - delete runner->mOnSuccessCallback_43; - if (runner->mIsFailureExpected_43 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7073,33 +5976,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT64U Max Value - typedef void (*SuccessCallback_44)(void * context, uint64_t int64u); - chip::Callback::Callback * mOnSuccessCallback_44 = nullptr; - chip::Callback::Callback * mOnFailureCallback_44 = nullptr; - bool mIsFailureExpected_44 = 0; + using SuccessCallback_44 = void (*)(void * context, uint64_t int64u); + chip::Callback::Callback mOnSuccessCallback_44{ + OnTestSendClusterTestClusterCommandWriteAttribute_44_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_44{ + OnTestSendClusterTestClusterCommandWriteAttribute_44_FailureResponse, this + }; + bool mIsFailureExpected_44 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_44() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT64U Max Value: Sending command..."); - mOnFailureCallback_44 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_44_FailureResponse, this); - mOnSuccessCallback_44 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_44_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t int64uArgument = 18446744073709551615ULL; - err = cluster.WriteAttributeInt64u(mOnSuccessCallback_44->Cancel(), mOnFailureCallback_44->Cancel(), int64uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_44; - delete mOnSuccessCallback_44; - } + err = cluster.WriteAttributeInt64u(mOnSuccessCallback_44.Cancel(), mOnFailureCallback_44.Cancel(), int64uArgument); return err; } @@ -7110,9 +6006,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_44; - delete runner->mOnSuccessCallback_44; - if (runner->mIsFailureExpected_44 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7129,9 +6022,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_44; - delete runner->mOnSuccessCallback_44; - if (runner->mIsFailureExpected_44 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7143,32 +6033,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64U Max Value - typedef void (*SuccessCallback_45)(void * context, uint64_t int64u); - chip::Callback::Callback * mOnSuccessCallback_45 = nullptr; - chip::Callback::Callback * mOnFailureCallback_45 = nullptr; - bool mIsFailureExpected_45 = 0; + using SuccessCallback_45 = void (*)(void * context, uint64_t int64u); + chip::Callback::Callback mOnSuccessCallback_45{ + OnTestSendClusterTestClusterCommandReadAttribute_45_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_45{ + OnTestSendClusterTestClusterCommandReadAttribute_45_FailureResponse, this + }; + bool mIsFailureExpected_45 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_45() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64U Max Value: Sending command..."); - mOnFailureCallback_45 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_45_FailureResponse, this); - mOnSuccessCallback_45 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_45_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64u(mOnSuccessCallback_45->Cancel(), mOnFailureCallback_45->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_45; - delete mOnSuccessCallback_45; - } + err = cluster.ReadAttributeInt64u(mOnSuccessCallback_45.Cancel(), mOnFailureCallback_45.Cancel()); return err; } @@ -7179,9 +6062,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_45; - delete runner->mOnSuccessCallback_45; - if (runner->mIsFailureExpected_45 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7198,9 +6078,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_45; - delete runner->mOnSuccessCallback_45; - if (runner->mIsFailureExpected_45 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7219,33 +6096,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT64U Min Value - typedef void (*SuccessCallback_46)(void * context, uint64_t int64u); - chip::Callback::Callback * mOnSuccessCallback_46 = nullptr; - chip::Callback::Callback * mOnFailureCallback_46 = nullptr; - bool mIsFailureExpected_46 = 0; + using SuccessCallback_46 = void (*)(void * context, uint64_t int64u); + chip::Callback::Callback mOnSuccessCallback_46{ + OnTestSendClusterTestClusterCommandWriteAttribute_46_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_46{ + OnTestSendClusterTestClusterCommandWriteAttribute_46_FailureResponse, this + }; + bool mIsFailureExpected_46 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_46() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT64U Min Value: Sending command..."); - mOnFailureCallback_46 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_46_FailureResponse, this); - mOnSuccessCallback_46 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_46_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint64_t int64uArgument = 0ULL; - err = cluster.WriteAttributeInt64u(mOnSuccessCallback_46->Cancel(), mOnFailureCallback_46->Cancel(), int64uArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_46; - delete mOnSuccessCallback_46; - } + err = cluster.WriteAttributeInt64u(mOnSuccessCallback_46.Cancel(), mOnFailureCallback_46.Cancel(), int64uArgument); return err; } @@ -7256,9 +6126,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_46; - delete runner->mOnSuccessCallback_46; - if (runner->mIsFailureExpected_46 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7275,9 +6142,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_46; - delete runner->mOnSuccessCallback_46; - if (runner->mIsFailureExpected_46 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7289,32 +6153,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64U Min Value - typedef void (*SuccessCallback_47)(void * context, uint64_t int64u); - chip::Callback::Callback * mOnSuccessCallback_47 = nullptr; - chip::Callback::Callback * mOnFailureCallback_47 = nullptr; - bool mIsFailureExpected_47 = 0; + using SuccessCallback_47 = void (*)(void * context, uint64_t int64u); + chip::Callback::Callback mOnSuccessCallback_47{ + OnTestSendClusterTestClusterCommandReadAttribute_47_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_47{ + OnTestSendClusterTestClusterCommandReadAttribute_47_FailureResponse, this + }; + bool mIsFailureExpected_47 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_47() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64U Min Value: Sending command..."); - mOnFailureCallback_47 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_47_FailureResponse, this); - mOnSuccessCallback_47 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_47_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64u(mOnSuccessCallback_47->Cancel(), mOnFailureCallback_47->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_47; - delete mOnSuccessCallback_47; - } + err = cluster.ReadAttributeInt64u(mOnSuccessCallback_47.Cancel(), mOnFailureCallback_47.Cancel()); return err; } @@ -7325,9 +6182,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_47; - delete runner->mOnSuccessCallback_47; - if (runner->mIsFailureExpected_47 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7344,9 +6198,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_47; - delete runner->mOnSuccessCallback_47; - if (runner->mIsFailureExpected_47 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7365,32 +6216,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8S Default Value - typedef void (*SuccessCallback_48)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_48 = nullptr; - chip::Callback::Callback * mOnFailureCallback_48 = nullptr; - bool mIsFailureExpected_48 = 0; + using SuccessCallback_48 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_48{ + OnTestSendClusterTestClusterCommandReadAttribute_48_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_48{ + OnTestSendClusterTestClusterCommandReadAttribute_48_FailureResponse, this + }; + bool mIsFailureExpected_48 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_48() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8S Default Value: Sending command..."); - mOnFailureCallback_48 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_48_FailureResponse, this); - mOnSuccessCallback_48 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_48_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8s(mOnSuccessCallback_48->Cancel(), mOnFailureCallback_48->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_48; - delete mOnSuccessCallback_48; - } + err = cluster.ReadAttributeInt8s(mOnSuccessCallback_48.Cancel(), mOnFailureCallback_48.Cancel()); return err; } @@ -7401,9 +6245,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_48; - delete runner->mOnSuccessCallback_48; - if (runner->mIsFailureExpected_48 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7420,9 +6261,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_48; - delete runner->mOnSuccessCallback_48; - if (runner->mIsFailureExpected_48 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7441,33 +6279,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT8S Max Value - typedef void (*SuccessCallback_49)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_49 = nullptr; - chip::Callback::Callback * mOnFailureCallback_49 = nullptr; - bool mIsFailureExpected_49 = 0; + using SuccessCallback_49 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_49{ + OnTestSendClusterTestClusterCommandWriteAttribute_49_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_49{ + OnTestSendClusterTestClusterCommandWriteAttribute_49_FailureResponse, this + }; + bool mIsFailureExpected_49 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_49() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT8S Max Value: Sending command..."); - mOnFailureCallback_49 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_49_FailureResponse, this); - mOnSuccessCallback_49 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_49_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int8_t int8sArgument = 127; - err = cluster.WriteAttributeInt8s(mOnSuccessCallback_49->Cancel(), mOnFailureCallback_49->Cancel(), int8sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_49; - delete mOnSuccessCallback_49; - } + err = cluster.WriteAttributeInt8s(mOnSuccessCallback_49.Cancel(), mOnFailureCallback_49.Cancel(), int8sArgument); return err; } @@ -7478,9 +6309,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_49; - delete runner->mOnSuccessCallback_49; - if (runner->mIsFailureExpected_49 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7497,9 +6325,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_49; - delete runner->mOnSuccessCallback_49; - if (runner->mIsFailureExpected_49 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7511,32 +6336,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8S Max Value - typedef void (*SuccessCallback_50)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_50 = nullptr; - chip::Callback::Callback * mOnFailureCallback_50 = nullptr; - bool mIsFailureExpected_50 = 0; + using SuccessCallback_50 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_50{ + OnTestSendClusterTestClusterCommandReadAttribute_50_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_50{ + OnTestSendClusterTestClusterCommandReadAttribute_50_FailureResponse, this + }; + bool mIsFailureExpected_50 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_50() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8S Max Value: Sending command..."); - mOnFailureCallback_50 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_50_FailureResponse, this); - mOnSuccessCallback_50 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_50_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8s(mOnSuccessCallback_50->Cancel(), mOnFailureCallback_50->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_50; - delete mOnSuccessCallback_50; - } + err = cluster.ReadAttributeInt8s(mOnSuccessCallback_50.Cancel(), mOnFailureCallback_50.Cancel()); return err; } @@ -7547,9 +6365,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_50; - delete runner->mOnSuccessCallback_50; - if (runner->mIsFailureExpected_50 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7566,9 +6381,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_50; - delete runner->mOnSuccessCallback_50; - if (runner->mIsFailureExpected_50 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7587,33 +6399,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT8S Min Value - typedef void (*SuccessCallback_51)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_51 = nullptr; - chip::Callback::Callback * mOnFailureCallback_51 = nullptr; - bool mIsFailureExpected_51 = 0; + using SuccessCallback_51 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_51{ + OnTestSendClusterTestClusterCommandWriteAttribute_51_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_51{ + OnTestSendClusterTestClusterCommandWriteAttribute_51_FailureResponse, this + }; + bool mIsFailureExpected_51 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_51() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT8S Min Value: Sending command..."); - mOnFailureCallback_51 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_51_FailureResponse, this); - mOnSuccessCallback_51 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_51_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int8_t int8sArgument = -128; - err = cluster.WriteAttributeInt8s(mOnSuccessCallback_51->Cancel(), mOnFailureCallback_51->Cancel(), int8sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_51; - delete mOnSuccessCallback_51; - } + err = cluster.WriteAttributeInt8s(mOnSuccessCallback_51.Cancel(), mOnFailureCallback_51.Cancel(), int8sArgument); return err; } @@ -7624,9 +6429,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_51; - delete runner->mOnSuccessCallback_51; - if (runner->mIsFailureExpected_51 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7643,9 +6445,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_51; - delete runner->mOnSuccessCallback_51; - if (runner->mIsFailureExpected_51 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7657,32 +6456,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8S Min Value - typedef void (*SuccessCallback_52)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_52 = nullptr; - chip::Callback::Callback * mOnFailureCallback_52 = nullptr; - bool mIsFailureExpected_52 = 0; + using SuccessCallback_52 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_52{ + OnTestSendClusterTestClusterCommandReadAttribute_52_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_52{ + OnTestSendClusterTestClusterCommandReadAttribute_52_FailureResponse, this + }; + bool mIsFailureExpected_52 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_52() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8S Min Value: Sending command..."); - mOnFailureCallback_52 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_52_FailureResponse, this); - mOnSuccessCallback_52 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_52_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8s(mOnSuccessCallback_52->Cancel(), mOnFailureCallback_52->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_52; - delete mOnSuccessCallback_52; - } + err = cluster.ReadAttributeInt8s(mOnSuccessCallback_52.Cancel(), mOnFailureCallback_52.Cancel()); return err; } @@ -7693,9 +6485,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_52; - delete runner->mOnSuccessCallback_52; - if (runner->mIsFailureExpected_52 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7712,9 +6501,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_52; - delete runner->mOnSuccessCallback_52; - if (runner->mIsFailureExpected_52 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7733,33 +6519,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT8S Default Value - typedef void (*SuccessCallback_53)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_53 = nullptr; - chip::Callback::Callback * mOnFailureCallback_53 = nullptr; - bool mIsFailureExpected_53 = 0; + using SuccessCallback_53 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_53{ + OnTestSendClusterTestClusterCommandWriteAttribute_53_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_53{ + OnTestSendClusterTestClusterCommandWriteAttribute_53_FailureResponse, this + }; + bool mIsFailureExpected_53 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_53() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT8S Default Value: Sending command..."); - mOnFailureCallback_53 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_53_FailureResponse, this); - mOnSuccessCallback_53 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_53_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int8_t int8sArgument = 0; - err = cluster.WriteAttributeInt8s(mOnSuccessCallback_53->Cancel(), mOnFailureCallback_53->Cancel(), int8sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_53; - delete mOnSuccessCallback_53; - } + err = cluster.WriteAttributeInt8s(mOnSuccessCallback_53.Cancel(), mOnFailureCallback_53.Cancel(), int8sArgument); return err; } @@ -7770,9 +6549,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_53; - delete runner->mOnSuccessCallback_53; - if (runner->mIsFailureExpected_53 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7789,9 +6565,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_53; - delete runner->mOnSuccessCallback_53; - if (runner->mIsFailureExpected_53 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7803,32 +6576,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT8S Default Value - typedef void (*SuccessCallback_54)(void * context, int8_t int8s); - chip::Callback::Callback * mOnSuccessCallback_54 = nullptr; - chip::Callback::Callback * mOnFailureCallback_54 = nullptr; - bool mIsFailureExpected_54 = 0; + using SuccessCallback_54 = void (*)(void * context, int8_t int8s); + chip::Callback::Callback mOnSuccessCallback_54{ + OnTestSendClusterTestClusterCommandReadAttribute_54_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_54{ + OnTestSendClusterTestClusterCommandReadAttribute_54_FailureResponse, this + }; + bool mIsFailureExpected_54 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_54() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT8S Default Value: Sending command..."); - mOnFailureCallback_54 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_54_FailureResponse, this); - mOnSuccessCallback_54 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_54_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt8s(mOnSuccessCallback_54->Cancel(), mOnFailureCallback_54->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_54; - delete mOnSuccessCallback_54; - } + err = cluster.ReadAttributeInt8s(mOnSuccessCallback_54.Cancel(), mOnFailureCallback_54.Cancel()); return err; } @@ -7839,9 +6605,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_54; - delete runner->mOnSuccessCallback_54; - if (runner->mIsFailureExpected_54 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7858,9 +6621,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_54; - delete runner->mOnSuccessCallback_54; - if (runner->mIsFailureExpected_54 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7879,32 +6639,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16S Default Value - typedef void (*SuccessCallback_55)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_55 = nullptr; - chip::Callback::Callback * mOnFailureCallback_55 = nullptr; - bool mIsFailureExpected_55 = 0; + using SuccessCallback_55 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_55{ + OnTestSendClusterTestClusterCommandReadAttribute_55_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_55{ + OnTestSendClusterTestClusterCommandReadAttribute_55_FailureResponse, this + }; + bool mIsFailureExpected_55 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_55() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16S Default Value: Sending command..."); - mOnFailureCallback_55 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_55_FailureResponse, this); - mOnSuccessCallback_55 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_55_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16s(mOnSuccessCallback_55->Cancel(), mOnFailureCallback_55->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_55; - delete mOnSuccessCallback_55; - } + err = cluster.ReadAttributeInt16s(mOnSuccessCallback_55.Cancel(), mOnFailureCallback_55.Cancel()); return err; } @@ -7915,9 +6668,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_55; - delete runner->mOnSuccessCallback_55; - if (runner->mIsFailureExpected_55 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -7934,9 +6684,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_55; - delete runner->mOnSuccessCallback_55; - if (runner->mIsFailureExpected_55 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -7955,33 +6702,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT16S Max Value - typedef void (*SuccessCallback_56)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_56 = nullptr; - chip::Callback::Callback * mOnFailureCallback_56 = nullptr; - bool mIsFailureExpected_56 = 0; + using SuccessCallback_56 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_56{ + OnTestSendClusterTestClusterCommandWriteAttribute_56_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_56{ + OnTestSendClusterTestClusterCommandWriteAttribute_56_FailureResponse, this + }; + bool mIsFailureExpected_56 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_56() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT16S Max Value: Sending command..."); - mOnFailureCallback_56 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_56_FailureResponse, this); - mOnSuccessCallback_56 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_56_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int16_t int16sArgument = 32767; - err = cluster.WriteAttributeInt16s(mOnSuccessCallback_56->Cancel(), mOnFailureCallback_56->Cancel(), int16sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_56; - delete mOnSuccessCallback_56; - } + err = cluster.WriteAttributeInt16s(mOnSuccessCallback_56.Cancel(), mOnFailureCallback_56.Cancel(), int16sArgument); return err; } @@ -7992,9 +6732,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_56; - delete runner->mOnSuccessCallback_56; - if (runner->mIsFailureExpected_56 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8011,9 +6748,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_56; - delete runner->mOnSuccessCallback_56; - if (runner->mIsFailureExpected_56 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8025,32 +6759,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16S Max Value - typedef void (*SuccessCallback_57)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_57 = nullptr; - chip::Callback::Callback * mOnFailureCallback_57 = nullptr; - bool mIsFailureExpected_57 = 0; + using SuccessCallback_57 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_57{ + OnTestSendClusterTestClusterCommandReadAttribute_57_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_57{ + OnTestSendClusterTestClusterCommandReadAttribute_57_FailureResponse, this + }; + bool mIsFailureExpected_57 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_57() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16S Max Value: Sending command..."); - mOnFailureCallback_57 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_57_FailureResponse, this); - mOnSuccessCallback_57 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_57_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16s(mOnSuccessCallback_57->Cancel(), mOnFailureCallback_57->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_57; - delete mOnSuccessCallback_57; - } + err = cluster.ReadAttributeInt16s(mOnSuccessCallback_57.Cancel(), mOnFailureCallback_57.Cancel()); return err; } @@ -8061,9 +6788,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_57; - delete runner->mOnSuccessCallback_57; - if (runner->mIsFailureExpected_57 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8080,9 +6804,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_57; - delete runner->mOnSuccessCallback_57; - if (runner->mIsFailureExpected_57 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8101,33 +6822,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT16S Min Value - typedef void (*SuccessCallback_58)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_58 = nullptr; - chip::Callback::Callback * mOnFailureCallback_58 = nullptr; - bool mIsFailureExpected_58 = 0; + using SuccessCallback_58 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_58{ + OnTestSendClusterTestClusterCommandWriteAttribute_58_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_58{ + OnTestSendClusterTestClusterCommandWriteAttribute_58_FailureResponse, this + }; + bool mIsFailureExpected_58 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_58() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT16S Min Value: Sending command..."); - mOnFailureCallback_58 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_58_FailureResponse, this); - mOnSuccessCallback_58 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_58_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int16_t int16sArgument = -32768; - err = cluster.WriteAttributeInt16s(mOnSuccessCallback_58->Cancel(), mOnFailureCallback_58->Cancel(), int16sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_58; - delete mOnSuccessCallback_58; - } + err = cluster.WriteAttributeInt16s(mOnSuccessCallback_58.Cancel(), mOnFailureCallback_58.Cancel(), int16sArgument); return err; } @@ -8138,9 +6852,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_58; - delete runner->mOnSuccessCallback_58; - if (runner->mIsFailureExpected_58 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8157,9 +6868,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_58; - delete runner->mOnSuccessCallback_58; - if (runner->mIsFailureExpected_58 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8171,32 +6879,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16S Min Value - typedef void (*SuccessCallback_59)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_59 = nullptr; - chip::Callback::Callback * mOnFailureCallback_59 = nullptr; - bool mIsFailureExpected_59 = 0; + using SuccessCallback_59 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_59{ + OnTestSendClusterTestClusterCommandReadAttribute_59_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_59{ + OnTestSendClusterTestClusterCommandReadAttribute_59_FailureResponse, this + }; + bool mIsFailureExpected_59 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_59() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16S Min Value: Sending command..."); - mOnFailureCallback_59 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_59_FailureResponse, this); - mOnSuccessCallback_59 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_59_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16s(mOnSuccessCallback_59->Cancel(), mOnFailureCallback_59->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_59; - delete mOnSuccessCallback_59; - } + err = cluster.ReadAttributeInt16s(mOnSuccessCallback_59.Cancel(), mOnFailureCallback_59.Cancel()); return err; } @@ -8207,9 +6908,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_59; - delete runner->mOnSuccessCallback_59; - if (runner->mIsFailureExpected_59 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8226,9 +6924,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_59; - delete runner->mOnSuccessCallback_59; - if (runner->mIsFailureExpected_59 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8247,33 +6942,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT16S Default Value - typedef void (*SuccessCallback_60)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_60 = nullptr; - chip::Callback::Callback * mOnFailureCallback_60 = nullptr; - bool mIsFailureExpected_60 = 0; + using SuccessCallback_60 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_60{ + OnTestSendClusterTestClusterCommandWriteAttribute_60_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_60{ + OnTestSendClusterTestClusterCommandWriteAttribute_60_FailureResponse, this + }; + bool mIsFailureExpected_60 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_60() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT16S Default Value: Sending command..."); - mOnFailureCallback_60 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_60_FailureResponse, this); - mOnSuccessCallback_60 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_60_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int16_t int16sArgument = 0; - err = cluster.WriteAttributeInt16s(mOnSuccessCallback_60->Cancel(), mOnFailureCallback_60->Cancel(), int16sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_60; - delete mOnSuccessCallback_60; - } + err = cluster.WriteAttributeInt16s(mOnSuccessCallback_60.Cancel(), mOnFailureCallback_60.Cancel(), int16sArgument); return err; } @@ -8284,9 +6972,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_60; - delete runner->mOnSuccessCallback_60; - if (runner->mIsFailureExpected_60 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8303,9 +6988,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_60; - delete runner->mOnSuccessCallback_60; - if (runner->mIsFailureExpected_60 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8317,32 +6999,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT16S Default Value - typedef void (*SuccessCallback_61)(void * context, int16_t int16s); - chip::Callback::Callback * mOnSuccessCallback_61 = nullptr; - chip::Callback::Callback * mOnFailureCallback_61 = nullptr; - bool mIsFailureExpected_61 = 0; + using SuccessCallback_61 = void (*)(void * context, int16_t int16s); + chip::Callback::Callback mOnSuccessCallback_61{ + OnTestSendClusterTestClusterCommandReadAttribute_61_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_61{ + OnTestSendClusterTestClusterCommandReadAttribute_61_FailureResponse, this + }; + bool mIsFailureExpected_61 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_61() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT16S Default Value: Sending command..."); - mOnFailureCallback_61 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_61_FailureResponse, this); - mOnSuccessCallback_61 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_61_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt16s(mOnSuccessCallback_61->Cancel(), mOnFailureCallback_61->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_61; - delete mOnSuccessCallback_61; - } + err = cluster.ReadAttributeInt16s(mOnSuccessCallback_61.Cancel(), mOnFailureCallback_61.Cancel()); return err; } @@ -8353,9 +7028,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_61; - delete runner->mOnSuccessCallback_61; - if (runner->mIsFailureExpected_61 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8372,9 +7044,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_61; - delete runner->mOnSuccessCallback_61; - if (runner->mIsFailureExpected_61 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8393,32 +7062,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32S Default Value - typedef void (*SuccessCallback_62)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_62 = nullptr; - chip::Callback::Callback * mOnFailureCallback_62 = nullptr; - bool mIsFailureExpected_62 = 0; + using SuccessCallback_62 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_62{ + OnTestSendClusterTestClusterCommandReadAttribute_62_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_62{ + OnTestSendClusterTestClusterCommandReadAttribute_62_FailureResponse, this + }; + bool mIsFailureExpected_62 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_62() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32S Default Value: Sending command..."); - mOnFailureCallback_62 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_62_FailureResponse, this); - mOnSuccessCallback_62 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_62_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32s(mOnSuccessCallback_62->Cancel(), mOnFailureCallback_62->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_62; - delete mOnSuccessCallback_62; - } + err = cluster.ReadAttributeInt32s(mOnSuccessCallback_62.Cancel(), mOnFailureCallback_62.Cancel()); return err; } @@ -8429,9 +7091,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_62; - delete runner->mOnSuccessCallback_62; - if (runner->mIsFailureExpected_62 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8448,9 +7107,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_62; - delete runner->mOnSuccessCallback_62; - if (runner->mIsFailureExpected_62 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8469,33 +7125,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT32S Max Value - typedef void (*SuccessCallback_63)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_63 = nullptr; - chip::Callback::Callback * mOnFailureCallback_63 = nullptr; - bool mIsFailureExpected_63 = 0; + using SuccessCallback_63 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_63{ + OnTestSendClusterTestClusterCommandWriteAttribute_63_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_63{ + OnTestSendClusterTestClusterCommandWriteAttribute_63_FailureResponse, this + }; + bool mIsFailureExpected_63 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_63() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT32S Max Value: Sending command..."); - mOnFailureCallback_63 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_63_FailureResponse, this); - mOnSuccessCallback_63 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_63_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int32_t int32sArgument = 2147483647L; - err = cluster.WriteAttributeInt32s(mOnSuccessCallback_63->Cancel(), mOnFailureCallback_63->Cancel(), int32sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_63; - delete mOnSuccessCallback_63; - } + err = cluster.WriteAttributeInt32s(mOnSuccessCallback_63.Cancel(), mOnFailureCallback_63.Cancel(), int32sArgument); return err; } @@ -8506,9 +7155,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_63; - delete runner->mOnSuccessCallback_63; - if (runner->mIsFailureExpected_63 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8525,9 +7171,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_63; - delete runner->mOnSuccessCallback_63; - if (runner->mIsFailureExpected_63 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8539,32 +7182,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32S Max Value - typedef void (*SuccessCallback_64)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_64 = nullptr; - chip::Callback::Callback * mOnFailureCallback_64 = nullptr; - bool mIsFailureExpected_64 = 0; + using SuccessCallback_64 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_64{ + OnTestSendClusterTestClusterCommandReadAttribute_64_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_64{ + OnTestSendClusterTestClusterCommandReadAttribute_64_FailureResponse, this + }; + bool mIsFailureExpected_64 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_64() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32S Max Value: Sending command..."); - mOnFailureCallback_64 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_64_FailureResponse, this); - mOnSuccessCallback_64 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_64_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32s(mOnSuccessCallback_64->Cancel(), mOnFailureCallback_64->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_64; - delete mOnSuccessCallback_64; - } + err = cluster.ReadAttributeInt32s(mOnSuccessCallback_64.Cancel(), mOnFailureCallback_64.Cancel()); return err; } @@ -8575,9 +7211,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_64; - delete runner->mOnSuccessCallback_64; - if (runner->mIsFailureExpected_64 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8594,9 +7227,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_64; - delete runner->mOnSuccessCallback_64; - if (runner->mIsFailureExpected_64 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8615,33 +7245,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT32S Min Value - typedef void (*SuccessCallback_65)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_65 = nullptr; - chip::Callback::Callback * mOnFailureCallback_65 = nullptr; - bool mIsFailureExpected_65 = 0; + using SuccessCallback_65 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_65{ + OnTestSendClusterTestClusterCommandWriteAttribute_65_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_65{ + OnTestSendClusterTestClusterCommandWriteAttribute_65_FailureResponse, this + }; + bool mIsFailureExpected_65 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_65() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT32S Min Value: Sending command..."); - mOnFailureCallback_65 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_65_FailureResponse, this); - mOnSuccessCallback_65 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_65_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int32_t int32sArgument = -2147483648L; - err = cluster.WriteAttributeInt32s(mOnSuccessCallback_65->Cancel(), mOnFailureCallback_65->Cancel(), int32sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_65; - delete mOnSuccessCallback_65; - } + err = cluster.WriteAttributeInt32s(mOnSuccessCallback_65.Cancel(), mOnFailureCallback_65.Cancel(), int32sArgument); return err; } @@ -8652,9 +7275,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_65; - delete runner->mOnSuccessCallback_65; - if (runner->mIsFailureExpected_65 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8671,9 +7291,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_65; - delete runner->mOnSuccessCallback_65; - if (runner->mIsFailureExpected_65 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8685,32 +7302,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32S Min Value - typedef void (*SuccessCallback_66)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_66 = nullptr; - chip::Callback::Callback * mOnFailureCallback_66 = nullptr; - bool mIsFailureExpected_66 = 0; + using SuccessCallback_66 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_66{ + OnTestSendClusterTestClusterCommandReadAttribute_66_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_66{ + OnTestSendClusterTestClusterCommandReadAttribute_66_FailureResponse, this + }; + bool mIsFailureExpected_66 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_66() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32S Min Value: Sending command..."); - mOnFailureCallback_66 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_66_FailureResponse, this); - mOnSuccessCallback_66 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_66_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32s(mOnSuccessCallback_66->Cancel(), mOnFailureCallback_66->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_66; - delete mOnSuccessCallback_66; - } + err = cluster.ReadAttributeInt32s(mOnSuccessCallback_66.Cancel(), mOnFailureCallback_66.Cancel()); return err; } @@ -8721,9 +7331,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_66; - delete runner->mOnSuccessCallback_66; - if (runner->mIsFailureExpected_66 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8740,9 +7347,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_66; - delete runner->mOnSuccessCallback_66; - if (runner->mIsFailureExpected_66 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8761,33 +7365,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT32S Default Value - typedef void (*SuccessCallback_67)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_67 = nullptr; - chip::Callback::Callback * mOnFailureCallback_67 = nullptr; - bool mIsFailureExpected_67 = 0; + using SuccessCallback_67 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_67{ + OnTestSendClusterTestClusterCommandWriteAttribute_67_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_67{ + OnTestSendClusterTestClusterCommandWriteAttribute_67_FailureResponse, this + }; + bool mIsFailureExpected_67 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_67() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT32S Default Value: Sending command..."); - mOnFailureCallback_67 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_67_FailureResponse, this); - mOnSuccessCallback_67 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_67_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int32_t int32sArgument = 0L; - err = cluster.WriteAttributeInt32s(mOnSuccessCallback_67->Cancel(), mOnFailureCallback_67->Cancel(), int32sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_67; - delete mOnSuccessCallback_67; - } + err = cluster.WriteAttributeInt32s(mOnSuccessCallback_67.Cancel(), mOnFailureCallback_67.Cancel(), int32sArgument); return err; } @@ -8798,9 +7395,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_67; - delete runner->mOnSuccessCallback_67; - if (runner->mIsFailureExpected_67 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8817,9 +7411,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_67; - delete runner->mOnSuccessCallback_67; - if (runner->mIsFailureExpected_67 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8831,32 +7422,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT32S Default Value - typedef void (*SuccessCallback_68)(void * context, int32_t int32s); - chip::Callback::Callback * mOnSuccessCallback_68 = nullptr; - chip::Callback::Callback * mOnFailureCallback_68 = nullptr; - bool mIsFailureExpected_68 = 0; + using SuccessCallback_68 = void (*)(void * context, int32_t int32s); + chip::Callback::Callback mOnSuccessCallback_68{ + OnTestSendClusterTestClusterCommandReadAttribute_68_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_68{ + OnTestSendClusterTestClusterCommandReadAttribute_68_FailureResponse, this + }; + bool mIsFailureExpected_68 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_68() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT32S Default Value: Sending command..."); - mOnFailureCallback_68 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_68_FailureResponse, this); - mOnSuccessCallback_68 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_68_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt32s(mOnSuccessCallback_68->Cancel(), mOnFailureCallback_68->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_68; - delete mOnSuccessCallback_68; - } + err = cluster.ReadAttributeInt32s(mOnSuccessCallback_68.Cancel(), mOnFailureCallback_68.Cancel()); return err; } @@ -8867,9 +7451,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_68; - delete runner->mOnSuccessCallback_68; - if (runner->mIsFailureExpected_68 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8886,9 +7467,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_68; - delete runner->mOnSuccessCallback_68; - if (runner->mIsFailureExpected_68 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8907,32 +7485,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64S Default Value - typedef void (*SuccessCallback_69)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_69 = nullptr; - chip::Callback::Callback * mOnFailureCallback_69 = nullptr; - bool mIsFailureExpected_69 = 0; + using SuccessCallback_69 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_69{ + OnTestSendClusterTestClusterCommandReadAttribute_69_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_69{ + OnTestSendClusterTestClusterCommandReadAttribute_69_FailureResponse, this + }; + bool mIsFailureExpected_69 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_69() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64S Default Value: Sending command..."); - mOnFailureCallback_69 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_69_FailureResponse, this); - mOnSuccessCallback_69 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_69_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64s(mOnSuccessCallback_69->Cancel(), mOnFailureCallback_69->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_69; - delete mOnSuccessCallback_69; - } + err = cluster.ReadAttributeInt64s(mOnSuccessCallback_69.Cancel(), mOnFailureCallback_69.Cancel()); return err; } @@ -8943,9 +7514,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_69; - delete runner->mOnSuccessCallback_69; - if (runner->mIsFailureExpected_69 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -8962,9 +7530,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_69; - delete runner->mOnSuccessCallback_69; - if (runner->mIsFailureExpected_69 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -8983,33 +7548,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT64S Max Value - typedef void (*SuccessCallback_70)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_70 = nullptr; - chip::Callback::Callback * mOnFailureCallback_70 = nullptr; - bool mIsFailureExpected_70 = 0; + using SuccessCallback_70 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_70{ + OnTestSendClusterTestClusterCommandWriteAttribute_70_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_70{ + OnTestSendClusterTestClusterCommandWriteAttribute_70_FailureResponse, this + }; + bool mIsFailureExpected_70 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_70() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT64S Max Value: Sending command..."); - mOnFailureCallback_70 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_70_FailureResponse, this); - mOnSuccessCallback_70 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_70_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int64_t int64sArgument = 9223372036854775807LL; - err = cluster.WriteAttributeInt64s(mOnSuccessCallback_70->Cancel(), mOnFailureCallback_70->Cancel(), int64sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_70; - delete mOnSuccessCallback_70; - } + err = cluster.WriteAttributeInt64s(mOnSuccessCallback_70.Cancel(), mOnFailureCallback_70.Cancel(), int64sArgument); return err; } @@ -9020,9 +7578,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_70; - delete runner->mOnSuccessCallback_70; - if (runner->mIsFailureExpected_70 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9039,9 +7594,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_70; - delete runner->mOnSuccessCallback_70; - if (runner->mIsFailureExpected_70 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9053,32 +7605,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64S Max Value - typedef void (*SuccessCallback_71)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_71 = nullptr; - chip::Callback::Callback * mOnFailureCallback_71 = nullptr; - bool mIsFailureExpected_71 = 0; + using SuccessCallback_71 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_71{ + OnTestSendClusterTestClusterCommandReadAttribute_71_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_71{ + OnTestSendClusterTestClusterCommandReadAttribute_71_FailureResponse, this + }; + bool mIsFailureExpected_71 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_71() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64S Max Value: Sending command..."); - mOnFailureCallback_71 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_71_FailureResponse, this); - mOnSuccessCallback_71 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_71_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64s(mOnSuccessCallback_71->Cancel(), mOnFailureCallback_71->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_71; - delete mOnSuccessCallback_71; - } + err = cluster.ReadAttributeInt64s(mOnSuccessCallback_71.Cancel(), mOnFailureCallback_71.Cancel()); return err; } @@ -9089,9 +7634,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_71; - delete runner->mOnSuccessCallback_71; - if (runner->mIsFailureExpected_71 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9108,9 +7650,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_71; - delete runner->mOnSuccessCallback_71; - if (runner->mIsFailureExpected_71 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9129,33 +7668,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT64S Min Value - typedef void (*SuccessCallback_72)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_72 = nullptr; - chip::Callback::Callback * mOnFailureCallback_72 = nullptr; - bool mIsFailureExpected_72 = 0; + using SuccessCallback_72 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_72{ + OnTestSendClusterTestClusterCommandWriteAttribute_72_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_72{ + OnTestSendClusterTestClusterCommandWriteAttribute_72_FailureResponse, this + }; + bool mIsFailureExpected_72 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_72() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT64S Min Value: Sending command..."); - mOnFailureCallback_72 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_72_FailureResponse, this); - mOnSuccessCallback_72 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_72_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int64_t int64sArgument = -9223372036854775807LL; - err = cluster.WriteAttributeInt64s(mOnSuccessCallback_72->Cancel(), mOnFailureCallback_72->Cancel(), int64sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_72; - delete mOnSuccessCallback_72; - } + err = cluster.WriteAttributeInt64s(mOnSuccessCallback_72.Cancel(), mOnFailureCallback_72.Cancel(), int64sArgument); return err; } @@ -9166,9 +7698,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_72; - delete runner->mOnSuccessCallback_72; - if (runner->mIsFailureExpected_72 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9185,9 +7714,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_72; - delete runner->mOnSuccessCallback_72; - if (runner->mIsFailureExpected_72 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9199,32 +7725,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64S Min Value - typedef void (*SuccessCallback_73)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_73 = nullptr; - chip::Callback::Callback * mOnFailureCallback_73 = nullptr; - bool mIsFailureExpected_73 = 0; + using SuccessCallback_73 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_73{ + OnTestSendClusterTestClusterCommandReadAttribute_73_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_73{ + OnTestSendClusterTestClusterCommandReadAttribute_73_FailureResponse, this + }; + bool mIsFailureExpected_73 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_73() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64S Min Value: Sending command..."); - mOnFailureCallback_73 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_73_FailureResponse, this); - mOnSuccessCallback_73 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_73_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64s(mOnSuccessCallback_73->Cancel(), mOnFailureCallback_73->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_73; - delete mOnSuccessCallback_73; - } + err = cluster.ReadAttributeInt64s(mOnSuccessCallback_73.Cancel(), mOnFailureCallback_73.Cancel()); return err; } @@ -9235,9 +7754,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_73; - delete runner->mOnSuccessCallback_73; - if (runner->mIsFailureExpected_73 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9254,9 +7770,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_73; - delete runner->mOnSuccessCallback_73; - if (runner->mIsFailureExpected_73 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9275,33 +7788,26 @@ class TestCluster : public TestCommand } // Test Write attribute INT64S Default Value - typedef void (*SuccessCallback_74)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_74 = nullptr; - chip::Callback::Callback * mOnFailureCallback_74 = nullptr; - bool mIsFailureExpected_74 = 0; + using SuccessCallback_74 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_74{ + OnTestSendClusterTestClusterCommandWriteAttribute_74_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_74{ + OnTestSendClusterTestClusterCommandWriteAttribute_74_FailureResponse, this + }; + bool mIsFailureExpected_74 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_74() { ChipLogProgress(chipTool, "Test Cluster - Write attribute INT64S Default Value: Sending command..."); - mOnFailureCallback_74 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_74_FailureResponse, this); - mOnSuccessCallback_74 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_74_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; int64_t int64sArgument = 0LL; - err = cluster.WriteAttributeInt64s(mOnSuccessCallback_74->Cancel(), mOnFailureCallback_74->Cancel(), int64sArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_74; - delete mOnSuccessCallback_74; - } + err = cluster.WriteAttributeInt64s(mOnSuccessCallback_74.Cancel(), mOnFailureCallback_74.Cancel(), int64sArgument); return err; } @@ -9312,9 +7818,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_74; - delete runner->mOnSuccessCallback_74; - if (runner->mIsFailureExpected_74 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9331,9 +7834,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_74; - delete runner->mOnSuccessCallback_74; - if (runner->mIsFailureExpected_74 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9345,32 +7845,25 @@ class TestCluster : public TestCommand } // Test Read attribute INT64S Default Value - typedef void (*SuccessCallback_75)(void * context, int64_t int64s); - chip::Callback::Callback * mOnSuccessCallback_75 = nullptr; - chip::Callback::Callback * mOnFailureCallback_75 = nullptr; - bool mIsFailureExpected_75 = 0; + using SuccessCallback_75 = void (*)(void * context, int64_t int64s); + chip::Callback::Callback mOnSuccessCallback_75{ + OnTestSendClusterTestClusterCommandReadAttribute_75_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_75{ + OnTestSendClusterTestClusterCommandReadAttribute_75_FailureResponse, this + }; + bool mIsFailureExpected_75 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_75() { ChipLogProgress(chipTool, "Test Cluster - Read attribute INT64S Default Value: Sending command..."); - mOnFailureCallback_75 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_75_FailureResponse, this); - mOnSuccessCallback_75 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_75_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInt64s(mOnSuccessCallback_75->Cancel(), mOnFailureCallback_75->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_75; - delete mOnSuccessCallback_75; - } + err = cluster.ReadAttributeInt64s(mOnSuccessCallback_75.Cancel(), mOnFailureCallback_75.Cancel()); return err; } @@ -9381,9 +7874,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_75; - delete runner->mOnSuccessCallback_75; - if (runner->mIsFailureExpected_75 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9400,9 +7890,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_75; - delete runner->mOnSuccessCallback_75; - if (runner->mIsFailureExpected_75 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9421,32 +7908,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM8 Default Value - typedef void (*SuccessCallback_76)(void * context, uint8_t enum8); - chip::Callback::Callback * mOnSuccessCallback_76 = nullptr; - chip::Callback::Callback * mOnFailureCallback_76 = nullptr; - bool mIsFailureExpected_76 = 0; + using SuccessCallback_76 = void (*)(void * context, uint8_t enum8); + chip::Callback::Callback mOnSuccessCallback_76{ + OnTestSendClusterTestClusterCommandReadAttribute_76_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_76{ + OnTestSendClusterTestClusterCommandReadAttribute_76_FailureResponse, this + }; + bool mIsFailureExpected_76 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_76() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM8 Default Value: Sending command..."); - mOnFailureCallback_76 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_76_FailureResponse, this); - mOnSuccessCallback_76 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_76_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum8(mOnSuccessCallback_76->Cancel(), mOnFailureCallback_76->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_76; - delete mOnSuccessCallback_76; - } + err = cluster.ReadAttributeEnum8(mOnSuccessCallback_76.Cancel(), mOnFailureCallback_76.Cancel()); return err; } @@ -9457,9 +7937,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_76; - delete runner->mOnSuccessCallback_76; - if (runner->mIsFailureExpected_76 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9476,9 +7953,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_76; - delete runner->mOnSuccessCallback_76; - if (runner->mIsFailureExpected_76 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9497,33 +7971,26 @@ class TestCluster : public TestCommand } // Test Write attribute ENUM8 Max Value - typedef void (*SuccessCallback_77)(void * context, uint8_t enum8); - chip::Callback::Callback * mOnSuccessCallback_77 = nullptr; - chip::Callback::Callback * mOnFailureCallback_77 = nullptr; - bool mIsFailureExpected_77 = 0; + using SuccessCallback_77 = void (*)(void * context, uint8_t enum8); + chip::Callback::Callback mOnSuccessCallback_77{ + OnTestSendClusterTestClusterCommandWriteAttribute_77_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_77{ + OnTestSendClusterTestClusterCommandWriteAttribute_77_FailureResponse, this + }; + bool mIsFailureExpected_77 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_77() { ChipLogProgress(chipTool, "Test Cluster - Write attribute ENUM8 Max Value: Sending command..."); - mOnFailureCallback_77 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_77_FailureResponse, this); - mOnSuccessCallback_77 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_77_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t enum8Argument = 255; - err = cluster.WriteAttributeEnum8(mOnSuccessCallback_77->Cancel(), mOnFailureCallback_77->Cancel(), enum8Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_77; - delete mOnSuccessCallback_77; - } + err = cluster.WriteAttributeEnum8(mOnSuccessCallback_77.Cancel(), mOnFailureCallback_77.Cancel(), enum8Argument); return err; } @@ -9534,9 +8001,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_77; - delete runner->mOnSuccessCallback_77; - if (runner->mIsFailureExpected_77 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9553,9 +8017,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_77; - delete runner->mOnSuccessCallback_77; - if (runner->mIsFailureExpected_77 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9567,32 +8028,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM8 Max Value - typedef void (*SuccessCallback_78)(void * context, uint8_t enum8); - chip::Callback::Callback * mOnSuccessCallback_78 = nullptr; - chip::Callback::Callback * mOnFailureCallback_78 = nullptr; - bool mIsFailureExpected_78 = 0; + using SuccessCallback_78 = void (*)(void * context, uint8_t enum8); + chip::Callback::Callback mOnSuccessCallback_78{ + OnTestSendClusterTestClusterCommandReadAttribute_78_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_78{ + OnTestSendClusterTestClusterCommandReadAttribute_78_FailureResponse, this + }; + bool mIsFailureExpected_78 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_78() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM8 Max Value: Sending command..."); - mOnFailureCallback_78 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_78_FailureResponse, this); - mOnSuccessCallback_78 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_78_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum8(mOnSuccessCallback_78->Cancel(), mOnFailureCallback_78->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_78; - delete mOnSuccessCallback_78; - } + err = cluster.ReadAttributeEnum8(mOnSuccessCallback_78.Cancel(), mOnFailureCallback_78.Cancel()); return err; } @@ -9603,9 +8057,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_78; - delete runner->mOnSuccessCallback_78; - if (runner->mIsFailureExpected_78 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9622,9 +8073,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_78; - delete runner->mOnSuccessCallback_78; - if (runner->mIsFailureExpected_78 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9643,33 +8091,26 @@ class TestCluster : public TestCommand } // Test Write attribute ENUM8 Min Value - typedef void (*SuccessCallback_79)(void * context, uint8_t enum8); - chip::Callback::Callback * mOnSuccessCallback_79 = nullptr; - chip::Callback::Callback * mOnFailureCallback_79 = nullptr; - bool mIsFailureExpected_79 = 0; + using SuccessCallback_79 = void (*)(void * context, uint8_t enum8); + chip::Callback::Callback mOnSuccessCallback_79{ + OnTestSendClusterTestClusterCommandWriteAttribute_79_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_79{ + OnTestSendClusterTestClusterCommandWriteAttribute_79_FailureResponse, this + }; + bool mIsFailureExpected_79 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_79() { ChipLogProgress(chipTool, "Test Cluster - Write attribute ENUM8 Min Value: Sending command..."); - mOnFailureCallback_79 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_79_FailureResponse, this); - mOnSuccessCallback_79 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_79_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t enum8Argument = 0; - err = cluster.WriteAttributeEnum8(mOnSuccessCallback_79->Cancel(), mOnFailureCallback_79->Cancel(), enum8Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_79; - delete mOnSuccessCallback_79; - } + err = cluster.WriteAttributeEnum8(mOnSuccessCallback_79.Cancel(), mOnFailureCallback_79.Cancel(), enum8Argument); return err; } @@ -9680,9 +8121,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_79; - delete runner->mOnSuccessCallback_79; - if (runner->mIsFailureExpected_79 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9699,9 +8137,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_79; - delete runner->mOnSuccessCallback_79; - if (runner->mIsFailureExpected_79 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9713,32 +8148,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM8 Min Value - typedef void (*SuccessCallback_80)(void * context, uint8_t enum8); - chip::Callback::Callback * mOnSuccessCallback_80 = nullptr; - chip::Callback::Callback * mOnFailureCallback_80 = nullptr; - bool mIsFailureExpected_80 = 0; + using SuccessCallback_80 = void (*)(void * context, uint8_t enum8); + chip::Callback::Callback mOnSuccessCallback_80{ + OnTestSendClusterTestClusterCommandReadAttribute_80_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_80{ + OnTestSendClusterTestClusterCommandReadAttribute_80_FailureResponse, this + }; + bool mIsFailureExpected_80 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_80() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM8 Min Value: Sending command..."); - mOnFailureCallback_80 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_80_FailureResponse, this); - mOnSuccessCallback_80 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_80_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum8(mOnSuccessCallback_80->Cancel(), mOnFailureCallback_80->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_80; - delete mOnSuccessCallback_80; - } + err = cluster.ReadAttributeEnum8(mOnSuccessCallback_80.Cancel(), mOnFailureCallback_80.Cancel()); return err; } @@ -9749,9 +8177,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_80; - delete runner->mOnSuccessCallback_80; - if (runner->mIsFailureExpected_80 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9768,9 +8193,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_80; - delete runner->mOnSuccessCallback_80; - if (runner->mIsFailureExpected_80 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9789,32 +8211,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM16 Default Value - typedef void (*SuccessCallback_81)(void * context, uint16_t enum16); - chip::Callback::Callback * mOnSuccessCallback_81 = nullptr; - chip::Callback::Callback * mOnFailureCallback_81 = nullptr; - bool mIsFailureExpected_81 = 0; + using SuccessCallback_81 = void (*)(void * context, uint16_t enum16); + chip::Callback::Callback mOnSuccessCallback_81{ + OnTestSendClusterTestClusterCommandReadAttribute_81_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_81{ + OnTestSendClusterTestClusterCommandReadAttribute_81_FailureResponse, this + }; + bool mIsFailureExpected_81 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_81() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM16 Default Value: Sending command..."); - mOnFailureCallback_81 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_81_FailureResponse, this); - mOnSuccessCallback_81 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_81_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum16(mOnSuccessCallback_81->Cancel(), mOnFailureCallback_81->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_81; - delete mOnSuccessCallback_81; - } + err = cluster.ReadAttributeEnum16(mOnSuccessCallback_81.Cancel(), mOnFailureCallback_81.Cancel()); return err; } @@ -9825,9 +8240,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_81; - delete runner->mOnSuccessCallback_81; - if (runner->mIsFailureExpected_81 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9844,9 +8256,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_81; - delete runner->mOnSuccessCallback_81; - if (runner->mIsFailureExpected_81 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9865,33 +8274,26 @@ class TestCluster : public TestCommand } // Test Write attribute ENUM16 Max Value - typedef void (*SuccessCallback_82)(void * context, uint16_t enum16); - chip::Callback::Callback * mOnSuccessCallback_82 = nullptr; - chip::Callback::Callback * mOnFailureCallback_82 = nullptr; - bool mIsFailureExpected_82 = 0; + using SuccessCallback_82 = void (*)(void * context, uint16_t enum16); + chip::Callback::Callback mOnSuccessCallback_82{ + OnTestSendClusterTestClusterCommandWriteAttribute_82_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_82{ + OnTestSendClusterTestClusterCommandWriteAttribute_82_FailureResponse, this + }; + bool mIsFailureExpected_82 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_82() { ChipLogProgress(chipTool, "Test Cluster - Write attribute ENUM16 Max Value: Sending command..."); - mOnFailureCallback_82 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_82_FailureResponse, this); - mOnSuccessCallback_82 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_82_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t enum16Argument = 65535U; - err = cluster.WriteAttributeEnum16(mOnSuccessCallback_82->Cancel(), mOnFailureCallback_82->Cancel(), enum16Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_82; - delete mOnSuccessCallback_82; - } + err = cluster.WriteAttributeEnum16(mOnSuccessCallback_82.Cancel(), mOnFailureCallback_82.Cancel(), enum16Argument); return err; } @@ -9902,9 +8304,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_82; - delete runner->mOnSuccessCallback_82; - if (runner->mIsFailureExpected_82 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9921,9 +8320,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_82; - delete runner->mOnSuccessCallback_82; - if (runner->mIsFailureExpected_82 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -9935,32 +8331,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM16 Max Value - typedef void (*SuccessCallback_83)(void * context, uint16_t enum16); - chip::Callback::Callback * mOnSuccessCallback_83 = nullptr; - chip::Callback::Callback * mOnFailureCallback_83 = nullptr; - bool mIsFailureExpected_83 = 0; + using SuccessCallback_83 = void (*)(void * context, uint16_t enum16); + chip::Callback::Callback mOnSuccessCallback_83{ + OnTestSendClusterTestClusterCommandReadAttribute_83_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_83{ + OnTestSendClusterTestClusterCommandReadAttribute_83_FailureResponse, this + }; + bool mIsFailureExpected_83 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_83() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM16 Max Value: Sending command..."); - mOnFailureCallback_83 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_83_FailureResponse, this); - mOnSuccessCallback_83 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_83_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum16(mOnSuccessCallback_83->Cancel(), mOnFailureCallback_83->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_83; - delete mOnSuccessCallback_83; - } + err = cluster.ReadAttributeEnum16(mOnSuccessCallback_83.Cancel(), mOnFailureCallback_83.Cancel()); return err; } @@ -9971,9 +8360,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_83; - delete runner->mOnSuccessCallback_83; - if (runner->mIsFailureExpected_83 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -9990,9 +8376,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_83; - delete runner->mOnSuccessCallback_83; - if (runner->mIsFailureExpected_83 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10011,33 +8394,26 @@ class TestCluster : public TestCommand } // Test Write attribute ENUM16 Min Value - typedef void (*SuccessCallback_84)(void * context, uint16_t enum16); - chip::Callback::Callback * mOnSuccessCallback_84 = nullptr; - chip::Callback::Callback * mOnFailureCallback_84 = nullptr; - bool mIsFailureExpected_84 = 0; + using SuccessCallback_84 = void (*)(void * context, uint16_t enum16); + chip::Callback::Callback mOnSuccessCallback_84{ + OnTestSendClusterTestClusterCommandWriteAttribute_84_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_84{ + OnTestSendClusterTestClusterCommandWriteAttribute_84_FailureResponse, this + }; + bool mIsFailureExpected_84 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_84() { ChipLogProgress(chipTool, "Test Cluster - Write attribute ENUM16 Min Value: Sending command..."); - mOnFailureCallback_84 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_84_FailureResponse, this); - mOnSuccessCallback_84 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_84_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t enum16Argument = 0U; - err = cluster.WriteAttributeEnum16(mOnSuccessCallback_84->Cancel(), mOnFailureCallback_84->Cancel(), enum16Argument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_84; - delete mOnSuccessCallback_84; - } + err = cluster.WriteAttributeEnum16(mOnSuccessCallback_84.Cancel(), mOnFailureCallback_84.Cancel(), enum16Argument); return err; } @@ -10048,9 +8424,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_84; - delete runner->mOnSuccessCallback_84; - if (runner->mIsFailureExpected_84 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10067,9 +8440,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_84; - delete runner->mOnSuccessCallback_84; - if (runner->mIsFailureExpected_84 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10081,32 +8451,25 @@ class TestCluster : public TestCommand } // Test Read attribute ENUM16 Min Value - typedef void (*SuccessCallback_85)(void * context, uint16_t enum16); - chip::Callback::Callback * mOnSuccessCallback_85 = nullptr; - chip::Callback::Callback * mOnFailureCallback_85 = nullptr; - bool mIsFailureExpected_85 = 0; + using SuccessCallback_85 = void (*)(void * context, uint16_t enum16); + chip::Callback::Callback mOnSuccessCallback_85{ + OnTestSendClusterTestClusterCommandReadAttribute_85_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_85{ + OnTestSendClusterTestClusterCommandReadAttribute_85_FailureResponse, this + }; + bool mIsFailureExpected_85 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_85() { ChipLogProgress(chipTool, "Test Cluster - Read attribute ENUM16 Min Value: Sending command..."); - mOnFailureCallback_85 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_85_FailureResponse, this); - mOnSuccessCallback_85 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_85_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeEnum16(mOnSuccessCallback_85->Cancel(), mOnFailureCallback_85->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_85; - delete mOnSuccessCallback_85; - } + err = cluster.ReadAttributeEnum16(mOnSuccessCallback_85.Cancel(), mOnFailureCallback_85.Cancel()); return err; } @@ -10117,9 +8480,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_85; - delete runner->mOnSuccessCallback_85; - if (runner->mIsFailureExpected_85 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10136,9 +8496,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_85; - delete runner->mOnSuccessCallback_85; - if (runner->mIsFailureExpected_85 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10157,32 +8514,25 @@ class TestCluster : public TestCommand } // Test Read attribute OCTET_STRING Default Value - typedef void (*SuccessCallback_86)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_86 = nullptr; - chip::Callback::Callback * mOnFailureCallback_86 = nullptr; - bool mIsFailureExpected_86 = 0; + using SuccessCallback_86 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_86{ + OnTestSendClusterTestClusterCommandReadAttribute_86_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_86{ + OnTestSendClusterTestClusterCommandReadAttribute_86_FailureResponse, this + }; + bool mIsFailureExpected_86 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_86() { ChipLogProgress(chipTool, "Test Cluster - Read attribute OCTET_STRING Default Value: Sending command..."); - mOnFailureCallback_86 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_86_FailureResponse, this); - mOnSuccessCallback_86 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_86_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOctetString(mOnSuccessCallback_86->Cancel(), mOnFailureCallback_86->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_86; - delete mOnSuccessCallback_86; - } + err = cluster.ReadAttributeOctetString(mOnSuccessCallback_86.Cancel(), mOnFailureCallback_86.Cancel()); return err; } @@ -10193,9 +8543,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_86; - delete runner->mOnSuccessCallback_86; - if (runner->mIsFailureExpected_86 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10212,9 +8559,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_86; - delete runner->mOnSuccessCallback_86; - if (runner->mIsFailureExpected_86 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10234,34 +8578,27 @@ class TestCluster : public TestCommand } // Test Write attribute OCTET_STRING - typedef void (*SuccessCallback_87)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_87 = nullptr; - chip::Callback::Callback * mOnFailureCallback_87 = nullptr; - bool mIsFailureExpected_87 = 0; + using SuccessCallback_87 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_87{ + OnTestSendClusterTestClusterCommandWriteAttribute_87_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_87{ + OnTestSendClusterTestClusterCommandWriteAttribute_87_FailureResponse, this + }; + bool mIsFailureExpected_87 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_87() { ChipLogProgress(chipTool, "Test Cluster - Write attribute OCTET_STRING: Sending command..."); - mOnFailureCallback_87 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_87_FailureResponse, this); - mOnSuccessCallback_87 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_87_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), strlen("TestValue")); - err = cluster.WriteAttributeOctetString(mOnSuccessCallback_87->Cancel(), mOnFailureCallback_87->Cancel(), - octetStringArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_87; - delete mOnSuccessCallback_87; - } + err = + cluster.WriteAttributeOctetString(mOnSuccessCallback_87.Cancel(), mOnFailureCallback_87.Cancel(), octetStringArgument); return err; } @@ -10272,9 +8609,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_87; - delete runner->mOnSuccessCallback_87; - if (runner->mIsFailureExpected_87 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10291,9 +8625,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_87; - delete runner->mOnSuccessCallback_87; - if (runner->mIsFailureExpected_87 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10305,32 +8636,25 @@ class TestCluster : public TestCommand } // Test Read attribute OCTET_STRING - typedef void (*SuccessCallback_88)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_88 = nullptr; - chip::Callback::Callback * mOnFailureCallback_88 = nullptr; - bool mIsFailureExpected_88 = 0; + using SuccessCallback_88 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_88{ + OnTestSendClusterTestClusterCommandReadAttribute_88_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_88{ + OnTestSendClusterTestClusterCommandReadAttribute_88_FailureResponse, this + }; + bool mIsFailureExpected_88 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_88() { ChipLogProgress(chipTool, "Test Cluster - Read attribute OCTET_STRING: Sending command..."); - mOnFailureCallback_88 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_88_FailureResponse, this); - mOnSuccessCallback_88 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_88_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOctetString(mOnSuccessCallback_88->Cancel(), mOnFailureCallback_88->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_88; - delete mOnSuccessCallback_88; - } + err = cluster.ReadAttributeOctetString(mOnSuccessCallback_88.Cancel(), mOnFailureCallback_88.Cancel()); return err; } @@ -10341,9 +8665,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_88; - delete runner->mOnSuccessCallback_88; - if (runner->mIsFailureExpected_88 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10360,9 +8681,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_88; - delete runner->mOnSuccessCallback_88; - if (runner->mIsFailureExpected_88 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10382,20 +8700,19 @@ class TestCluster : public TestCommand } // Test Write attribute OCTET_STRING - typedef void (*SuccessCallback_89)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_89 = nullptr; - chip::Callback::Callback * mOnFailureCallback_89 = nullptr; - bool mIsFailureExpected_89 = 0; + using SuccessCallback_89 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_89{ + OnTestSendClusterTestClusterCommandWriteAttribute_89_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_89{ + OnTestSendClusterTestClusterCommandWriteAttribute_89_FailureResponse, this + }; + bool mIsFailureExpected_89 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_89() { ChipLogProgress(chipTool, "Test Cluster - Write attribute OCTET_STRING: Sending command..."); - mOnFailureCallback_89 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_89_FailureResponse, this); - mOnSuccessCallback_89 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_89_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); @@ -10403,14 +8720,8 @@ class TestCluster : public TestCommand chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10"), strlen("TestValueLongerThan10")); - err = cluster.WriteAttributeOctetString(mOnSuccessCallback_89->Cancel(), mOnFailureCallback_89->Cancel(), - octetStringArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_89; - delete mOnSuccessCallback_89; - } + err = + cluster.WriteAttributeOctetString(mOnSuccessCallback_89.Cancel(), mOnFailureCallback_89.Cancel(), octetStringArgument); return err; } @@ -10421,9 +8732,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_89; - delete runner->mOnSuccessCallback_89; - if (runner->mIsFailureExpected_89 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10440,9 +8748,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_89; - delete runner->mOnSuccessCallback_89; - if (runner->mIsFailureExpected_89 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10454,32 +8759,25 @@ class TestCluster : public TestCommand } // Test Read attribute OCTET_STRING - typedef void (*SuccessCallback_90)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_90 = nullptr; - chip::Callback::Callback * mOnFailureCallback_90 = nullptr; - bool mIsFailureExpected_90 = 0; + using SuccessCallback_90 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_90{ + OnTestSendClusterTestClusterCommandReadAttribute_90_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_90{ + OnTestSendClusterTestClusterCommandReadAttribute_90_FailureResponse, this + }; + bool mIsFailureExpected_90 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_90() { ChipLogProgress(chipTool, "Test Cluster - Read attribute OCTET_STRING: Sending command..."); - mOnFailureCallback_90 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_90_FailureResponse, this); - mOnSuccessCallback_90 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_90_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOctetString(mOnSuccessCallback_90->Cancel(), mOnFailureCallback_90->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_90; - delete mOnSuccessCallback_90; - } + err = cluster.ReadAttributeOctetString(mOnSuccessCallback_90.Cancel(), mOnFailureCallback_90.Cancel()); return err; } @@ -10490,9 +8788,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_90; - delete runner->mOnSuccessCallback_90; - if (runner->mIsFailureExpected_90 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10509,9 +8804,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_90; - delete runner->mOnSuccessCallback_90; - if (runner->mIsFailureExpected_90 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10531,34 +8823,27 @@ class TestCluster : public TestCommand } // Test Write attribute OCTET_STRING - typedef void (*SuccessCallback_91)(void * context, chip::ByteSpan octetString); - chip::Callback::Callback * mOnSuccessCallback_91 = nullptr; - chip::Callback::Callback * mOnFailureCallback_91 = nullptr; - bool mIsFailureExpected_91 = 0; + using SuccessCallback_91 = void (*)(void * context, chip::ByteSpan octetString); + chip::Callback::Callback mOnSuccessCallback_91{ + OnTestSendClusterTestClusterCommandWriteAttribute_91_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_91{ + OnTestSendClusterTestClusterCommandWriteAttribute_91_FailureResponse, this + }; + bool mIsFailureExpected_91 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_91() { ChipLogProgress(chipTool, "Test Cluster - Write attribute OCTET_STRING: Sending command..."); - mOnFailureCallback_91 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_91_FailureResponse, this); - mOnSuccessCallback_91 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_91_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; chip::ByteSpan octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); - err = cluster.WriteAttributeOctetString(mOnSuccessCallback_91->Cancel(), mOnFailureCallback_91->Cancel(), - octetStringArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_91; - delete mOnSuccessCallback_91; - } + err = + cluster.WriteAttributeOctetString(mOnSuccessCallback_91.Cancel(), mOnFailureCallback_91.Cancel(), octetStringArgument); return err; } @@ -10569,9 +8854,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_91; - delete runner->mOnSuccessCallback_91; - if (runner->mIsFailureExpected_91 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10588,9 +8870,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_91; - delete runner->mOnSuccessCallback_91; - if (runner->mIsFailureExpected_91 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10602,32 +8881,25 @@ class TestCluster : public TestCommand } // Test Read attribute LONG_OCTET_STRING Default Value - typedef void (*SuccessCallback_92)(void * context, chip::ByteSpan longOctetString); - chip::Callback::Callback * mOnSuccessCallback_92 = nullptr; - chip::Callback::Callback * mOnFailureCallback_92 = nullptr; - bool mIsFailureExpected_92 = 0; + using SuccessCallback_92 = void (*)(void * context, chip::ByteSpan longOctetString); + chip::Callback::Callback mOnSuccessCallback_92{ + OnTestSendClusterTestClusterCommandReadAttribute_92_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_92{ + OnTestSendClusterTestClusterCommandReadAttribute_92_FailureResponse, this + }; + bool mIsFailureExpected_92 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_92() { ChipLogProgress(chipTool, "Test Cluster - Read attribute LONG_OCTET_STRING Default Value: Sending command..."); - mOnFailureCallback_92 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_92_FailureResponse, this); - mOnSuccessCallback_92 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_92_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeLongOctetString(mOnSuccessCallback_92->Cancel(), mOnFailureCallback_92->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_92; - delete mOnSuccessCallback_92; - } + err = cluster.ReadAttributeLongOctetString(mOnSuccessCallback_92.Cancel(), mOnFailureCallback_92.Cancel()); return err; } @@ -10638,9 +8910,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_92; - delete runner->mOnSuccessCallback_92; - if (runner->mIsFailureExpected_92 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10657,9 +8926,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_92; - delete runner->mOnSuccessCallback_92; - if (runner->mIsFailureExpected_92 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10679,20 +8945,19 @@ class TestCluster : public TestCommand } // Test Write attribute LONG_OCTET_STRING - typedef void (*SuccessCallback_93)(void * context, chip::ByteSpan longOctetString); - chip::Callback::Callback * mOnSuccessCallback_93 = nullptr; - chip::Callback::Callback * mOnFailureCallback_93 = nullptr; - bool mIsFailureExpected_93 = 0; + using SuccessCallback_93 = void (*)(void * context, chip::ByteSpan longOctetString); + chip::Callback::Callback mOnSuccessCallback_93{ + OnTestSendClusterTestClusterCommandWriteAttribute_93_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_93{ + OnTestSendClusterTestClusterCommandWriteAttribute_93_FailureResponse, this + }; + bool mIsFailureExpected_93 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_93() { ChipLogProgress(chipTool, "Test Cluster - Write attribute LONG_OCTET_STRING: Sending command..."); - mOnFailureCallback_93 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_93_FailureResponse, this); - mOnSuccessCallback_93 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_93_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); @@ -10706,15 +8971,9 @@ class TestCluster : public TestCommand strlen("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" "111111111111111111111111111111111111111111111111111111111111111111111111111111")); - err = cluster.WriteAttributeLongOctetString(mOnSuccessCallback_93->Cancel(), mOnFailureCallback_93->Cancel(), + err = cluster.WriteAttributeLongOctetString(mOnSuccessCallback_93.Cancel(), mOnFailureCallback_93.Cancel(), longOctetStringArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_93; - delete mOnSuccessCallback_93; - } - return err; } @@ -10724,9 +8983,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_93; - delete runner->mOnSuccessCallback_93; - if (runner->mIsFailureExpected_93 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10743,9 +8999,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_93; - delete runner->mOnSuccessCallback_93; - if (runner->mIsFailureExpected_93 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10757,32 +9010,25 @@ class TestCluster : public TestCommand } // Test Read attribute LONG_OCTET_STRING - typedef void (*SuccessCallback_94)(void * context, chip::ByteSpan longOctetString); - chip::Callback::Callback * mOnSuccessCallback_94 = nullptr; - chip::Callback::Callback * mOnFailureCallback_94 = nullptr; - bool mIsFailureExpected_94 = 0; + using SuccessCallback_94 = void (*)(void * context, chip::ByteSpan longOctetString); + chip::Callback::Callback mOnSuccessCallback_94{ + OnTestSendClusterTestClusterCommandReadAttribute_94_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_94{ + OnTestSendClusterTestClusterCommandReadAttribute_94_FailureResponse, this + }; + bool mIsFailureExpected_94 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_94() { ChipLogProgress(chipTool, "Test Cluster - Read attribute LONG_OCTET_STRING: Sending command..."); - mOnFailureCallback_94 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_94_FailureResponse, this); - mOnSuccessCallback_94 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_94_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeLongOctetString(mOnSuccessCallback_94->Cancel(), mOnFailureCallback_94->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_94; - delete mOnSuccessCallback_94; - } + err = cluster.ReadAttributeLongOctetString(mOnSuccessCallback_94.Cancel(), mOnFailureCallback_94.Cancel()); return err; } @@ -10793,9 +9039,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_94; - delete runner->mOnSuccessCallback_94; - if (runner->mIsFailureExpected_94 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10812,9 +9055,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_94; - delete runner->mOnSuccessCallback_94; - if (runner->mIsFailureExpected_94 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10844,35 +9084,28 @@ class TestCluster : public TestCommand } // Test Write attribute LONG_OCTET_STRING - typedef void (*SuccessCallback_95)(void * context, chip::ByteSpan longOctetString); - chip::Callback::Callback * mOnSuccessCallback_95 = nullptr; - chip::Callback::Callback * mOnFailureCallback_95 = nullptr; - bool mIsFailureExpected_95 = 0; + using SuccessCallback_95 = void (*)(void * context, chip::ByteSpan longOctetString); + chip::Callback::Callback mOnSuccessCallback_95{ + OnTestSendClusterTestClusterCommandWriteAttribute_95_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_95{ + OnTestSendClusterTestClusterCommandWriteAttribute_95_FailureResponse, this + }; + bool mIsFailureExpected_95 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_95() { ChipLogProgress(chipTool, "Test Cluster - Write attribute LONG_OCTET_STRING: Sending command..."); - mOnFailureCallback_95 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_95_FailureResponse, this); - mOnSuccessCallback_95 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_95_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; chip::ByteSpan longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char(""), strlen("")); - err = cluster.WriteAttributeLongOctetString(mOnSuccessCallback_95->Cancel(), mOnFailureCallback_95->Cancel(), + err = cluster.WriteAttributeLongOctetString(mOnSuccessCallback_95.Cancel(), mOnFailureCallback_95.Cancel(), longOctetStringArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_95; - delete mOnSuccessCallback_95; - } - return err; } @@ -10882,9 +9115,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_95; - delete runner->mOnSuccessCallback_95; - if (runner->mIsFailureExpected_95 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10901,9 +9131,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_95; - delete runner->mOnSuccessCallback_95; - if (runner->mIsFailureExpected_95 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10915,32 +9142,25 @@ class TestCluster : public TestCommand } // Test Read attribute LIST - typedef void (*SuccessCallback_96)(void * context, uint16_t count, uint8_t * listInt8u); - chip::Callback::Callback * mOnSuccessCallback_96 = nullptr; - chip::Callback::Callback * mOnFailureCallback_96 = nullptr; - bool mIsFailureExpected_96 = 0; + using SuccessCallback_96 = void (*)(void * context, uint16_t count, uint8_t * listInt8u); + chip::Callback::Callback mOnSuccessCallback_96{ + OnTestSendClusterTestClusterCommandReadAttribute_96_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_96{ + OnTestSendClusterTestClusterCommandReadAttribute_96_FailureResponse, this + }; + bool mIsFailureExpected_96 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_96() { ChipLogProgress(chipTool, "Test Cluster - Read attribute LIST: Sending command..."); - mOnFailureCallback_96 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_96_FailureResponse, this); - mOnSuccessCallback_96 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_96_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeListInt8u(mOnSuccessCallback_96->Cancel(), mOnFailureCallback_96->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_96; - delete mOnSuccessCallback_96; - } + err = cluster.ReadAttributeListInt8u(mOnSuccessCallback_96.Cancel(), mOnFailureCallback_96.Cancel()); return err; } @@ -10951,9 +9171,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_96; - delete runner->mOnSuccessCallback_96; - if (runner->mIsFailureExpected_96 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -10971,9 +9188,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_96; - delete runner->mOnSuccessCallback_96; - if (runner->mIsFailureExpected_96 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -10992,32 +9206,25 @@ class TestCluster : public TestCommand } // Test Read attribute LIST_OCTET_STRING - typedef void (*SuccessCallback_97)(void * context, uint16_t count, chip::ByteSpan * listOctetString); - chip::Callback::Callback * mOnSuccessCallback_97 = nullptr; - chip::Callback::Callback * mOnFailureCallback_97 = nullptr; - bool mIsFailureExpected_97 = 0; + using SuccessCallback_97 = void (*)(void * context, uint16_t count, chip::ByteSpan * listOctetString); + chip::Callback::Callback mOnSuccessCallback_97{ + OnTestSendClusterTestClusterCommandReadAttribute_97_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_97{ + OnTestSendClusterTestClusterCommandReadAttribute_97_FailureResponse, this + }; + bool mIsFailureExpected_97 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_97() { ChipLogProgress(chipTool, "Test Cluster - Read attribute LIST_OCTET_STRING: Sending command..."); - mOnFailureCallback_97 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_97_FailureResponse, this); - mOnSuccessCallback_97 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_97_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeListOctetString(mOnSuccessCallback_97->Cancel(), mOnFailureCallback_97->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_97; - delete mOnSuccessCallback_97; - } + err = cluster.ReadAttributeListOctetString(mOnSuccessCallback_97.Cancel(), mOnFailureCallback_97.Cancel()); return err; } @@ -11028,9 +9235,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_97; - delete runner->mOnSuccessCallback_97; - if (runner->mIsFailureExpected_97 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11048,9 +9252,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_97; - delete runner->mOnSuccessCallback_97; - if (runner->mIsFailureExpected_97 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11069,32 +9270,25 @@ class TestCluster : public TestCommand } // Test Read attribute LIST_STRUCT_OCTET_STRING - typedef void (*SuccessCallback_98)(void * context, uint16_t count, _TestListStructOctet * listStructOctetString); - chip::Callback::Callback * mOnSuccessCallback_98 = nullptr; - chip::Callback::Callback * mOnFailureCallback_98 = nullptr; - bool mIsFailureExpected_98 = 0; + using SuccessCallback_98 = void (*)(void * context, uint16_t count, _TestListStructOctet * listStructOctetString); + chip::Callback::Callback mOnSuccessCallback_98{ + OnTestSendClusterTestClusterCommandReadAttribute_98_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_98{ + OnTestSendClusterTestClusterCommandReadAttribute_98_FailureResponse, this + }; + bool mIsFailureExpected_98 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_98() { ChipLogProgress(chipTool, "Test Cluster - Read attribute LIST_STRUCT_OCTET_STRING: Sending command..."); - mOnFailureCallback_98 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_98_FailureResponse, this); - mOnSuccessCallback_98 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_98_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeListStructOctetString(mOnSuccessCallback_98->Cancel(), mOnFailureCallback_98->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_98; - delete mOnSuccessCallback_98; - } + err = cluster.ReadAttributeListStructOctetString(mOnSuccessCallback_98.Cancel(), mOnFailureCallback_98.Cancel()); return err; } @@ -11105,9 +9299,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_98; - delete runner->mOnSuccessCallback_98; - if (runner->mIsFailureExpected_98 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11125,9 +9316,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_98; - delete runner->mOnSuccessCallback_98; - if (runner->mIsFailureExpected_98 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11147,32 +9335,25 @@ class TestCluster : public TestCommand } // Test Read attribute UNSUPPORTED - typedef void (*SuccessCallback_99)(void * context, uint8_t unsupported); - chip::Callback::Callback * mOnSuccessCallback_99 = nullptr; - chip::Callback::Callback * mOnFailureCallback_99 = nullptr; - bool mIsFailureExpected_99 = 0; + using SuccessCallback_99 = void (*)(void * context, uint8_t unsupported); + chip::Callback::Callback mOnSuccessCallback_99{ + OnTestSendClusterTestClusterCommandReadAttribute_99_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_99{ + OnTestSendClusterTestClusterCommandReadAttribute_99_FailureResponse, this + }; + bool mIsFailureExpected_99 = 0; CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_99() { ChipLogProgress(chipTool, "Test Cluster - Read attribute UNSUPPORTED: Sending command..."); - mOnFailureCallback_99 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_99_FailureResponse, this); - mOnSuccessCallback_99 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandReadAttribute_99_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeUnsupported(mOnSuccessCallback_99->Cancel(), mOnFailureCallback_99->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_99; - delete mOnSuccessCallback_99; - } + err = cluster.ReadAttributeUnsupported(mOnSuccessCallback_99.Cancel(), mOnFailureCallback_99.Cancel()); return err; } @@ -11183,9 +9364,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_99; - delete runner->mOnSuccessCallback_99; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -11208,9 +9386,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_99; - delete runner->mOnSuccessCallback_99; - if (runner->mIsFailureExpected_99 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11229,35 +9404,28 @@ class TestCluster : public TestCommand } // Test Writeattribute UNSUPPORTED - typedef void (*SuccessCallback_100)(void * context, uint8_t unsupported); - chip::Callback::Callback * mOnSuccessCallback_100 = nullptr; - chip::Callback::Callback * mOnFailureCallback_100 = nullptr; - bool mIsFailureExpected_100 = 0; + using SuccessCallback_100 = void (*)(void * context, uint8_t unsupported); + chip::Callback::Callback mOnSuccessCallback_100{ + OnTestSendClusterTestClusterCommandWriteAttribute_100_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_100{ + OnTestSendClusterTestClusterCommandWriteAttribute_100_FailureResponse, this + }; + bool mIsFailureExpected_100 = 0; CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_100() { ChipLogProgress(chipTool, "Test Cluster - Writeattribute UNSUPPORTED: Sending command..."); - mOnFailureCallback_100 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_100_FailureResponse, this); - mOnSuccessCallback_100 = new chip::Callback::Callback( - OnTestSendClusterTestClusterCommandWriteAttribute_100_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t unsupportedArgument = 0; - err = cluster.WriteAttributeUnsupported(mOnSuccessCallback_100->Cancel(), mOnFailureCallback_100->Cancel(), + err = cluster.WriteAttributeUnsupported(mOnSuccessCallback_100.Cancel(), mOnFailureCallback_100.Cancel(), unsupportedArgument); - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_100; - delete mOnSuccessCallback_100; - } - return err; } @@ -11267,9 +9435,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_100; - delete runner->mOnSuccessCallback_100; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -11292,9 +9457,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_100; - delete runner->mOnSuccessCallback_100; - if (runner->mIsFailureExpected_100 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11306,32 +9468,25 @@ class TestCluster : public TestCommand } // Test Send Test Command to unsupported endpoint - typedef void (*SuccessCallback_101)(void * context); - chip::Callback::Callback * mOnSuccessCallback_101 = nullptr; - chip::Callback::Callback * mOnFailureCallback_101 = nullptr; - bool mIsFailureExpected_101 = 1; + using SuccessCallback_101 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_101{ + OnTestSendClusterTestClusterCommandTest_101_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_101{ + OnTestSendClusterTestClusterCommandTest_101_FailureResponse, this + }; + bool mIsFailureExpected_101 = 1; CHIP_ERROR TestSendClusterTestClusterCommandTest_101() { ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Sending command..."); - mOnFailureCallback_101 = - new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_101_FailureResponse, this); - mOnSuccessCallback_101 = - new chip::Callback::Callback(OnTestSendClusterTestClusterCommandTest_101_SuccessResponse, this); - chip::Controller::TestClusterCluster cluster; cluster.Associate(mDevice, 200); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Test(mOnSuccessCallback_101->Cancel(), mOnFailureCallback_101->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_101; - delete mOnSuccessCallback_101; - } + err = cluster.Test(mOnSuccessCallback_101.Cancel(), mOnFailureCallback_101.Cancel()); return err; } @@ -11342,9 +9497,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_101; - delete runner->mOnSuccessCallback_101; - if (runner->mIsFailureExpected_101 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11361,9 +9513,6 @@ class TestCluster : public TestCommand TestCluster * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_101; - delete runner->mOnSuccessCallback_101; - if (runner->mIsFailureExpected_101 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11427,32 +9576,24 @@ class Test_TC_OO_1_1 : public TestCommand // // Test read the global attribute: ClusterRevision - typedef void (*SuccessCallback_0)(void * context, uint16_t clusterRevision); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t clusterRevision); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterOnOffCommandReadAttribute_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterOnOffCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_0() { ChipLogProgress(chipTool, "On/Off - read the global attribute: ClusterRevision: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -11463,9 +9604,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11482,9 +9620,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11503,32 +9638,24 @@ class Test_TC_OO_1_1 : public TestCommand } // Test reads back global attribute: ClusterRevision - typedef void (*SuccessCallback_1)(void * context, uint16_t clusterRevision); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint16_t clusterRevision); + chip::Callback::Callback mOnSuccessCallback_1{ OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_1() { ChipLogProgress(chipTool, "On/Off - reads back global attribute: ClusterRevision: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeClusterRevision(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.ReadAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -11539,9 +9666,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11558,9 +9682,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11579,32 +9700,24 @@ class Test_TC_OO_1_1 : public TestCommand } // Test read the optional global attribute: FeatureMap - typedef void (*SuccessCallback_2)(void * context, uint32_t featureMap); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint32_t featureMap); + chip::Callback::Callback mOnSuccessCallback_2{ OnTestSendClusterOnOffCommandReadAttribute_2_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterOnOffCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_2() { ChipLogProgress(chipTool, "On/Off - read the optional global attribute: FeatureMap: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeFeatureMap(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeFeatureMap(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -11615,9 +9728,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11634,9 +9744,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11655,32 +9762,24 @@ class Test_TC_OO_1_1 : public TestCommand } // Test reads back optional global attribute: FeatureMap - typedef void (*SuccessCallback_3)(void * context, uint32_t featureMap); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint32_t featureMap); + chip::Callback::Callback mOnSuccessCallback_3{ OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_3() { ChipLogProgress(chipTool, "On/Off - reads back optional global attribute: FeatureMap: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -11691,9 +9790,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11710,9 +9806,6 @@ class Test_TC_OO_1_1 : public TestCommand Test_TC_OO_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11807,32 +9900,24 @@ class Test_TC_OO_2_1 : public TestCommand // // Test read the mandatory attribute: OnOff - typedef void (*SuccessCallback_0)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterOnOffCommandReadAttribute_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterOnOffCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_0() { ChipLogProgress(chipTool, "On/Off - read the mandatory attribute: OnOff: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -11843,9 +9928,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11862,9 +9944,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11883,32 +9962,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test reads back mandatory attribute: OnOff - typedef void (*SuccessCallback_1)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_1{ OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_1() { ChipLogProgress(chipTool, "On/Off - reads back mandatory attribute: OnOff: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -11919,9 +9990,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -11938,9 +10006,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -11959,32 +10024,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test read LT attribute: GlobalSceneControl - typedef void (*SuccessCallback_2)(void * context, uint8_t globalSceneControl); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint8_t globalSceneControl); + chip::Callback::Callback mOnSuccessCallback_2{ OnTestSendClusterOnOffCommandReadAttribute_2_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterOnOffCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_2() { ChipLogProgress(chipTool, "On/Off - read LT attribute: GlobalSceneControl: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -11995,9 +10052,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12014,9 +10068,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12035,32 +10086,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test read LT attribute: OnTime - typedef void (*SuccessCallback_3)(void * context, uint16_t onTime); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint16_t onTime); + chip::Callback::Callback mOnSuccessCallback_3{ OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_3() { ChipLogProgress(chipTool, "On/Off - read LT attribute: OnTime: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnTime(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeOnTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -12071,9 +10114,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12090,9 +10130,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12111,32 +10148,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test read LT attribute: OffWaitTime - typedef void (*SuccessCallback_4)(void * context, uint16_t offWaitTime); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context, uint16_t offWaitTime); + chip::Callback::Callback mOnSuccessCallback_4{ OnTestSendClusterOnOffCommandReadAttribute_4_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterOnOffCommandReadAttribute_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_4() { ChipLogProgress(chipTool, "On/Off - read LT attribute: OffWaitTime: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_4_FailureResponse, this); - mOnSuccessCallback_4 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_4_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -12147,9 +10176,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12166,9 +10192,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12187,32 +10210,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test read LT attribute: StartUpOnOff - typedef void (*SuccessCallback_5)(void * context, uint8_t startUpOnOff); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, uint8_t startUpOnOff); + chip::Callback::Callback mOnSuccessCallback_5{ OnTestSendClusterOnOffCommandReadAttribute_5_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterOnOffCommandReadAttribute_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_5() { ChipLogProgress(chipTool, "On/Off - read LT attribute: StartUpOnOff: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_5_FailureResponse, this); - mOnSuccessCallback_5 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_5_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -12223,9 +10238,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12242,9 +10254,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12263,33 +10272,25 @@ class Test_TC_OO_2_1 : public TestCommand } // Test write the default value to LT attribute: OnTime - typedef void (*SuccessCallback_6)(void * context, uint16_t onTime); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context, uint16_t onTime); + chip::Callback::Callback mOnSuccessCallback_6{ OnTestSendClusterOnOffCommandWriteAttribute_6_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_6{ + OnTestSendClusterOnOffCommandWriteAttribute_6_FailureResponse, this + }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterOnOffCommandWriteAttribute_6() { ChipLogProgress(chipTool, "On/Off - write the default value to LT attribute: OnTime: Sending command..."); - mOnFailureCallback_6 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandWriteAttribute_6_FailureResponse, this); - mOnSuccessCallback_6 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandWriteAttribute_6_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t onTimeArgument = 0U; - err = cluster.WriteAttributeOnTime(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel(), onTimeArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.WriteAttributeOnTime(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), onTimeArgument); return err; } @@ -12300,9 +10301,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12319,9 +10317,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12333,34 +10328,25 @@ class Test_TC_OO_2_1 : public TestCommand } // Test write the default value to LT attribute: OffWaitTime - typedef void (*SuccessCallback_7)(void * context, uint16_t offWaitTime); - chip::Callback::Callback * mOnSuccessCallback_7 = nullptr; - chip::Callback::Callback * mOnFailureCallback_7 = nullptr; - bool mIsFailureExpected_7 = 0; + using SuccessCallback_7 = void (*)(void * context, uint16_t offWaitTime); + chip::Callback::Callback mOnSuccessCallback_7{ OnTestSendClusterOnOffCommandWriteAttribute_7_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_7{ + OnTestSendClusterOnOffCommandWriteAttribute_7_FailureResponse, this + }; + bool mIsFailureExpected_7 = 0; CHIP_ERROR TestSendClusterOnOffCommandWriteAttribute_7() { ChipLogProgress(chipTool, "On/Off - write the default value to LT attribute: OffWaitTime: Sending command..."); - mOnFailureCallback_7 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandWriteAttribute_7_FailureResponse, this); - mOnSuccessCallback_7 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandWriteAttribute_7_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint16_t offWaitTimeArgument = 0U; - err = - cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7->Cancel(), mOnFailureCallback_7->Cancel(), offWaitTimeArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_7; - delete mOnSuccessCallback_7; - } + err = cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), offWaitTimeArgument); return err; } @@ -12371,9 +10357,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12390,9 +10373,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12404,34 +10384,26 @@ class Test_TC_OO_2_1 : public TestCommand } // Test write the default value to LT attribute: StartUpOnOff - typedef void (*SuccessCallback_8)(void * context, uint8_t startUpOnOff); - chip::Callback::Callback * mOnSuccessCallback_8 = nullptr; - chip::Callback::Callback * mOnFailureCallback_8 = nullptr; - bool mIsFailureExpected_8 = 0; + using SuccessCallback_8 = void (*)(void * context, uint8_t startUpOnOff); + chip::Callback::Callback mOnSuccessCallback_8{ OnTestSendClusterOnOffCommandWriteAttribute_8_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_8{ + OnTestSendClusterOnOffCommandWriteAttribute_8_FailureResponse, this + }; + bool mIsFailureExpected_8 = 0; CHIP_ERROR TestSendClusterOnOffCommandWriteAttribute_8() { ChipLogProgress(chipTool, "On/Off - write the default value to LT attribute: StartUpOnOff: Sending command..."); - mOnFailureCallback_8 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandWriteAttribute_8_FailureResponse, this); - mOnSuccessCallback_8 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandWriteAttribute_8_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; uint8_t startUpOnOffArgument = 0; - err = cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8->Cancel(), mOnFailureCallback_8->Cancel(), - startUpOnOffArgument); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_8; - delete mOnSuccessCallback_8; - } + err = + cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), startUpOnOffArgument); return err; } @@ -12442,9 +10414,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12461,9 +10430,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12475,32 +10441,24 @@ class Test_TC_OO_2_1 : public TestCommand } // Test reads back LT attribute: OnTime - typedef void (*SuccessCallback_9)(void * context, uint16_t onTime); - chip::Callback::Callback * mOnSuccessCallback_9 = nullptr; - chip::Callback::Callback * mOnFailureCallback_9 = nullptr; - bool mIsFailureExpected_9 = 0; + using SuccessCallback_9 = void (*)(void * context, uint16_t onTime); + chip::Callback::Callback mOnSuccessCallback_9{ OnTestSendClusterOnOffCommandReadAttribute_9_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_9{ + OnTestSendClusterOnOffCommandReadAttribute_9_FailureResponse, this + }; + bool mIsFailureExpected_9 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_9() { ChipLogProgress(chipTool, "On/Off - reads back LT attribute: OnTime: Sending command..."); - mOnFailureCallback_9 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_9_FailureResponse, this); - mOnSuccessCallback_9 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_9_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnTime(mOnSuccessCallback_9->Cancel(), mOnFailureCallback_9->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_9; - delete mOnSuccessCallback_9; - } + err = cluster.ReadAttributeOnTime(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); return err; } @@ -12511,9 +10469,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12530,9 +10485,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12551,32 +10503,25 @@ class Test_TC_OO_2_1 : public TestCommand } // Test reads back LT attribute: OffWaitTime - typedef void (*SuccessCallback_10)(void * context, uint16_t offWaitTime); - chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; - chip::Callback::Callback * mOnFailureCallback_10 = nullptr; - bool mIsFailureExpected_10 = 0; + using SuccessCallback_10 = void (*)(void * context, uint16_t offWaitTime); + chip::Callback::Callback mOnSuccessCallback_10{ + OnTestSendClusterOnOffCommandReadAttribute_10_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_10{ + OnTestSendClusterOnOffCommandReadAttribute_10_FailureResponse, this + }; + bool mIsFailureExpected_10 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_10() { ChipLogProgress(chipTool, "On/Off - reads back LT attribute: OffWaitTime: Sending command..."); - mOnFailureCallback_10 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_10_FailureResponse, this); - mOnSuccessCallback_10 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_10_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_10; - delete mOnSuccessCallback_10; - } + err = cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); return err; } @@ -12587,9 +10532,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12606,9 +10548,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12627,32 +10566,25 @@ class Test_TC_OO_2_1 : public TestCommand } // Test reads back LT attribute: StartUpOnOff - typedef void (*SuccessCallback_11)(void * context, uint8_t startUpOnOff); - chip::Callback::Callback * mOnSuccessCallback_11 = nullptr; - chip::Callback::Callback * mOnFailureCallback_11 = nullptr; - bool mIsFailureExpected_11 = 0; + using SuccessCallback_11 = void (*)(void * context, uint8_t startUpOnOff); + chip::Callback::Callback mOnSuccessCallback_11{ + OnTestSendClusterOnOffCommandReadAttribute_11_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_11{ + OnTestSendClusterOnOffCommandReadAttribute_11_FailureResponse, this + }; + bool mIsFailureExpected_11 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_11() { ChipLogProgress(chipTool, "On/Off - reads back LT attribute: StartUpOnOff: Sending command..."); - mOnFailureCallback_11 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_11_FailureResponse, this); - mOnSuccessCallback_11 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_11_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11->Cancel(), mOnFailureCallback_11->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_11; - delete mOnSuccessCallback_11; - } + err = cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); return err; } @@ -12663,9 +10595,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12682,9 +10611,6 @@ class Test_TC_OO_2_1 : public TestCommand Test_TC_OO_2_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12785,32 +10711,22 @@ class Test_TC_OO_2_2 : public TestCommand // // Test Send Off Command - typedef void (*SuccessCallback_0)(void * context); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterOnOffCommandOff_0_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_0{ OnTestSendClusterOnOffCommandOff_0_FailureResponse, + this }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterOnOffCommandOff_0() { ChipLogProgress(chipTool, "On/Off - Send Off Command: Sending command..."); - mOnFailureCallback_0 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_0_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); - CHIP_ERROR err = CHIP_NO_ERROR; - - err = cluster.Off(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.Off(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -12821,9 +10737,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12840,9 +10753,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12854,32 +10764,24 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is false after off command - typedef void (*SuccessCallback_1)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_1{ OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_1() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is false after off command: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_1_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -12890,9 +10792,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12909,9 +10808,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12930,32 +10826,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send On Command - typedef void (*SuccessCallback_2)(void * context); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_2{ OnTestSendClusterOnOffCommandOn_2_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnTestSendClusterOnOffCommandOn_2_FailureResponse, + this }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterOnOffCommandOn_2() { ChipLogProgress(chipTool, "On/Off - Send On Command: Sending command..."); - mOnFailureCallback_2 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOn_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOn_2_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.On(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.On(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -12966,9 +10852,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -12985,9 +10868,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -12999,32 +10879,24 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is true after on command - typedef void (*SuccessCallback_3)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_3{ OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_3() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is true after on command: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -13035,9 +10907,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13054,9 +10923,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13075,32 +10941,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send Off Command - typedef void (*SuccessCallback_4)(void * context); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_4{ OnTestSendClusterOnOffCommandOff_4_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnTestSendClusterOnOffCommandOff_4_FailureResponse, + this }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterOnOffCommandOff_4() { ChipLogProgress(chipTool, "On/Off - Send Off Command: Sending command..."); - mOnFailureCallback_4 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_4_FailureResponse, this); - mOnSuccessCallback_4 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_4_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Off(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -13111,9 +10967,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13130,9 +10983,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13144,32 +10994,24 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is false after off command - typedef void (*SuccessCallback_5)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_5{ OnTestSendClusterOnOffCommandReadAttribute_5_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterOnOffCommandReadAttribute_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_5() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is false after off command: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_5_FailureResponse, this); - mOnSuccessCallback_5 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_5_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -13180,9 +11022,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13199,9 +11038,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13220,32 +11056,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send Toggle Command - typedef void (*SuccessCallback_6)(void * context); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_6{ OnTestSendClusterOnOffCommandToggle_6_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnTestSendClusterOnOffCommandToggle_6_FailureResponse, + this }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterOnOffCommandToggle_6() { ChipLogProgress(chipTool, "On/Off - Send Toggle Command: Sending command..."); - mOnFailureCallback_6 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandToggle_6_FailureResponse, this); - mOnSuccessCallback_6 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandToggle_6_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Toggle(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.Toggle(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); return err; } @@ -13256,9 +11082,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13275,9 +11098,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13289,32 +11109,24 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is true after toggle command - typedef void (*SuccessCallback_7)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_7 = nullptr; - chip::Callback::Callback * mOnFailureCallback_7 = nullptr; - bool mIsFailureExpected_7 = 0; + using SuccessCallback_7 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_7{ OnTestSendClusterOnOffCommandReadAttribute_7_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_7{ + OnTestSendClusterOnOffCommandReadAttribute_7_FailureResponse, this + }; + bool mIsFailureExpected_7 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_7() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is true after toggle command: Sending command..."); - mOnFailureCallback_7 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_7_FailureResponse, this); - mOnSuccessCallback_7 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_7_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_7->Cancel(), mOnFailureCallback_7->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_7; - delete mOnSuccessCallback_7; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); return err; } @@ -13325,9 +11137,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13344,9 +11153,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13365,32 +11171,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send Toggle Command - typedef void (*SuccessCallback_8)(void * context); - chip::Callback::Callback * mOnSuccessCallback_8 = nullptr; - chip::Callback::Callback * mOnFailureCallback_8 = nullptr; - bool mIsFailureExpected_8 = 0; + using SuccessCallback_8 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_8{ OnTestSendClusterOnOffCommandToggle_8_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnTestSendClusterOnOffCommandToggle_8_FailureResponse, + this }; + bool mIsFailureExpected_8 = 0; CHIP_ERROR TestSendClusterOnOffCommandToggle_8() { ChipLogProgress(chipTool, "On/Off - Send Toggle Command: Sending command..."); - mOnFailureCallback_8 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandToggle_8_FailureResponse, this); - mOnSuccessCallback_8 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandToggle_8_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Toggle(mOnSuccessCallback_8->Cancel(), mOnFailureCallback_8->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_8; - delete mOnSuccessCallback_8; - } + err = cluster.Toggle(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); return err; } @@ -13401,9 +11197,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13420,9 +11213,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13434,32 +11224,24 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is false after toggle command - typedef void (*SuccessCallback_9)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_9 = nullptr; - chip::Callback::Callback * mOnFailureCallback_9 = nullptr; - bool mIsFailureExpected_9 = 0; + using SuccessCallback_9 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_9{ OnTestSendClusterOnOffCommandReadAttribute_9_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_9{ + OnTestSendClusterOnOffCommandReadAttribute_9_FailureResponse, this + }; + bool mIsFailureExpected_9 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_9() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is false after toggle command: Sending command..."); - mOnFailureCallback_9 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_9_FailureResponse, this); - mOnSuccessCallback_9 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_9_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_9->Cancel(), mOnFailureCallback_9->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_9; - delete mOnSuccessCallback_9; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); return err; } @@ -13470,9 +11252,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13489,9 +11268,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13510,32 +11286,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send On Command - typedef void (*SuccessCallback_10)(void * context); - chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; - chip::Callback::Callback * mOnFailureCallback_10 = nullptr; - bool mIsFailureExpected_10 = 0; + using SuccessCallback_10 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_10{ OnTestSendClusterOnOffCommandOn_10_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnTestSendClusterOnOffCommandOn_10_FailureResponse, + this }; + bool mIsFailureExpected_10 = 0; CHIP_ERROR TestSendClusterOnOffCommandOn_10() { ChipLogProgress(chipTool, "On/Off - Send On Command: Sending command..."); - mOnFailureCallback_10 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOn_10_FailureResponse, this); - mOnSuccessCallback_10 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOn_10_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.On(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_10; - delete mOnSuccessCallback_10; - } + err = cluster.On(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); return err; } @@ -13546,9 +11312,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13565,9 +11328,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13579,32 +11339,25 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is true after on command - typedef void (*SuccessCallback_11)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_11 = nullptr; - chip::Callback::Callback * mOnFailureCallback_11 = nullptr; - bool mIsFailureExpected_11 = 0; + using SuccessCallback_11 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_11{ + OnTestSendClusterOnOffCommandReadAttribute_11_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_11{ + OnTestSendClusterOnOffCommandReadAttribute_11_FailureResponse, this + }; + bool mIsFailureExpected_11 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_11() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is true after on command: Sending command..."); - mOnFailureCallback_11 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_11_FailureResponse, this); - mOnSuccessCallback_11 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_11_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_11->Cancel(), mOnFailureCallback_11->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_11; - delete mOnSuccessCallback_11; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); return err; } @@ -13615,9 +11368,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13634,9 +11384,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13655,32 +11402,22 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Send Off Command - typedef void (*SuccessCallback_12)(void * context); - chip::Callback::Callback * mOnSuccessCallback_12 = nullptr; - chip::Callback::Callback * mOnFailureCallback_12 = nullptr; - bool mIsFailureExpected_12 = 0; + using SuccessCallback_12 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_12{ OnTestSendClusterOnOffCommandOff_12_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_12{ OnTestSendClusterOnOffCommandOff_12_FailureResponse, + this }; + bool mIsFailureExpected_12 = 0; CHIP_ERROR TestSendClusterOnOffCommandOff_12() { ChipLogProgress(chipTool, "On/Off - Send Off Command: Sending command..."); - mOnFailureCallback_12 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_12_FailureResponse, this); - mOnSuccessCallback_12 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandOff_12_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Off(mOnSuccessCallback_12->Cancel(), mOnFailureCallback_12->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_12; - delete mOnSuccessCallback_12; - } + err = cluster.Off(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); return err; } @@ -13691,9 +11428,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (runner->mIsFailureExpected_12 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13710,9 +11444,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (runner->mIsFailureExpected_12 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13724,32 +11455,25 @@ class Test_TC_OO_2_2 : public TestCommand } // Test Check on/off attribute value is false after off command - typedef void (*SuccessCallback_13)(void * context, uint8_t onOff); - chip::Callback::Callback * mOnSuccessCallback_13 = nullptr; - chip::Callback::Callback * mOnFailureCallback_13 = nullptr; - bool mIsFailureExpected_13 = 0; + using SuccessCallback_13 = void (*)(void * context, uint8_t onOff); + chip::Callback::Callback mOnSuccessCallback_13{ + OnTestSendClusterOnOffCommandReadAttribute_13_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_13{ + OnTestSendClusterOnOffCommandReadAttribute_13_FailureResponse, this + }; + bool mIsFailureExpected_13 = 0; CHIP_ERROR TestSendClusterOnOffCommandReadAttribute_13() { ChipLogProgress(chipTool, "On/Off - Check on/off attribute value is false after off command: Sending command..."); - mOnFailureCallback_13 = new chip::Callback::Callback( - OnTestSendClusterOnOffCommandReadAttribute_13_FailureResponse, this); - mOnSuccessCallback_13 = - new chip::Callback::Callback(OnTestSendClusterOnOffCommandReadAttribute_13_SuccessResponse, this); - chip::Controller::OnOffCluster cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeOnOff(mOnSuccessCallback_13->Cancel(), mOnFailureCallback_13->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_13; - delete mOnSuccessCallback_13; - } + err = cluster.ReadAttributeOnOff(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); return err; } @@ -13760,9 +11484,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (runner->mIsFailureExpected_13 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13779,9 +11500,6 @@ class Test_TC_OO_2_2 : public TestCommand Test_TC_OO_2_2 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (runner->mIsFailureExpected_13 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13894,32 +11612,24 @@ class Test_TC_DM_1_1 : public TestCommand // // Test Query Interaction Model Version - typedef void (*SuccessCallback_0)(void * context, uint16_t interactionModelVersion); - chip::Callback::Callback * mOnSuccessCallback_0 = nullptr; - chip::Callback::Callback * mOnFailureCallback_0 = nullptr; - bool mIsFailureExpected_0 = 0; + using SuccessCallback_0 = void (*)(void * context, uint16_t interactionModelVersion); + chip::Callback::Callback mOnSuccessCallback_0{ OnTestSendClusterBasicCommandReadAttribute_0_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_0{ + OnTestSendClusterBasicCommandReadAttribute_0_FailureResponse, this + }; + bool mIsFailureExpected_0 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_0() { ChipLogProgress(chipTool, "Basic - Query Interaction Model Version: Sending command..."); - mOnFailureCallback_0 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_0_FailureResponse, this); - mOnSuccessCallback_0 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_0_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeInteractionModelVersion(mOnSuccessCallback_0->Cancel(), mOnFailureCallback_0->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_0; - delete mOnSuccessCallback_0; - } + err = cluster.ReadAttributeInteractionModelVersion(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); return err; } @@ -13930,9 +11640,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -13949,9 +11656,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_0; - delete runner->mOnSuccessCallback_0; - if (runner->mIsFailureExpected_0 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -13966,32 +11670,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query Vendor Name - typedef void (*SuccessCallback_1)(void * context, chip::ByteSpan vendorName); - chip::Callback::Callback * mOnSuccessCallback_1 = nullptr; - chip::Callback::Callback * mOnFailureCallback_1 = nullptr; - bool mIsFailureExpected_1 = 0; + using SuccessCallback_1 = void (*)(void * context, chip::ByteSpan vendorName); + chip::Callback::Callback mOnSuccessCallback_1{ OnTestSendClusterBasicCommandReadAttribute_1_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_1{ + OnTestSendClusterBasicCommandReadAttribute_1_FailureResponse, this + }; + bool mIsFailureExpected_1 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_1() { ChipLogProgress(chipTool, "Basic - Query Vendor Name: Sending command..."); - mOnFailureCallback_1 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_1_FailureResponse, this); - mOnSuccessCallback_1 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_1_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeVendorName(mOnSuccessCallback_1->Cancel(), mOnFailureCallback_1->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_1; - delete mOnSuccessCallback_1; - } + err = cluster.ReadAttributeVendorName(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); return err; } @@ -14002,9 +11698,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14021,9 +11714,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_1; - delete runner->mOnSuccessCallback_1; - if (runner->mIsFailureExpected_1 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14044,32 +11734,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query VendorID - typedef void (*SuccessCallback_2)(void * context, uint16_t vendorID); - chip::Callback::Callback * mOnSuccessCallback_2 = nullptr; - chip::Callback::Callback * mOnFailureCallback_2 = nullptr; - bool mIsFailureExpected_2 = 0; + using SuccessCallback_2 = void (*)(void * context, uint16_t vendorID); + chip::Callback::Callback mOnSuccessCallback_2{ OnTestSendClusterBasicCommandReadAttribute_2_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_2{ + OnTestSendClusterBasicCommandReadAttribute_2_FailureResponse, this + }; + bool mIsFailureExpected_2 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_2() { ChipLogProgress(chipTool, "Basic - Query VendorID: Sending command..."); - mOnFailureCallback_2 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_2_FailureResponse, this); - mOnSuccessCallback_2 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_2_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeVendorID(mOnSuccessCallback_2->Cancel(), mOnFailureCallback_2->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_2; - delete mOnSuccessCallback_2; - } + err = cluster.ReadAttributeVendorID(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); return err; } @@ -14080,9 +11762,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14099,9 +11778,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_2; - delete runner->mOnSuccessCallback_2; - if (runner->mIsFailureExpected_2 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14115,32 +11791,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query Product Name - typedef void (*SuccessCallback_3)(void * context, chip::ByteSpan productName); - chip::Callback::Callback * mOnSuccessCallback_3 = nullptr; - chip::Callback::Callback * mOnFailureCallback_3 = nullptr; - bool mIsFailureExpected_3 = 0; + using SuccessCallback_3 = void (*)(void * context, chip::ByteSpan productName); + chip::Callback::Callback mOnSuccessCallback_3{ OnTestSendClusterBasicCommandReadAttribute_3_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_3{ + OnTestSendClusterBasicCommandReadAttribute_3_FailureResponse, this + }; + bool mIsFailureExpected_3 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_3() { ChipLogProgress(chipTool, "Basic - Query Product Name: Sending command..."); - mOnFailureCallback_3 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_3_FailureResponse, this); - mOnSuccessCallback_3 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_3_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeProductName(mOnSuccessCallback_3->Cancel(), mOnFailureCallback_3->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_3; - delete mOnSuccessCallback_3; - } + err = cluster.ReadAttributeProductName(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); return err; } @@ -14151,9 +11819,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14170,9 +11835,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_3; - delete runner->mOnSuccessCallback_3; - if (runner->mIsFailureExpected_3 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14193,32 +11855,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query ProductID - typedef void (*SuccessCallback_4)(void * context, uint16_t productID); - chip::Callback::Callback * mOnSuccessCallback_4 = nullptr; - chip::Callback::Callback * mOnFailureCallback_4 = nullptr; - bool mIsFailureExpected_4 = 0; + using SuccessCallback_4 = void (*)(void * context, uint16_t productID); + chip::Callback::Callback mOnSuccessCallback_4{ OnTestSendClusterBasicCommandReadAttribute_4_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_4{ + OnTestSendClusterBasicCommandReadAttribute_4_FailureResponse, this + }; + bool mIsFailureExpected_4 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_4() { ChipLogProgress(chipTool, "Basic - Query ProductID: Sending command..."); - mOnFailureCallback_4 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_4_FailureResponse, this); - mOnSuccessCallback_4 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_4_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeProductID(mOnSuccessCallback_4->Cancel(), mOnFailureCallback_4->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_4; - delete mOnSuccessCallback_4; - } + err = cluster.ReadAttributeProductID(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); return err; } @@ -14229,9 +11883,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14248,9 +11899,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_4; - delete runner->mOnSuccessCallback_4; - if (runner->mIsFailureExpected_4 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14264,32 +11912,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query User Label - typedef void (*SuccessCallback_5)(void * context, chip::ByteSpan userLabel); - chip::Callback::Callback * mOnSuccessCallback_5 = nullptr; - chip::Callback::Callback * mOnFailureCallback_5 = nullptr; - bool mIsFailureExpected_5 = 0; + using SuccessCallback_5 = void (*)(void * context, chip::ByteSpan userLabel); + chip::Callback::Callback mOnSuccessCallback_5{ OnTestSendClusterBasicCommandReadAttribute_5_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_5{ + OnTestSendClusterBasicCommandReadAttribute_5_FailureResponse, this + }; + bool mIsFailureExpected_5 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_5() { ChipLogProgress(chipTool, "Basic - Query User Label: Sending command..."); - mOnFailureCallback_5 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_5_FailureResponse, this); - mOnSuccessCallback_5 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_5_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeUserLabel(mOnSuccessCallback_5->Cancel(), mOnFailureCallback_5->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_5; - delete mOnSuccessCallback_5; - } + err = cluster.ReadAttributeUserLabel(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); return err; } @@ -14300,9 +11940,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14319,9 +11956,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_5; - delete runner->mOnSuccessCallback_5; - if (runner->mIsFailureExpected_5 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14342,32 +11976,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query User Location - typedef void (*SuccessCallback_6)(void * context, chip::ByteSpan location); - chip::Callback::Callback * mOnSuccessCallback_6 = nullptr; - chip::Callback::Callback * mOnFailureCallback_6 = nullptr; - bool mIsFailureExpected_6 = 0; + using SuccessCallback_6 = void (*)(void * context, chip::ByteSpan location); + chip::Callback::Callback mOnSuccessCallback_6{ OnTestSendClusterBasicCommandReadAttribute_6_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_6{ + OnTestSendClusterBasicCommandReadAttribute_6_FailureResponse, this + }; + bool mIsFailureExpected_6 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_6() { ChipLogProgress(chipTool, "Basic - Query User Location: Sending command..."); - mOnFailureCallback_6 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_6_FailureResponse, this); - mOnSuccessCallback_6 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_6_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeLocation(mOnSuccessCallback_6->Cancel(), mOnFailureCallback_6->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_6; - delete mOnSuccessCallback_6; - } + err = cluster.ReadAttributeLocation(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); return err; } @@ -14378,9 +12004,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14397,9 +12020,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_6; - delete runner->mOnSuccessCallback_6; - if (runner->mIsFailureExpected_6 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14423,32 +12043,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query HardwareVersion - typedef void (*SuccessCallback_7)(void * context, uint16_t hardwareVersion); - chip::Callback::Callback * mOnSuccessCallback_7 = nullptr; - chip::Callback::Callback * mOnFailureCallback_7 = nullptr; - bool mIsFailureExpected_7 = 0; + using SuccessCallback_7 = void (*)(void * context, uint16_t hardwareVersion); + chip::Callback::Callback mOnSuccessCallback_7{ OnTestSendClusterBasicCommandReadAttribute_7_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_7{ + OnTestSendClusterBasicCommandReadAttribute_7_FailureResponse, this + }; + bool mIsFailureExpected_7 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_7() { ChipLogProgress(chipTool, "Basic - Query HardwareVersion: Sending command..."); - mOnFailureCallback_7 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_7_FailureResponse, this); - mOnSuccessCallback_7 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_7_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeHardwareVersion(mOnSuccessCallback_7->Cancel(), mOnFailureCallback_7->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_7; - delete mOnSuccessCallback_7; - } + err = cluster.ReadAttributeHardwareVersion(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); return err; } @@ -14459,9 +12071,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14478,9 +12087,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_7; - delete runner->mOnSuccessCallback_7; - if (runner->mIsFailureExpected_7 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14494,32 +12100,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query HardwareVersionString - typedef void (*SuccessCallback_8)(void * context, chip::ByteSpan hardwareVersionString); - chip::Callback::Callback * mOnSuccessCallback_8 = nullptr; - chip::Callback::Callback * mOnFailureCallback_8 = nullptr; - bool mIsFailureExpected_8 = 0; + using SuccessCallback_8 = void (*)(void * context, chip::ByteSpan hardwareVersionString); + chip::Callback::Callback mOnSuccessCallback_8{ OnTestSendClusterBasicCommandReadAttribute_8_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_8{ + OnTestSendClusterBasicCommandReadAttribute_8_FailureResponse, this + }; + bool mIsFailureExpected_8 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_8() { ChipLogProgress(chipTool, "Basic - Query HardwareVersionString: Sending command..."); - mOnFailureCallback_8 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_8_FailureResponse, this); - mOnSuccessCallback_8 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_8_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeHardwareVersionString(mOnSuccessCallback_8->Cancel(), mOnFailureCallback_8->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_8; - delete mOnSuccessCallback_8; - } + err = cluster.ReadAttributeHardwareVersionString(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); return err; } @@ -14530,9 +12128,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14549,9 +12144,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_8; - delete runner->mOnSuccessCallback_8; - if (runner->mIsFailureExpected_8 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14582,32 +12174,24 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query SoftwareVersion - typedef void (*SuccessCallback_9)(void * context, uint32_t softwareVersion); - chip::Callback::Callback * mOnSuccessCallback_9 = nullptr; - chip::Callback::Callback * mOnFailureCallback_9 = nullptr; - bool mIsFailureExpected_9 = 0; + using SuccessCallback_9 = void (*)(void * context, uint32_t softwareVersion); + chip::Callback::Callback mOnSuccessCallback_9{ OnTestSendClusterBasicCommandReadAttribute_9_SuccessResponse, + this }; + chip::Callback::Callback mOnFailureCallback_9{ + OnTestSendClusterBasicCommandReadAttribute_9_FailureResponse, this + }; + bool mIsFailureExpected_9 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_9() { ChipLogProgress(chipTool, "Basic - Query SoftwareVersion: Sending command..."); - mOnFailureCallback_9 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_9_FailureResponse, this); - mOnSuccessCallback_9 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_9_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeSoftwareVersion(mOnSuccessCallback_9->Cancel(), mOnFailureCallback_9->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_9; - delete mOnSuccessCallback_9; - } + err = cluster.ReadAttributeSoftwareVersion(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); return err; } @@ -14618,9 +12202,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14637,9 +12218,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_9; - delete runner->mOnSuccessCallback_9; - if (runner->mIsFailureExpected_9 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14653,32 +12231,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query SoftwareVersionString - typedef void (*SuccessCallback_10)(void * context, chip::ByteSpan softwareVersionString); - chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; - chip::Callback::Callback * mOnFailureCallback_10 = nullptr; - bool mIsFailureExpected_10 = 0; + using SuccessCallback_10 = void (*)(void * context, chip::ByteSpan softwareVersionString); + chip::Callback::Callback mOnSuccessCallback_10{ + OnTestSendClusterBasicCommandReadAttribute_10_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_10{ + OnTestSendClusterBasicCommandReadAttribute_10_FailureResponse, this + }; + bool mIsFailureExpected_10 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_10() { ChipLogProgress(chipTool, "Basic - Query SoftwareVersionString: Sending command..."); - mOnFailureCallback_10 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_10_FailureResponse, this); - mOnSuccessCallback_10 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_10_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeSoftwareVersionString(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_10; - delete mOnSuccessCallback_10; - } + err = cluster.ReadAttributeSoftwareVersionString(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); return err; } @@ -14689,9 +12260,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); @@ -14708,9 +12276,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_10; - delete runner->mOnSuccessCallback_10; - if (runner->mIsFailureExpected_10 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14744,32 +12309,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query ManufacturingDate - typedef void (*SuccessCallback_11)(void * context, chip::ByteSpan manufacturingDate); - chip::Callback::Callback * mOnSuccessCallback_11 = nullptr; - chip::Callback::Callback * mOnFailureCallback_11 = nullptr; - bool mIsFailureExpected_11 = 0; + using SuccessCallback_11 = void (*)(void * context, chip::ByteSpan manufacturingDate); + chip::Callback::Callback mOnSuccessCallback_11{ + OnTestSendClusterBasicCommandReadAttribute_11_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_11{ + OnTestSendClusterBasicCommandReadAttribute_11_FailureResponse, this + }; + bool mIsFailureExpected_11 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_11() { ChipLogProgress(chipTool, "Basic - Query ManufacturingDate: Sending command..."); - mOnFailureCallback_11 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_11_FailureResponse, this); - mOnSuccessCallback_11 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_11_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeManufacturingDate(mOnSuccessCallback_11->Cancel(), mOnFailureCallback_11->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_11; - delete mOnSuccessCallback_11; - } + err = cluster.ReadAttributeManufacturingDate(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); return err; } @@ -14780,9 +12338,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -14805,9 +12360,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_11; - delete runner->mOnSuccessCallback_11; - if (runner->mIsFailureExpected_11 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14838,32 +12390,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query PartNumber - typedef void (*SuccessCallback_12)(void * context, chip::ByteSpan partNumber); - chip::Callback::Callback * mOnSuccessCallback_12 = nullptr; - chip::Callback::Callback * mOnFailureCallback_12 = nullptr; - bool mIsFailureExpected_12 = 0; + using SuccessCallback_12 = void (*)(void * context, chip::ByteSpan partNumber); + chip::Callback::Callback mOnSuccessCallback_12{ + OnTestSendClusterBasicCommandReadAttribute_12_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_12{ + OnTestSendClusterBasicCommandReadAttribute_12_FailureResponse, this + }; + bool mIsFailureExpected_12 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_12() { ChipLogProgress(chipTool, "Basic - Query PartNumber: Sending command..."); - mOnFailureCallback_12 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_12_FailureResponse, this); - mOnSuccessCallback_12 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_12_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributePartNumber(mOnSuccessCallback_12->Cancel(), mOnFailureCallback_12->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_12; - delete mOnSuccessCallback_12; - } + err = cluster.ReadAttributePartNumber(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); return err; } @@ -14874,9 +12419,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -14899,9 +12441,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_12; - delete runner->mOnSuccessCallback_12; - if (runner->mIsFailureExpected_12 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -14922,32 +12461,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query ProductURL - typedef void (*SuccessCallback_13)(void * context, chip::ByteSpan productURL); - chip::Callback::Callback * mOnSuccessCallback_13 = nullptr; - chip::Callback::Callback * mOnFailureCallback_13 = nullptr; - bool mIsFailureExpected_13 = 0; + using SuccessCallback_13 = void (*)(void * context, chip::ByteSpan productURL); + chip::Callback::Callback mOnSuccessCallback_13{ + OnTestSendClusterBasicCommandReadAttribute_13_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_13{ + OnTestSendClusterBasicCommandReadAttribute_13_FailureResponse, this + }; + bool mIsFailureExpected_13 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_13() { ChipLogProgress(chipTool, "Basic - Query ProductURL: Sending command..."); - mOnFailureCallback_13 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_13_FailureResponse, this); - mOnSuccessCallback_13 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_13_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeProductURL(mOnSuccessCallback_13->Cancel(), mOnFailureCallback_13->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_13; - delete mOnSuccessCallback_13; - } + err = cluster.ReadAttributeProductURL(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); return err; } @@ -14958,9 +12490,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -14983,9 +12512,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_13; - delete runner->mOnSuccessCallback_13; - if (runner->mIsFailureExpected_13 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -15008,32 +12534,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query ProductLabel - typedef void (*SuccessCallback_14)(void * context, chip::ByteSpan productLabel); - chip::Callback::Callback * mOnSuccessCallback_14 = nullptr; - chip::Callback::Callback * mOnFailureCallback_14 = nullptr; - bool mIsFailureExpected_14 = 0; + using SuccessCallback_14 = void (*)(void * context, chip::ByteSpan productLabel); + chip::Callback::Callback mOnSuccessCallback_14{ + OnTestSendClusterBasicCommandReadAttribute_14_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_14{ + OnTestSendClusterBasicCommandReadAttribute_14_FailureResponse, this + }; + bool mIsFailureExpected_14 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_14() { ChipLogProgress(chipTool, "Basic - Query ProductLabel: Sending command..."); - mOnFailureCallback_14 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_14_FailureResponse, this); - mOnSuccessCallback_14 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_14_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeProductLabel(mOnSuccessCallback_14->Cancel(), mOnFailureCallback_14->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_14; - delete mOnSuccessCallback_14; - } + err = cluster.ReadAttributeProductLabel(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); return err; } @@ -15044,9 +12563,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_14; - delete runner->mOnSuccessCallback_14; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -15069,9 +12585,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_14; - delete runner->mOnSuccessCallback_14; - if (runner->mIsFailureExpected_14 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -15092,32 +12605,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query SerialNumber - typedef void (*SuccessCallback_15)(void * context, chip::ByteSpan serialNumber); - chip::Callback::Callback * mOnSuccessCallback_15 = nullptr; - chip::Callback::Callback * mOnFailureCallback_15 = nullptr; - bool mIsFailureExpected_15 = 0; + using SuccessCallback_15 = void (*)(void * context, chip::ByteSpan serialNumber); + chip::Callback::Callback mOnSuccessCallback_15{ + OnTestSendClusterBasicCommandReadAttribute_15_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_15{ + OnTestSendClusterBasicCommandReadAttribute_15_FailureResponse, this + }; + bool mIsFailureExpected_15 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_15() { ChipLogProgress(chipTool, "Basic - Query SerialNumber: Sending command..."); - mOnFailureCallback_15 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_15_FailureResponse, this); - mOnSuccessCallback_15 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_15_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeSerialNumber(mOnSuccessCallback_15->Cancel(), mOnFailureCallback_15->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_15; - delete mOnSuccessCallback_15; - } + err = cluster.ReadAttributeSerialNumber(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); return err; } @@ -15128,9 +12634,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_15; - delete runner->mOnSuccessCallback_15; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -15153,9 +12656,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_15; - delete runner->mOnSuccessCallback_15; - if (runner->mIsFailureExpected_15 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -15176,32 +12676,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query LocalConfigDisabled - typedef void (*SuccessCallback_16)(void * context, uint8_t localConfigDisabled); - chip::Callback::Callback * mOnSuccessCallback_16 = nullptr; - chip::Callback::Callback * mOnFailureCallback_16 = nullptr; - bool mIsFailureExpected_16 = 0; + using SuccessCallback_16 = void (*)(void * context, uint8_t localConfigDisabled); + chip::Callback::Callback mOnSuccessCallback_16{ + OnTestSendClusterBasicCommandReadAttribute_16_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_16{ + OnTestSendClusterBasicCommandReadAttribute_16_FailureResponse, this + }; + bool mIsFailureExpected_16 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_16() { ChipLogProgress(chipTool, "Basic - Query LocalConfigDisabled: Sending command..."); - mOnFailureCallback_16 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_16_FailureResponse, this); - mOnSuccessCallback_16 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_16_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeLocalConfigDisabled(mOnSuccessCallback_16->Cancel(), mOnFailureCallback_16->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_16; - delete mOnSuccessCallback_16; - } + err = cluster.ReadAttributeLocalConfigDisabled(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel()); return err; } @@ -15212,9 +12705,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_16; - delete runner->mOnSuccessCallback_16; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -15237,9 +12727,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_16; - delete runner->mOnSuccessCallback_16; - if (runner->mIsFailureExpected_16 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); @@ -15253,32 +12740,25 @@ class Test_TC_DM_1_1 : public TestCommand } // Test Query Reachable - typedef void (*SuccessCallback_17)(void * context, uint8_t reachable); - chip::Callback::Callback * mOnSuccessCallback_17 = nullptr; - chip::Callback::Callback * mOnFailureCallback_17 = nullptr; - bool mIsFailureExpected_17 = 0; + using SuccessCallback_17 = void (*)(void * context, uint8_t reachable); + chip::Callback::Callback mOnSuccessCallback_17{ + OnTestSendClusterBasicCommandReadAttribute_17_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_17{ + OnTestSendClusterBasicCommandReadAttribute_17_FailureResponse, this + }; + bool mIsFailureExpected_17 = 0; CHIP_ERROR TestSendClusterBasicCommandReadAttribute_17() { ChipLogProgress(chipTool, "Basic - Query Reachable: Sending command..."); - mOnFailureCallback_17 = new chip::Callback::Callback( - OnTestSendClusterBasicCommandReadAttribute_17_FailureResponse, this); - mOnSuccessCallback_17 = - new chip::Callback::Callback(OnTestSendClusterBasicCommandReadAttribute_17_SuccessResponse, this); - chip::Controller::BasicCluster cluster; cluster.Associate(mDevice, 0); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeReachable(mOnSuccessCallback_17->Cancel(), mOnFailureCallback_17->Cancel()); - - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_17; - delete mOnSuccessCallback_17; - } + err = cluster.ReadAttributeReachable(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel()); return err; } @@ -15289,9 +12769,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_17; - delete runner->mOnSuccessCallback_17; - if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -15314,9 +12791,6 @@ class Test_TC_DM_1_1 : public TestCommand Test_TC_DM_1_1 * runner = reinterpret_cast(context); - delete runner->mOnFailureCallback_17; - delete runner->mOnSuccessCallback_17; - if (runner->mIsFailureExpected_17 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 21f432801f454c..f11d03d371bacc 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -46,18 +46,15 @@ class {{filename}}: public TestCommand {{#chip_tests_items}} // Test {{label}} - typedef void (*SuccessCallback_{{index}})(void * context{{#chip_tests_item_response_parameters}}, {{#if isList}}uint16_t count, {{/if}}{{chipType}} {{#if isList}}* {{/if}}{{asCamelCased name true}}{{/chip_tests_item_response_parameters}}); - chip::Callback::Callback * mOnSuccessCallback_{{index}} = nullptr; - chip::Callback::Callback * mOnFailureCallback_{{index}} = nullptr; + using SuccessCallback_{{index}} = void (*)(void * context{{#chip_tests_item_response_parameters}}, {{#if isList}}uint16_t count, {{/if}}{{chipType}} {{#if isList}}* {{/if}}{{asCamelCased name true}}{{/chip_tests_item_response_parameters}}); + chip::Callback::Callback mOnSuccessCallback_{{index}} { OnTestSendCluster{{asCamelCased cluster false}}Command{{asCamelCased command false}}_{{index}}_SuccessResponse, this }; + chip::Callback::Callback mOnFailureCallback_{{index}} { OnTestSendCluster{{asCamelCased cluster false}}Command{{asCamelCased command false}}_{{index}}_FailureResponse, this }; bool mIsFailureExpected_{{index}} = {{response.error}}; CHIP_ERROR TestSendCluster{{asCamelCased cluster false}}Command{{asCamelCased command false}}_{{index}}() { ChipLogProgress(chipTool, "{{cluster}} - {{label}}: Sending command..."); - mOnFailureCallback_{{index}} = new chip::Callback::Callback(OnTestSendCluster{{asCamelCased cluster false}}Command{{asCamelCased command false}}_{{index}}_FailureResponse, this); - mOnSuccessCallback_{{index}} = new chip::Callback::Callback(OnTestSendCluster{{asCamelCased cluster false}}Command{{asCamelCased command false}}_{{index}}_SuccessResponse, this); - chip::Controller::{{asCamelCased cluster false}}Cluster cluster; cluster.Associate(mDevice, {{endpoint}}); @@ -71,9 +68,9 @@ class {{filename}}: public TestCommand {{chipType}} {{asCamelCased name true}}Argument = {{definedValue}}{{asTypeLiteralSuffix chipType}}; {{/if}} {{/chip_tests_item_parameters}} - err = cluster.{{asCamelCased command false}}(mOnSuccessCallback_{{index}}->Cancel(), mOnFailureCallback_{{index}}->Cancel(){{#chip_tests_item_parameters}}, {{asCamelCased name true}}Argument{{/chip_tests_item_parameters}}); + err = cluster.{{asCamelCased command false}}(mOnSuccessCallback_{{index}}.Cancel(), mOnFailureCallback_{{index}}.Cancel(){{#chip_tests_item_parameters}}, {{asCamelCased name true}}Argument{{/chip_tests_item_parameters}}); {{else if isReadAttribute}} - err = cluster.ReadAttribute{{asCamelCased attribute false}}(mOnSuccessCallback_{{index}}->Cancel(), mOnFailureCallback_{{index}}->Cancel()); + err = cluster.ReadAttribute{{asCamelCased attribute false}}(mOnSuccessCallback_{{index}}.Cancel(), mOnFailureCallback_{{index}}.Cancel()); {{else if isWriteAttribute}} {{#chip_tests_item_parameters}} {{#if (isString type)}} @@ -82,17 +79,11 @@ class {{filename}}: public TestCommand {{chipType}} {{asCamelCased name true}}Argument = {{definedValue}}{{asTypeLiteralSuffix chipType}}; {{/if}} {{/chip_tests_item_parameters}} - err = cluster.WriteAttribute{{asCamelCased attribute false}}(mOnSuccessCallback_{{index}}->Cancel(), mOnFailureCallback_{{index}}->Cancel(), {{#chip_tests_item_parameters}}{{asCamelCased name true}}Argument{{/chip_tests_item_parameters}}); + err = cluster.WriteAttribute{{asCamelCased attribute false}}(mOnSuccessCallback_{{index}}.Cancel(), mOnFailureCallback_{{index}}.Cancel(), {{#chip_tests_item_parameters}}{{asCamelCased name true}}Argument{{/chip_tests_item_parameters}}); {{else}} err = CHIP_ERROR_NOT_IMPLEMENTED; {{/if}} - if (CHIP_NO_ERROR != err) - { - delete mOnFailureCallback_{{index}}; - delete mOnSuccessCallback_{{index}}; - } - return err; } @@ -102,9 +93,6 @@ class {{filename}}: public TestCommand {{parent.filename}} * runner = reinterpret_cast<{{parent.filename}} *>(context); - delete runner->mOnFailureCallback_{{index}}; - delete runner->mOnSuccessCallback_{{index}}; - {{#if optional}} if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { runner->NextTest(); @@ -127,9 +115,6 @@ class {{filename}}: public TestCommand {{parent.filename}} * runner = reinterpret_cast<{{parent.filename}} *>(context); - delete runner->mOnFailureCallback_{{index}}; - delete runner->mOnSuccessCallback_{{index}}; - if (runner->mIsFailureExpected_{{index}} == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); From 26e1a0642b293e842891007a7d75d42b31a7a762 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 12:08:07 -0400 Subject: [PATCH 31/47] Add write roundtrip test (#8169) * Refactor TestWriteInteraction to use a MessagingContext. This allows us to test more details of the messages being sent. * Add a roundtrip test to TestWriteInteraction. Various fixups needed for that: 1) Make InteractionModelEngine::Shutdown actually remove the object as an unsolicited message handler. 2) Initialize WriteHandler's state properly so it's not random whether we think we have available WriteHandlers. 3) Fix TestWriteInteraction::AddAttributeDataElement to use the right tag (2, not 1) for its data. 4) Stop trying to run AppTests in QEMU, because of linking/compilation issues in that setup. --- scripts/tests/esp32_qemu_tests.sh | 16 ++- src/app/InteractionModelEngine.cpp | 2 + src/app/WriteHandler.h | 2 +- src/app/tests/BUILD.gn | 2 + src/app/tests/TestWriteInteraction.cpp | 154 ++++++++++++++++++------- 5 files changed, 128 insertions(+), 48 deletions(-) diff --git a/scripts/tests/esp32_qemu_tests.sh b/scripts/tests/esp32_qemu_tests.sh index da4bc967d05280..92bc1144027919 100755 --- a/scripts/tests/esp32_qemu_tests.sh +++ b/scripts/tests/esp32_qemu_tests.sh @@ -42,16 +42,16 @@ if [ $? -ne 0 ]; then fi really_run_suite() { - idf scripts/tools/qemu_run_test.sh src/test_driver/esp32/build/chip "$1" "$2" + idf scripts/tools/qemu_run_test.sh src/test_driver/esp32/build/chip "$@" } run_suite() { if [[ -d "${log_dir}" ]]; then suite=${1%.a} suite=${suite#lib} - really_run_suite "$1" "$2" |& tee "$log_dir/$suite.log" + really_run_suite "$@" |& tee "$log_dir/$suite.log" else - really_run_suite "$1" "$2" + really_run_suite "$@" fi } @@ -61,7 +61,15 @@ run_suite() { SUITES=( ) -run_suite libAppTests.a +# TODO: libAppTests depends on MessagingTestHelpers, which depends on +# NetworkTestHelpers. That sort of depends on InetTestHelpers or +# equivalent (to provide gSystemLayer, gInet, InitNetwork(), +# ShutdownNetwork()) but there's only a POSIX implementation of that +# last, which does not compile on ESP32. Need to figure out how to +# make that work. See comments below for the transport layer tests, +# which have the same issue. +# run_suite libAppTests.a -lMessagingTestHelpers -lNetworkTestHelpers + run_suite libASN1Tests.a run_suite libBleLayerTests.a run_suite libCoreTests.a diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 7697bfed89e4fd..73b87bba2a1af4 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -116,6 +116,8 @@ void InteractionModelEngine::Shutdown() } mpNextAvailableClusterInfo = nullptr; + + mpExchangeMgr->UnregisterUnsolicitedMessageHandlerForProtocol(Protocols::InteractionModel::Id); } CHIP_ERROR InteractionModelEngine::NewCommandSender(CommandSender ** const apCommandSender) diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index cd731f94464b1b..2f4766582e6db7 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -106,7 +106,7 @@ class WriteHandler InteractionModelDelegate * mpDelegate = nullptr; WriteResponse::Builder mWriteResponseBuilder; System::PacketBufferTLVWriter mMessageWriter; - State mState; + State mState = State::Uninitialized; }; } // namespace app } // namespace chip diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 738f4dd87d2dc1..53053889538fb6 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -41,7 +41,9 @@ chip_test_suite("tests") { "${chip_root}/src/app", "${chip_root}/src/app/util:device_callbacks_manager", "${chip_root}/src/lib/core", + "${chip_root}/src/messaging/tests:helpers", "${chip_root}/src/protocols", + "${chip_root}/src/transport/raw/tests:helpers", "${nlunit_test_root}:nlunit-test", ] } diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 33967869fadc20..84fcfc533b5a18 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -33,16 +34,17 @@ #include #include #include +#include #include namespace { -chip::System::Layer gSystemLayer; -chip::SecureSessionMgr gSessionManager; -chip::Messaging::ExchangeManager gExchangeManager; -chip::TransportMgr gTransportManager; -chip::secure_channel::MessageCounterManager gMessageCounterManager; -chip::Transport::AdminId gAdminId = 0; +chip::TransportMgrBase gTransportManager; +chip::Test::LoopbackTransport gLoopback; + +using TestContext = chip::Test::MessagingContext; +TestContext sContext; + } // namespace namespace chip { namespace app { @@ -51,6 +53,7 @@ class TestWriteInteraction public: static void TestWriteClient(nlTestSuite * apSuite, void * apContext); static void TestWriteHandler(nlTestSuite * apSuite, void * apContext); + static void TestWriteRoundtrip(nlTestSuite * apSuite, void * apContext); private: static void AddAttributeDataElement(nlTestSuite * apSuite, void * apContext, WriteClient & aWriteClient); @@ -86,7 +89,7 @@ void TestWriteInteraction::AddAttributeDataElement(nlTestSuite * apSuite, void * chip::TLV::TLVWriter * writer = aWriteClient.GetAttributeDataElementTLVWriter(); - err = writer->PutBoolean(chip::TLV::ContextTag(1), true); + err = writer->PutBoolean(chip::TLV::ContextTag(chip::app::AttributeDataElement::kCsTag_Data), true); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = aWriteClient.FinishAttribute(); @@ -198,18 +201,21 @@ void TestWriteInteraction::GenerateWriteResponse(nlTestSuite * apSuite, void * a void TestWriteInteraction::TestWriteClient(nlTestSuite * apSuite, void * apContext) { + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; app::WriteClient writeClient; chip::app::InteractionModelDelegate delegate; System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - err = writeClient.Init(&gExchangeManager, &delegate); + err = writeClient.Init(&ctx.GetExchangeManager(), &delegate); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); AddAttributeDataElement(apSuite, apContext, writeClient); - err = writeClient.SendWriteRequest(kTestDeviceNodeId, gAdminId, nullptr); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_NOT_CONNECTED); + SecureSessionHandle session = ctx.GetSessionLocalToPeer(); + err = writeClient.SendWriteRequest(ctx.GetDestinationNodeId(), ctx.GetAdminId(), &session); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); GenerateWriteResponse(apSuite, apContext, buf); @@ -221,6 +227,8 @@ void TestWriteInteraction::TestWriteClient(nlTestSuite * apSuite, void * apConte void TestWriteInteraction::TestWriteHandler(nlTestSuite * apSuite, void * apContext) { + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; app::WriteHandler writeHandler; @@ -236,43 +244,72 @@ void TestWriteInteraction::TestWriteHandler(nlTestSuite * apSuite, void * apCont AddAttributeStatus(apSuite, apContext, writeHandler); - writeHandler.mpExchangeCtx = gExchangeManager.NewContext({ 0, 0, 0 }, nullptr); TestExchangeDelegate delegate; - writeHandler.mpExchangeCtx->SetDelegate(&delegate); - err = writeHandler.SendWriteResponse(); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_NOT_CONNECTED); + writeHandler.mpExchangeCtx = ctx.NewExchangeToLocal(&delegate); + err = writeHandler.SendWriteResponse(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); writeHandler.Shutdown(); } -} // namespace app -} // namespace chip -namespace { +CHIP_ERROR WriteSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVReader & aReader, WriteHandler * aWriteHandler) +{ + return aWriteHandler->AddAttributeStatusCode( + AttributePathParams(aClusterInfo.mNodeId, aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mFieldId, + aClusterInfo.mListIndex, AttributePathParams::Flags::kFieldIdValid), + Protocols::SecureChannel::GeneralStatusCode::kSuccess, Protocols::SecureChannel::Id, + Protocols::InteractionModel::ProtocolCode::Success); +} -void InitializeChip(nlTestSuite * apSuite) +class RoundtripDelegate : public chip::app::InteractionModelDelegate { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Optional peer(chip::Transport::Type::kUndefined); - chip::Transport::AdminPairingTable admins; - chip::Transport::AdminPairingInfo * adminInfo = admins.AssignAdminId(gAdminId, chip::kTestDeviceNodeId); +public: + CHIP_ERROR WriteResponseStatus(const WriteClient * apWriteClient, + const Protocols::SecureChannel::GeneralStatusCode aGeneralCode, const uint32_t aProtocolId, + const uint16_t aProtocolCode, AttributePathParams & aAttributePathParams, + uint8_t aCommandIndex) override + { + mGotResponse = true; + return CHIP_NO_ERROR; + } - NL_TEST_ASSERT(apSuite, adminInfo != nullptr); + bool mGotResponse = false; +}; - err = chip::Platform::MemoryInit(); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); +void TestWriteInteraction::TestWriteRoundtrip(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); - gSystemLayer.Init(nullptr); + CHIP_ERROR err = CHIP_NO_ERROR; - err = gSessionManager.Init(chip::kTestDeviceNodeId, &gSystemLayer, &gTransportManager, &admins, &gMessageCounterManager); + RoundtripDelegate delegate; + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + err = engine->Init(&ctx.GetExchangeManager(), &delegate); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = gExchangeManager.Init(&gSessionManager); + app::WriteClient * writeClient; + err = engine->NewWriteClient(&writeClient); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = gMessageCounterManager.Init(&gExchangeManager); + System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); + AddAttributeDataElement(apSuite, apContext, *writeClient); + + NL_TEST_ASSERT(apSuite, !delegate.mGotResponse); + + SecureSessionHandle session = ctx.GetSessionLocalToPeer(); + err = writeClient->SendWriteRequest(ctx.GetDestinationNodeId(), ctx.GetAdminId(), &session); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(apSuite, delegate.mGotResponse); + + engine->Shutdown(); } +} // namespace app +} // namespace chip + +namespace { + /** * Test Suite. It lists all the test functions. */ @@ -282,28 +319,59 @@ const nlTest sTests[] = { NL_TEST_DEF("CheckWriteClient", chip::app::TestWriteInteraction::TestWriteClient), NL_TEST_DEF("CheckWriteHandler", chip::app::TestWriteInteraction::TestWriteHandler), + NL_TEST_DEF("CheckWriteRoundtrip", chip::app::TestWriteInteraction::TestWriteRoundtrip), NL_TEST_SENTINEL() }; // clang-format on -} // namespace -int TestWriteInteraction() +int Initialize(void * aContext); +int Finalize(void * aContext); + +// clang-format off +nlTestSuite sSuite = +{ + "TestWriteInteraction", + &sTests[0], + Initialize, + Finalize +}; +// clang-format on + +int Initialize(void * aContext) +{ + CHIP_ERROR err = chip::Platform::MemoryInit(); + if (err != CHIP_NO_ERROR) + { + return FAILURE; + } + + gTransportManager.Init(&gLoopback); + + auto * ctx = static_cast(aContext); + err = ctx->Init(&sSuite, &gTransportManager); + if (err != CHIP_NO_ERROR) + { + return FAILURE; + } + + gTransportManager.SetSecureSessionMgr(&ctx->GetSecureSessionManager()); + return SUCCESS; +} + +int Finalize(void * aContext) { - // clang-format off - nlTestSuite theSuite = - { - "TestWriteInteraction", - &sTests[0], - nullptr, - nullptr - }; - // clang-format on + CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); + chip::Platform::MemoryShutdown(); + return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; +} - InitializeChip(&theSuite); +} // namespace - nlTestRunner(&theSuite, nullptr); +int TestWriteInteraction() +{ + nlTestRunner(&sSuite, &sContext); - return (nlTestRunnerStats(&theSuite)); + return (nlTestRunnerStats(&sSuite)); } CHIP_REGISTER_TEST_SUITE(TestWriteInteraction) From 062e67ced63fcc42556e9ca0bf3cf37d0cf4de33 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 12:08:26 -0400 Subject: [PATCH 32/47] Add ci for disabled progress logging (#8239) * Add CI for disabling progress logging. This requires fixing the build failures when progress logging is disabled * Regenerate generated files --- .github/workflows/build.yaml | 3 +- .../gen/IMClusterCommandHandler.cpp | 72 +++++++++++++++++ .../gen/IMClusterCommandHandler.cpp | 24 ++++++ examples/bridge-app/linux/main.cpp | 3 + .../gen/IMClusterCommandHandler.cpp | 28 +++++++ .../gen/IMClusterCommandHandler.cpp | 20 +++++ .../pump-common/gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 28 +++++++ .../gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 20 +++++ .../main/gen/IMClusterCommandHandler.cpp | 16 ++++ .../tv-common/gen/IMClusterCommandHandler.cpp | 80 +++++++++++++++++++ .../common/gen/IMClusterCommandHandler.cpp | 16 ++++ .../app/CHIPClientCallbacks-src.zapt | 40 +++++++++- .../app/im-cluster-command-handler.zapt | 4 + .../data_model/gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 64 +++++++++++++++ src/lib/support/PrivateHeap.cpp | 5 +- 18 files changed, 522 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 86f382d23a0b06..f80ddca9605db7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,8 +30,7 @@ jobs: strategy: matrix: - type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental, no_detail_logging] - # Disabling progress logging does not compile yet. Once it does, we can add the no_progress_logging type. + type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental, no_detail_logging, no_progress_logging] env: BUILD_TYPE: ${{ matrix.type }} DETAIL_LOGGING: ${{ matrix.type != 'no_detail_logging' && matrix.type != 'no_progress_logging' }} 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 82717af09c0512..b797fd78cc7a90 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp @@ -147,6 +147,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -196,6 +200,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -387,6 +395,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1862,6 +1874,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1982,6 +1998,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3389,6 +3409,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3585,6 +3609,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3951,6 +3979,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4063,6 +4095,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4177,6 +4213,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4707,6 +4747,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4762,6 +4806,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5451,6 +5499,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5733,6 +5785,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5800,6 +5856,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6307,6 +6367,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6808,6 +6872,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6875,6 +6943,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp index fc432b8ce06ea7..d38073cab002f5 100644 --- a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp +++ b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -879,6 +887,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1568,6 +1580,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1635,6 +1651,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2142,6 +2162,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 9fde456358579f..546a660635f80e 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -173,6 +173,9 @@ int RemoveDeviceEndpoint(Device * dev) EndpointId ep = emberAfClearDynamicEndpoint(index); gDevices[index] = NULL; ChipLogProgress(DeviceLayer, "Removed device %s from dynamic endpoint %d (index=%d)", dev->GetName(), ep, index); + // Silence complaints about unused ep when progress logging + // disabled. + UNUSED_VAR(ep); return index; } index++; diff --git a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp index 65c6094a928613..7f1fa2476e364e 100644 --- a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp +++ b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp @@ -1508,6 +1508,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1628,6 +1632,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1824,6 +1832,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2354,6 +2366,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3043,6 +3059,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3110,6 +3130,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3617,6 +3641,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp index e8c9315d5208b4..19b8a097585ded 100644 --- a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp +++ b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1038,6 +1046,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1105,6 +1117,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1612,6 +1628,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index 3b35be20e9df17..aae9a2dd29cdc8 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp index febb1b9a966462..6bd6b21e80acca 100644 --- a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp @@ -82,6 +82,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -202,6 +206,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -398,6 +406,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -928,6 +940,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1558,6 +1574,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1625,6 +1645,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2132,6 +2156,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp index 3b35be20e9df17..aae9a2dd29cdc8 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp index 1c8c7bbd5e9454..bf82f77b296a15 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp @@ -82,6 +82,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -202,6 +206,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -398,6 +406,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1087,6 +1099,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1594,6 +1610,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp index fb15bcd6e7ef2e..d52e41fba9e81b 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp +++ b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -896,6 +904,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1403,6 +1415,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index efea4bf345d44a..8f536b1a5f35b0 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -209,6 +209,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -317,6 +321,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -436,6 +444,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -608,6 +620,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -657,6 +673,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -848,6 +868,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1028,6 +1052,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1148,6 +1176,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1344,6 +1376,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1452,6 +1488,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1982,6 +2022,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2037,6 +2081,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2221,6 +2269,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2495,6 +2547,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3184,6 +3240,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3466,6 +3526,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3533,6 +3597,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4040,6 +4108,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4271,6 +4343,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4384,6 +4460,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/window-app/common/gen/IMClusterCommandHandler.cpp b/examples/window-app/common/gen/IMClusterCommandHandler.cpp index 1b78fe594c92d5..05906ec757605b 100644 --- a/examples/window-app/common/gen/IMClusterCommandHandler.cpp +++ b/examples/window-app/common/gen/IMClusterCommandHandler.cpp @@ -229,6 +229,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -918,6 +922,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1425,6 +1433,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1738,6 +1750,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 2d79881351c2ed..02d1f8103d2a65 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -496,14 +496,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -541,6 +539,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); cb->mCall(cb->mContext, status); @@ -583,10 +586,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); cb->mCall(cb->mContext, status); @@ -622,12 +635,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -672,10 +695,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index d5b734378581bb..72e95e2a146afe 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -77,6 +77,10 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index f45bfa7764f20a..95eb2c0adb127e 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp index 8503d1ae5e6f40..7970ebafef17db 100644 --- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp +++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp @@ -142,6 +142,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -256,6 +260,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -435,6 +443,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1962,6 +1974,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2206,6 +2222,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2518,6 +2538,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2626,6 +2650,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2734,6 +2762,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3432,6 +3464,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4011,6 +4047,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4217,6 +4257,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4492,6 +4536,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4964,6 +5012,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5077,6 +5129,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5191,6 +5247,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5299,6 +5359,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/lib/support/PrivateHeap.cpp b/src/lib/support/PrivateHeap.cpp index b4c45352781d6b..b900470fb7591c 100644 --- a/src/lib/support/PrivateHeap.cpp +++ b/src/lib/support/PrivateHeap.cpp @@ -313,9 +313,8 @@ extern "C" void PrivateHeapDump(void * top) ChipLogProgress(Support, "========= HEAP ==========="); while (header->nextBytes != kInvalidHeapBlockSize) { - intptr_t offset = reinterpret_cast(header) - reinterpret_cast(top); - ChipLogProgress(Support, " %ld: size: %d, state: %d", static_cast(offset), static_cast(header->nextBytes), - static_cast(header->state)); + ChipLogProgress(Support, " %td: size: %d, state: %d", reinterpret_cast(header) - reinterpret_cast(top), + static_cast(header->nextBytes), static_cast(header->state)); header = NextHeader(header); } From 810727b6dbf445a165b871d1d813d4587ecd134a Mon Sep 17 00:00:00 2001 From: Janus Date: Fri, 9 Jul 2021 19:05:10 +0200 Subject: [PATCH 33/47] pressurement cluster again (#7996) * pressurement cluster again * moved xml file to proper folder * adding dropped ranges (again) * added default values * scaled tolerance unsigned * removed ranges not in spec * trying to remove this, to see if we can pass the ci * fix xml errors * Update src/app/zap-templates/zcl/data-model/silabs/ha.xml --- .../chip/pressure-measurement-cluster.xml | 39 +++++++++++++++++++ .../zcl/data-model/silabs/ha.xml | 23 ----------- src/app/zap-templates/zcl/zcl.json | 1 + 3 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml diff --git a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml new file mode 100644 index 00000000000000..cea8c8cc9a3345 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml @@ -0,0 +1,39 @@ + + + + + + Pressure Measurement + Measurement & Sensing + Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. + 0x0403 + PRESSURE_MEASUREMENT_CLUSTER + true + true + + measured value + min measured value + max measured value + tolerance + scaled value + min scaled value + max scaled value + scaled tolerance + scale + + + diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index ec335aab92acd1..9c4d5ebed26798 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -451,29 +451,6 @@ limitations under the License. illuminance level target - - Pressure Measurement - Measurement & Sensing - Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. - 0x0403 - PRESSURE_MEASUREMENT_CLUSTER - true - true - - measured value - - min measured value - - max measured value - - tolerance - - scaled value - min scaled value - max scaled value - scaled tolerance - scale - Occupancy Sensing Measurement & Sensing diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c815316b83846c..a99690c3a0cd01 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -28,6 +28,7 @@ "media-input-cluster.xml", "media-playback-cluster.xml", "operational-credentials-cluster.xml", + "pressure-measurement-cluster.xml", "pump-configuration-and-control-cluster.xml", "pump-controller-device.xml", "pump-device.xml", From 77c2e75a00f190971dcc098d4013df379833ad76 Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Fri, 9 Jul 2021 10:05:55 -0700 Subject: [PATCH 34/47] Updated OpCerts Top-Level tag to Anonymouse (#8251) According to the spec a stand alone operational certificate structure/array shall use anonymous tag. When used in contexts that need tag-based disambiguation would need to specify a different tag to use. --- src/credentials/CHIPCert.cpp | 18 +- src/credentials/CHIPCert.h | 4 - src/credentials/CHIPCertFromX509.cpp | 13 +- src/credentials/CHIPCertToX509.cpp | 3 +- .../tests/CHIPCert_test_vectors.cpp | 431 +++++++++--------- src/tools/chip-cert/CertUtils.cpp | 8 +- 6 files changed, 224 insertions(+), 253 deletions(-) diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 81d33c9c2a8f68..77724ef67f4bac 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -153,7 +153,6 @@ CHIP_ERROR ChipCertificateSet::LoadCert(const uint8_t * chipCert, uint32_t chipC uint64_t tag; reader.Init(chipCert, chipCertLen); - reader.ImplicitProfileId = Protocols::OpCredentials::Id.ToTLVProfileId(); err = reader.Next(); SuccessOrExit(err); @@ -161,12 +160,8 @@ CHIP_ERROR ChipCertificateSet::LoadCert(const uint8_t * chipCert, uint32_t chipC type = reader.GetType(); tag = reader.GetTag(); - VerifyOrExit( - (type == kTLVType_Structure && - (tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate) || tag == AnonymousTag)) || - (type == kTLVType_Array && - (tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificateArray) || tag == AnonymousTag)), - err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrExit((type == kTLVType_Structure || type == kTLVType_Array) && (tag == AnonymousTag), + err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); err = LoadCert(reader, decodeFlags, ByteSpan(chipCert, chipCertLen)); @@ -257,7 +252,6 @@ CHIP_ERROR ChipCertificateSet::LoadCerts(const uint8_t * chipCerts, uint32_t chi uint64_t tag; reader.Init(chipCerts, chipCertsLen); - reader.ImplicitProfileId = Protocols::OpCredentials::Id.ToTLVProfileId(); err = reader.Next(); SuccessOrExit(err); @@ -265,12 +259,8 @@ CHIP_ERROR ChipCertificateSet::LoadCerts(const uint8_t * chipCerts, uint32_t chi type = reader.GetType(); tag = reader.GetTag(); - VerifyOrExit( - (type == kTLVType_Structure && - (tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate) || tag == AnonymousTag)) || - (type == kTLVType_Array && - (tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificateArray) || tag == AnonymousTag)), - err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrExit((type == kTLVType_Structure || type == kTLVType_Array) && (tag == AnonymousTag), + err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); err = LoadCerts(reader, decodeFlags); diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 24e51614d68bb4..64ca1896d1133b 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -55,10 +55,6 @@ static constexpr uint32_t kMaxCHIPCertDecodeBufLength = kMaxDERCertLength - Cryp */ enum { - // ---- Top-level Protocol-Specific Tags ---- - kTag_ChipCertificate = 1, /**< [ structure ] A CHIP certificate. */ - kTag_ChipCertificateArray = 2, /**< [ array ] An array of CHIP certificates. */ - // ---- Context-specific Tags for ChipCertificate Structure ---- kTag_SerialNumber = 1, /**< [ byte string ] Certificate serial number, in BER integer encoding. */ kTag_SignatureAlgorithm = 2, /**< [ unsigned int ] Enumerated value identifying the certificate signature algorithm. */ diff --git a/src/credentials/CHIPCertFromX509.cpp b/src/credentials/CHIPCertFromX509.cpp index a284412c91d1e5..af60edf3027760 100644 --- a/src/credentials/CHIPCertFromX509.cpp +++ b/src/credentials/CHIPCertFromX509.cpp @@ -717,8 +717,7 @@ DLL_EXPORT CHIP_ERROR ConvertX509CertToChipCert(const ByteSpan x509Cert, uint8_t writer.Init(chipCertBuf, chipCertBufSize); - ReturnErrorOnFailure(ConvertCertificate( - reader, writer, ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate), issuer, subject, fabric)); + ReturnErrorOnFailure(ConvertCertificate(reader, writer, AnonymousTag, issuer, subject, fabric)); ReturnErrorOnFailure(writer.Finalize()); @@ -797,10 +796,7 @@ CHIP_ERROR ExtractCertsFromCertArray(const ByteSpan & opCertArray, ByteSpan & no ReturnErrorOnFailure(reader.Next()); } VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - uint64_t tag = reader.GetTag(); - VerifyOrReturnError(tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate) || - tag == AnonymousTag, - CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_INVALID_TLV_TAG); ReturnErrorOnFailure(reader.EnterContainer(nocContainerType)); ReturnErrorOnFailure(reader.ExitContainer(nocContainerType)); @@ -822,10 +818,7 @@ CHIP_ERROR ExtractCertsFromCertArray(const ByteSpan & opCertArray, ByteSpan & no ReturnErrorOnFailure(err); } VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - uint64_t tag = reader.GetTag(); - VerifyOrReturnError(tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate) || - tag == AnonymousTag, - CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_INVALID_TLV_TAG); ReturnErrorOnFailure(reader.EnterContainer(icacContainerType)); ReturnErrorOnFailure(reader.ExitContainer(icacContainerType)); diff --git a/src/credentials/CHIPCertToX509.cpp b/src/credentials/CHIPCertToX509.cpp index 23e8c726023bc1..9af4a6de87f909 100644 --- a/src/credentials/CHIPCertToX509.cpp +++ b/src/credentials/CHIPCertToX509.cpp @@ -795,8 +795,7 @@ static CHIP_ERROR DecodeConvertCert(TLVReader & reader, ASN1Writer & writer, Chi } VerifyOrExit(reader.GetType() == kTLVType_Structure, err = CHIP_ERROR_WRONG_TLV_TYPE); tag = reader.GetTag(); - VerifyOrExit(tag == ProfileTag(Protocols::OpCredentials::Id.ToTLVProfileId(), kTag_ChipCertificate) || tag == AnonymousTag, - err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrExit(tag == AnonymousTag, err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); err = reader.EnterContainer(containerType); SuccessOrExit(err); diff --git a/src/credentials/tests/CHIPCert_test_vectors.cpp b/src/credentials/tests/CHIPCert_test_vectors.cpp index a5042d8bd71a16..fd273658494df8 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.cpp +++ b/src/credentials/tests/CHIPCert_test_vectors.cpp @@ -271,19 +271,18 @@ AwEHoUQDQgAEE1Ojs+8dpwjEkIBIAU5AfVmQziK8TrM+mlrLJahWA+um3NghNmak */ extern const uint8_t sTestCert_Root01_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x59, 0xea, 0xa6, 0x32, 0x94, 0x7f, 0x54, 0x1c, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, - 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, - 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x13, 0x53, 0xa3, 0xb3, 0xef, 0x1d, 0xa7, 0x08, 0xc4, 0x90, 0x80, - 0x48, 0x01, 0x4e, 0x40, 0x7d, 0x59, 0x90, 0xce, 0x22, 0xbc, 0x4e, 0xb3, 0x3e, 0x9a, 0x5a, 0xcb, 0x25, 0xa8, 0x56, 0x03, - 0xeb, 0xa6, 0xdc, 0xd8, 0x21, 0x36, 0x66, 0xa4, 0xe4, 0x4f, 0x5a, 0xca, 0x13, 0xeb, 0x76, 0x7f, 0xaf, 0xa7, 0xdc, 0xdd, - 0xdc, 0x33, 0x41, 0x1f, 0x82, 0xa3, 0x0b, 0x54, 0x3d, 0xd1, 0xd2, 0x4b, 0xa8, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, - 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, - 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, - 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x45, 0x81, 0x64, 0x46, 0x6c, 0x8f, 0x19, - 0x5a, 0xbc, 0x0a, 0xbb, 0x7c, 0x6c, 0xb5, 0xa2, 0x7a, 0x83, 0xf4, 0x1d, 0x37, 0xf8, 0xd5, 0x3b, 0xee, 0xc5, 0x20, 0xab, - 0xd2, 0xa0, 0xda, 0x05, 0x09, 0xb8, 0xa7, 0xc2, 0x5c, 0x04, 0x2e, 0x30, 0xcf, 0x64, 0xdc, 0x30, 0xfe, 0x33, 0x4e, 0x12, - 0x00, 0x19, 0x66, 0x4e, 0x51, 0x50, 0x49, 0x13, 0x4f, 0x57, 0x81, 0x23, 0x84, 0x44, 0xfc, 0x75, 0x31, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x59, 0xea, 0xa6, 0x32, 0x94, 0x7f, 0x54, 0x1c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, + 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, + 0x13, 0x53, 0xa3, 0xb3, 0xef, 0x1d, 0xa7, 0x08, 0xc4, 0x90, 0x80, 0x48, 0x01, 0x4e, 0x40, 0x7d, 0x59, 0x90, 0xce, 0x22, 0xbc, + 0x4e, 0xb3, 0x3e, 0x9a, 0x5a, 0xcb, 0x25, 0xa8, 0x56, 0x03, 0xeb, 0xa6, 0xdc, 0xd8, 0x21, 0x36, 0x66, 0xa4, 0xe4, 0x4f, 0x5a, + 0xca, 0x13, 0xeb, 0x76, 0x7f, 0xaf, 0xa7, 0xdc, 0xdd, 0xdc, 0x33, 0x41, 0x1f, 0x82, 0xa3, 0x0b, 0x54, 0x3d, 0xd1, 0xd2, 0x4b, + 0xa8, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, + 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, + 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x45, 0x81, + 0x64, 0x46, 0x6c, 0x8f, 0x19, 0x5a, 0xbc, 0x0a, 0xbb, 0x7c, 0x6c, 0xb5, 0xa2, 0x7a, 0x83, 0xf4, 0x1d, 0x37, 0xf8, 0xd5, 0x3b, + 0xee, 0xc5, 0x20, 0xab, 0xd2, 0xa0, 0xda, 0x05, 0x09, 0xb8, 0xa7, 0xc2, 0x5c, 0x04, 0x2e, 0x30, 0xcf, 0x64, 0xdc, 0x30, 0xfe, + 0x33, 0x4e, 0x12, 0x00, 0x19, 0x66, 0x4e, 0x51, 0x50, 0x49, 0x13, 0x4f, 0x57, 0x81, 0x23, 0x84, 0x44, 0xfc, 0x75, 0x31, 0x18, }; extern const uint32_t sTestCert_Root01_Chip_Len = sizeof(sTestCert_Root01_Chip); @@ -395,20 +394,19 @@ BlbuB2OqxQPoskCsdjIMdTXIf9zzkdchMg== */ extern const uint8_t sTestCert_Root02_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x26, 0x9d, 0xce, 0x41, 0x3b, 0xa5, 0x38, 0xe4, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, - 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, - 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x6e, 0x96, 0x30, 0x68, 0x98, 0x89, 0xf6, 0x06, 0xb2, 0x54, 0x4f, - 0x0e, 0x00, 0x21, 0xe4, 0xbe, 0x70, 0x36, 0x0c, 0x3f, 0x77, 0xd0, 0x33, 0xbe, 0x50, 0x6d, 0xbc, 0x64, 0x63, 0x81, 0x0f, - 0x9a, 0x7a, 0x1c, 0xef, 0xd2, 0xed, 0xe1, 0xd0, 0x06, 0x56, 0xee, 0x07, 0x63, 0xaa, 0xc5, 0x03, 0xe8, 0xb2, 0x40, 0xac, - 0x76, 0x32, 0x0c, 0x75, 0x35, 0xc8, 0x7f, 0xdc, 0xf3, 0x91, 0xd7, 0x21, 0x32, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, - 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, - 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, - 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0x8d, 0x03, 0x79, 0xff, 0x1d, 0x68, 0xab, - 0x8e, 0xd7, 0xb3, 0x26, 0x60, 0x90, 0x97, 0x77, 0x50, 0x07, 0xa2, 0x1f, 0x28, 0x49, 0x71, 0x89, 0xa8, 0xd8, 0x7c, 0x85, - 0xcd, 0x2f, 0x1a, 0x79, 0x78, 0xc1, 0xeb, 0x69, 0xda, 0x21, 0xf0, 0x0b, 0x23, 0x6c, 0x02, 0x83, 0x43, 0x57, 0x3a, 0xa7, - 0x98, 0x6f, 0xde, 0x21, 0x4a, 0x77, 0xa4, 0x4d, 0xea, 0x7a, 0x0f, 0x03, 0x20, 0xf7, 0x5d, 0xb6, 0x80, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x26, 0x9d, 0xce, 0x41, 0x3b, 0xa5, 0x38, 0xe4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x6e, + 0x96, 0x30, 0x68, 0x98, 0x89, 0xf6, 0x06, 0xb2, 0x54, 0x4f, 0x0e, 0x00, 0x21, 0xe4, 0xbe, 0x70, 0x36, 0x0c, 0x3f, 0x77, 0xd0, + 0x33, 0xbe, 0x50, 0x6d, 0xbc, 0x64, 0x63, 0x81, 0x0f, 0x9a, 0x7a, 0x1c, 0xef, 0xd2, 0xed, 0xe1, 0xd0, 0x06, 0x56, 0xee, 0x07, + 0x63, 0xaa, 0xc5, 0x03, 0xe8, 0xb2, 0x40, 0xac, 0x76, 0x32, 0x0c, 0x75, 0x35, 0xc8, 0x7f, 0xdc, 0xf3, 0x91, 0xd7, 0x21, 0x32, + 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, + 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, + 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0x8d, 0x03, 0x79, + 0xff, 0x1d, 0x68, 0xab, 0x8e, 0xd7, 0xb3, 0x26, 0x60, 0x90, 0x97, 0x77, 0x50, 0x07, 0xa2, 0x1f, 0x28, 0x49, 0x71, 0x89, 0xa8, + 0xd8, 0x7c, 0x85, 0xcd, 0x2f, 0x1a, 0x79, 0x78, 0xc1, 0xeb, 0x69, 0xda, 0x21, 0xf0, 0x0b, 0x23, 0x6c, 0x02, 0x83, 0x43, 0x57, + 0x3a, 0xa7, 0x98, 0x6f, 0xde, 0x21, 0x4a, 0x77, 0xa4, 0x4d, 0xea, 0x7a, 0x0f, 0x03, 0x20, 0xf7, 0x5d, 0xb6, 0x80, 0x18, }; extern const uint32_t sTestCert_Root02_Chip_Len = sizeof(sTestCert_Root02_Chip); @@ -522,19 +520,18 @@ RubfKeqGv1Yq5yComDN9OD8ywKCeQWAZ6g== */ extern const uint8_t sTestCert_ICA01_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x2d, 0xb4, 0x44, 0x85, 0x56, 0x41, 0xae, 0xdf, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, - 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, - 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xc5, 0xd0, 0x86, 0x1b, 0xb8, 0xf9, 0x0c, 0x40, 0x5c, 0x12, 0x31, - 0x4e, 0x4c, 0x5e, 0xbe, 0xea, 0x93, 0x9f, 0x72, 0x77, 0x4b, 0xcc, 0x33, 0x23, 0x9e, 0x2f, 0x59, 0xf6, 0xf4, 0x6a, 0xf8, - 0xdc, 0x7d, 0x46, 0x82, 0xa0, 0xe3, 0xcc, 0xc6, 0x46, 0xe6, 0xdf, 0x29, 0xea, 0x86, 0xbf, 0x56, 0x2a, 0xe7, 0x20, 0xa8, - 0x98, 0x33, 0x7d, 0x38, 0x3f, 0x32, 0xc0, 0xa0, 0x9e, 0x41, 0x60, 0x19, 0xea, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, - 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, - 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, - 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x84, 0x1a, 0x06, 0xd4, 0x3b, 0x5e, 0x9f, - 0xec, 0xd2, 0x4e, 0x87, 0xb1, 0x24, 0x4e, 0xb5, 0x1c, 0x6a, 0x2c, 0xf2, 0x0d, 0x9b, 0x5e, 0x6b, 0xa0, 0x7f, 0x11, 0xe6, - 0x00, 0x2f, 0x7e, 0x0c, 0xa3, 0x4e, 0x32, 0xa6, 0x02, 0xc3, 0x60, 0x9d, 0x00, 0x92, 0xd3, 0x48, 0xbd, 0xbd, 0x19, 0x8a, - 0x11, 0x46, 0x46, 0xbd, 0x41, 0xcf, 0x10, 0x37, 0x83, 0x64, 0x1a, 0xe2, 0x5e, 0x3f, 0x23, 0xfd, 0x26, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x2d, 0xb4, 0x44, 0x85, 0x56, 0x41, 0xae, 0xdf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, + 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, + 0xc5, 0xd0, 0x86, 0x1b, 0xb8, 0xf9, 0x0c, 0x40, 0x5c, 0x12, 0x31, 0x4e, 0x4c, 0x5e, 0xbe, 0xea, 0x93, 0x9f, 0x72, 0x77, 0x4b, + 0xcc, 0x33, 0x23, 0x9e, 0x2f, 0x59, 0xf6, 0xf4, 0x6a, 0xf8, 0xdc, 0x7d, 0x46, 0x82, 0xa0, 0xe3, 0xcc, 0xc6, 0x46, 0xe6, 0xdf, + 0x29, 0xea, 0x86, 0xbf, 0x56, 0x2a, 0xe7, 0x20, 0xa8, 0x98, 0x33, 0x7d, 0x38, 0x3f, 0x32, 0xc0, 0xa0, 0x9e, 0x41, 0x60, 0x19, + 0xea, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, + 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, + 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x84, 0x1a, + 0x06, 0xd4, 0x3b, 0x5e, 0x9f, 0xec, 0xd2, 0x4e, 0x87, 0xb1, 0x24, 0x4e, 0xb5, 0x1c, 0x6a, 0x2c, 0xf2, 0x0d, 0x9b, 0x5e, 0x6b, + 0xa0, 0x7f, 0x11, 0xe6, 0x00, 0x2f, 0x7e, 0x0c, 0xa3, 0x4e, 0x32, 0xa6, 0x02, 0xc3, 0x60, 0x9d, 0x00, 0x92, 0xd3, 0x48, 0xbd, + 0xbd, 0x19, 0x8a, 0x11, 0x46, 0x46, 0xbd, 0x41, 0xcf, 0x10, 0x37, 0x83, 0x64, 0x1a, 0xe2, 0x5e, 0x3f, 0x23, 0xfd, 0x26, 0x18, }; extern const uint32_t sTestCert_ICA01_Chip_Len = sizeof(sTestCert_ICA01_Chip); @@ -646,20 +643,19 @@ lINFKN6cNT9eWxH7kt3bZHTa9g4f/iH00w== */ extern const uint8_t sTestCert_ICA02_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x0c, 0xa6, 0x5c, 0xcd, 0xee, 0x94, 0xa1, 0xcb, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, - 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, - 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xfc, 0xfe, 0x1a, 0x0f, 0x49, 0x7d, 0xf8, 0xc7, 0xfa, 0xde, 0x82, - 0x42, 0xee, 0xb4, 0x09, 0xe4, 0x48, 0x50, 0xee, 0x52, 0xbc, 0xe0, 0x2b, 0x33, 0x1e, 0xab, 0x3e, 0xaf, 0x90, 0x0c, 0x42, - 0x04, 0xd9, 0xea, 0xa3, 0x17, 0x38, 0xe6, 0xde, 0x94, 0x83, 0x45, 0x28, 0xde, 0x9c, 0x35, 0x3f, 0x5e, 0x5b, 0x11, 0xfb, - 0x92, 0xdd, 0xdb, 0x64, 0x74, 0xda, 0xf6, 0x0e, 0x1f, 0xfe, 0x21, 0xf4, 0xd3, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, - 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, - 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, - 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0xca, 0x49, 0x9e, 0x8e, 0x2c, 0x5d, 0x01, - 0x12, 0x44, 0xa9, 0x2e, 0x7e, 0x17, 0xd4, 0xb0, 0x52, 0x6a, 0x83, 0x85, 0x5c, 0x8f, 0x15, 0x4f, 0xf0, 0xf1, 0xc1, 0x94, - 0x72, 0xe1, 0xf1, 0x65, 0x26, 0x33, 0x87, 0x03, 0xf4, 0x41, 0x10, 0x1e, 0x09, 0xc8, 0x9b, 0xa9, 0xb0, 0xf6, 0x3f, 0x74, - 0xa2, 0x6e, 0x26, 0x2e, 0xb6, 0x2b, 0x0f, 0x39, 0x5a, 0xc2, 0x03, 0x11, 0xbe, 0xd0, 0x9e, 0xe5, 0xe6, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x0c, 0xa6, 0x5c, 0xcd, 0xee, 0x94, 0xa1, 0xcb, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xfc, + 0xfe, 0x1a, 0x0f, 0x49, 0x7d, 0xf8, 0xc7, 0xfa, 0xde, 0x82, 0x42, 0xee, 0xb4, 0x09, 0xe4, 0x48, 0x50, 0xee, 0x52, 0xbc, 0xe0, + 0x2b, 0x33, 0x1e, 0xab, 0x3e, 0xaf, 0x90, 0x0c, 0x42, 0x04, 0xd9, 0xea, 0xa3, 0x17, 0x38, 0xe6, 0xde, 0x94, 0x83, 0x45, 0x28, + 0xde, 0x9c, 0x35, 0x3f, 0x5e, 0x5b, 0x11, 0xfb, 0x92, 0xdd, 0xdb, 0x64, 0x74, 0xda, 0xf6, 0x0e, 0x1f, 0xfe, 0x21, 0xf4, 0xd3, + 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, + 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, + 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0xca, 0x49, 0x9e, + 0x8e, 0x2c, 0x5d, 0x01, 0x12, 0x44, 0xa9, 0x2e, 0x7e, 0x17, 0xd4, 0xb0, 0x52, 0x6a, 0x83, 0x85, 0x5c, 0x8f, 0x15, 0x4f, 0xf0, + 0xf1, 0xc1, 0x94, 0x72, 0xe1, 0xf1, 0x65, 0x26, 0x33, 0x87, 0x03, 0xf4, 0x41, 0x10, 0x1e, 0x09, 0xc8, 0x9b, 0xa9, 0xb0, 0xf6, + 0x3f, 0x74, 0xa2, 0x6e, 0x26, 0x2e, 0xb6, 0x2b, 0x0f, 0x39, 0x5a, 0xc2, 0x03, 0x11, 0xbe, 0xd0, 0x9e, 0xe5, 0xe6, 0x18, }; extern const uint32_t sTestCert_ICA02_Chip_Len = sizeof(sTestCert_ICA02_Chip); @@ -773,19 +769,18 @@ AwEHoUQDQgAEm1QUICkmG6EilWJyTGZ/aguCXPyAGNlQJBNxgk1zUllRiCoS1EjV */ extern const uint8_t sTestCert_ICA01_1_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x44, 0x9c, 0xf9, 0x78, 0x97, 0xcd, 0xbf, 0x71, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, - 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, - 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9b, 0x54, 0x14, 0x20, 0x29, 0x26, 0x1b, 0xa1, 0x22, 0x95, 0x62, - 0x72, 0x4c, 0x66, 0x7f, 0x6a, 0x0b, 0x82, 0x5c, 0xfc, 0x80, 0x18, 0xd9, 0x50, 0x24, 0x13, 0x71, 0x82, 0x4d, 0x73, 0x52, - 0x59, 0x51, 0x88, 0x2a, 0x12, 0xd4, 0x48, 0xd5, 0xef, 0x28, 0x1c, 0xcc, 0x73, 0x90, 0xe3, 0xbc, 0xc6, 0x41, 0xb3, 0xdb, - 0x27, 0x2a, 0x37, 0x4a, 0xd0, 0x22, 0xec, 0xc3, 0x4e, 0x3d, 0x2c, 0x8d, 0x7a, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, - 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, - 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, - 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xf7, 0x81, 0x3c, 0xac, 0xa8, 0x23, 0x82, - 0xec, 0x45, 0x45, 0x1e, 0xed, 0x2e, 0x16, 0x2d, 0x40, 0x99, 0xf9, 0xd6, 0xbf, 0x43, 0xa6, 0x7a, 0x0e, 0x6d, 0xa2, 0xa0, - 0xa3, 0xe3, 0xc8, 0xb5, 0x50, 0xbc, 0x8a, 0xe4, 0xd3, 0xcc, 0x1c, 0xd0, 0x4f, 0xf7, 0x56, 0xed, 0xd9, 0xfe, 0xb3, 0xaa, - 0x89, 0x6f, 0x3d, 0xdb, 0xd7, 0x1a, 0xe0, 0x54, 0x12, 0xaa, 0x06, 0x61, 0xaf, 0x42, 0x7e, 0xcb, 0x57, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x44, 0x9c, 0xf9, 0x78, 0x97, 0xcd, 0xbf, 0x71, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, + 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, + 0x9b, 0x54, 0x14, 0x20, 0x29, 0x26, 0x1b, 0xa1, 0x22, 0x95, 0x62, 0x72, 0x4c, 0x66, 0x7f, 0x6a, 0x0b, 0x82, 0x5c, 0xfc, 0x80, + 0x18, 0xd9, 0x50, 0x24, 0x13, 0x71, 0x82, 0x4d, 0x73, 0x52, 0x59, 0x51, 0x88, 0x2a, 0x12, 0xd4, 0x48, 0xd5, 0xef, 0x28, 0x1c, + 0xcc, 0x73, 0x90, 0xe3, 0xbc, 0xc6, 0x41, 0xb3, 0xdb, 0x27, 0x2a, 0x37, 0x4a, 0xd0, 0x22, 0xec, 0xc3, 0x4e, 0x3d, 0x2c, 0x8d, + 0x7a, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, + 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, + 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xf7, 0x81, + 0x3c, 0xac, 0xa8, 0x23, 0x82, 0xec, 0x45, 0x45, 0x1e, 0xed, 0x2e, 0x16, 0x2d, 0x40, 0x99, 0xf9, 0xd6, 0xbf, 0x43, 0xa6, 0x7a, + 0x0e, 0x6d, 0xa2, 0xa0, 0xa3, 0xe3, 0xc8, 0xb5, 0x50, 0xbc, 0x8a, 0xe4, 0xd3, 0xcc, 0x1c, 0xd0, 0x4f, 0xf7, 0x56, 0xed, 0xd9, + 0xfe, 0xb3, 0xaa, 0x89, 0x6f, 0x3d, 0xdb, 0xd7, 0x1a, 0xe0, 0x54, 0x12, 0xaa, 0x06, 0x61, 0xaf, 0x42, 0x7e, 0xcb, 0x57, 0x18, }; extern const uint32_t sTestCert_ICA01_1_Chip_Len = sizeof(sTestCert_ICA01_1_Chip); @@ -898,20 +893,20 @@ Vr3MmxApaD8Lr5coLhzuiTvM81b7hubjZA== */ extern const uint8_t sTestCert_FWSign01_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x62, 0xba, 0x33, 0xca, 0xc6, 0x84, 0xba, 0x13, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, - 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x12, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x01, 0x0f, 0x46, 0x57, - 0x20, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x30, 0x31, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, - 0x09, 0x41, 0x04, 0xe1, 0x81, 0xd9, 0xcf, 0xf5, 0x16, 0xd6, 0xe0, 0xf6, 0xe1, 0x70, 0x3c, 0x40, 0x4a, 0xef, 0xfe, 0x96, 0x09, - 0x64, 0x87, 0x9e, 0xc8, 0x4f, 0x25, 0x39, 0x92, 0xce, 0xdb, 0x2a, 0xe6, 0x44, 0xa8, 0x63, 0x05, 0x31, 0x6f, 0x69, 0xe2, 0xc6, - 0x56, 0xbd, 0xcc, 0x9b, 0x10, 0x29, 0x68, 0x3f, 0x0b, 0xaf, 0x97, 0x28, 0x2e, 0x1c, 0xee, 0x89, 0x3b, 0xcc, 0xf3, 0x56, 0xfb, - 0x86, 0xe6, 0xe3, 0x64, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x03, 0x18, 0x30, 0x04, - 0x14, 0x91, 0x5b, 0xbb, 0x66, 0x70, 0x1f, 0x63, 0x1b, 0x86, 0x5d, 0x40, 0x51, 0xa4, 0xe0, 0x0e, 0xcd, 0x7c, 0x06, 0xb0, 0x0c, - 0x30, 0x05, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, 0x97, 0x2a, 0x55, 0x9c, - 0x1a, 0xd8, 0x18, 0x30, 0x0b, 0x40, 0x28, 0x1b, 0x51, 0xa9, 0x11, 0x5c, 0x11, 0xce, 0xff, 0xf2, 0xe9, 0xd7, 0x58, 0xd9, 0x16, - 0x92, 0xdb, 0xc3, 0x1d, 0x14, 0x89, 0x4c, 0xa1, 0x35, 0x67, 0xfe, 0x30, 0x75, 0xc4, 0x44, 0x71, 0xe9, 0x5c, 0xd3, 0x9b, 0xf9, - 0x5d, 0x21, 0x46, 0xc0, 0x99, 0x5e, 0xb0, 0xe0, 0x5c, 0x14, 0xa1, 0x3c, 0x69, 0x5f, 0x1d, 0xf2, 0x0f, 0x2c, 0x7a, 0x7d, 0x48, - 0x58, 0xc5, 0xf4, 0xc7, 0x1d, 0x68, 0x95, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x62, 0xba, 0x33, 0xca, 0xc6, 0x84, 0xba, 0x13, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x05, + 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, + 0x37, 0x06, 0x27, 0x12, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x01, 0x0f, 0x46, 0x57, 0x20, 0x53, 0x49, + 0x47, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x30, 0x31, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, + 0x04, 0xe1, 0x81, 0xd9, 0xcf, 0xf5, 0x16, 0xd6, 0xe0, 0xf6, 0xe1, 0x70, 0x3c, 0x40, 0x4a, 0xef, 0xfe, 0x96, 0x09, 0x64, + 0x87, 0x9e, 0xc8, 0x4f, 0x25, 0x39, 0x92, 0xce, 0xdb, 0x2a, 0xe6, 0x44, 0xa8, 0x63, 0x05, 0x31, 0x6f, 0x69, 0xe2, 0xc6, + 0x56, 0xbd, 0xcc, 0x9b, 0x10, 0x29, 0x68, 0x3f, 0x0b, 0xaf, 0x97, 0x28, 0x2e, 0x1c, 0xee, 0x89, 0x3b, 0xcc, 0xf3, 0x56, + 0xfb, 0x86, 0xe6, 0xe3, 0x64, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x03, 0x18, + 0x30, 0x04, 0x14, 0x91, 0x5b, 0xbb, 0x66, 0x70, 0x1f, 0x63, 0x1b, 0x86, 0x5d, 0x40, 0x51, 0xa4, 0xe0, 0x0e, 0xcd, 0x7c, + 0x06, 0xb0, 0x0c, 0x30, 0x05, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, + 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, 0x18, 0x30, 0x0b, 0x40, 0x28, 0x1b, 0x51, 0xa9, 0x11, 0x5c, 0x11, 0xce, 0xff, 0xf2, + 0xe9, 0xd7, 0x58, 0xd9, 0x16, 0x92, 0xdb, 0xc3, 0x1d, 0x14, 0x89, 0x4c, 0xa1, 0x35, 0x67, 0xfe, 0x30, 0x75, 0xc4, 0x44, + 0x71, 0xe9, 0x5c, 0xd3, 0x9b, 0xf9, 0x5d, 0x21, 0x46, 0xc0, 0x99, 0x5e, 0xb0, 0xe0, 0x5c, 0x14, 0xa1, 0x3c, 0x69, 0x5f, + 0x1d, 0xf2, 0x0f, 0x2c, 0x7a, 0x7d, 0x48, 0x58, 0xc5, 0xf4, 0xc7, 0x1d, 0x68, 0x95, 0x18, }; extern const uint32_t sTestCert_FWSign01_Chip_Len = sizeof(sTestCert_FWSign01_Chip); @@ -1028,20 +1023,19 @@ KU1I7uBwigMsyjk5PDp7RvGBrqB4/q2Dgw== */ extern const uint8_t sTestCert_Node01_01_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x3e, 0xfc, 0xff, 0x17, 0x02, 0xb9, 0xa1, 0x7a, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, - 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, - 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9a, - 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, 0x1b, 0x83, 0x5c, 0x89, 0xe3, 0xe6, 0xaf, 0xb6, 0x6c, 0x14, 0xf7, - 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, 0x2c, 0x8a, 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, - 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, 0x39, 0x3c, 0x3a, 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, - 0xad, 0x83, 0x83, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, - 0x30, 0x04, 0x14, 0x9f, 0x55, 0xa2, 0x6b, 0x7e, 0x43, 0x03, 0xe6, 0x08, 0x83, 0xe9, 0x13, 0xbf, 0x94, 0xf4, 0xfb, 0x5e, - 0x2a, 0x61, 0x61, 0x30, 0x05, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, - 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x18, 0x30, 0x0b, 0x40, 0x79, 0x55, 0xc2, 0x02, 0x63, 0x0b, 0x4b, 0xa4, 0xd5, 0x91, - 0x25, 0x26, 0x32, 0x2f, 0xdf, 0x28, 0xf8, 0x9e, 0xdf, 0xe5, 0xaf, 0x9c, 0x0e, 0x57, 0x2b, 0xd8, 0xa1, 0x4a, 0xaa, 0xbb, - 0x4d, 0x12, 0xb8, 0x3c, 0xa1, 0x7c, 0x7b, 0x05, 0xfb, 0x16, 0x4b, 0x77, 0xd7, 0x9c, 0x52, 0x96, 0x13, 0x31, 0x6b, 0xcf, - 0xd1, 0x78, 0x95, 0xe4, 0xb2, 0xa4, 0xf2, 0x40, 0x4b, 0x98, 0x17, 0x32, 0x71, 0x59, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x3e, 0xfc, 0xff, 0x17, 0x02, 0xb9, 0xa1, 0x7a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, + 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, + 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9a, 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, 0x1b, + 0x83, 0x5c, 0x89, 0xe3, 0xe6, 0xaf, 0xb6, 0x6c, 0x14, 0xf7, 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, 0x2c, + 0x8a, 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, 0x39, 0x3c, 0x3a, + 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, 0xad, 0x83, 0x83, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, + 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x9f, 0x55, 0xa2, 0x6b, 0x7e, 0x43, 0x03, 0xe6, 0x08, 0x83, 0xe9, + 0x13, 0xbf, 0x94, 0xf4, 0xfb, 0x5e, 0x2a, 0x61, 0x61, 0x30, 0x05, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, + 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x18, 0x30, 0x0b, 0x40, 0x79, 0x55, 0xc2, 0x02, 0x63, 0x0b, + 0x4b, 0xa4, 0xd5, 0x91, 0x25, 0x26, 0x32, 0x2f, 0xdf, 0x28, 0xf8, 0x9e, 0xdf, 0xe5, 0xaf, 0x9c, 0x0e, 0x57, 0x2b, 0xd8, 0xa1, + 0x4a, 0xaa, 0xbb, 0x4d, 0x12, 0xb8, 0x3c, 0xa1, 0x7c, 0x7b, 0x05, 0xfb, 0x16, 0x4b, 0x77, 0xd7, 0x9c, 0x52, 0x96, 0x13, 0x31, + 0x6b, 0xcf, 0xd1, 0x78, 0x95, 0xe4, 0xb2, 0xa4, 0xf2, 0x40, 0x4b, 0x98, 0x17, 0x32, 0x71, 0x59, 0x18, }; extern const uint32_t sTestCert_Node01_01_Chip_Len = sizeof(sTestCert_Node01_01_Chip); @@ -1159,20 +1153,19 @@ zuaMhxSm3szu182DgDULpT9cy/QtfGro3g== */ extern const uint8_t sTestCert_Node01_02_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x63, 0x6d, 0xd8, 0xdf, 0x2b, 0x15, 0xbc, 0x3b, 0x24, 0x02, - 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, - 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, - 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xca, - 0x44, 0xa4, 0xce, 0xf3, 0x21, 0x48, 0x84, 0x2e, 0x4a, 0x71, 0x0e, 0xc3, 0xee, 0x01, 0x17, 0x75, 0x5d, 0xd0, 0xf8, 0x8f, - 0x59, 0x21, 0x52, 0x30, 0x27, 0x9a, 0x97, 0x8c, 0xd9, 0x59, 0x1a, 0x3f, 0xe0, 0x97, 0x69, 0x22, 0xef, 0x3f, 0xce, 0xe6, - 0x8c, 0x87, 0x14, 0xa6, 0xde, 0xcc, 0xee, 0xd7, 0xcd, 0x83, 0x80, 0x35, 0x0b, 0xa5, 0x3f, 0x5c, 0xcb, 0xf4, 0x2d, 0x7c, - 0x6a, 0xe8, 0xde, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, - 0x30, 0x04, 0x14, 0x56, 0x43, 0xeb, 0xbd, 0xa3, 0x94, 0x98, 0x54, 0xcf, 0x2b, 0xad, 0xbb, 0xe0, 0x03, 0x9c, 0x1b, 0x6d, - 0xb8, 0x84, 0xa7, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, - 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xfe, 0xee, 0xe2, 0xff, 0xda, 0xc6, 0x8f, 0xe0, 0x37, 0x02, - 0x54, 0x91, 0xfe, 0x66, 0x80, 0xd9, 0xbe, 0xd4, 0x56, 0xde, 0x73, 0xa8, 0x5e, 0x3d, 0x83, 0x7b, 0x55, 0x59, 0x05, 0x08, - 0x90, 0x12, 0x77, 0x25, 0xf5, 0x51, 0x71, 0xeb, 0xdb, 0x6a, 0x27, 0x69, 0x6a, 0xca, 0x87, 0x6a, 0x54, 0xb1, 0x0a, 0x20, - 0x95, 0xe3, 0xe7, 0xcf, 0x6e, 0xcf, 0xee, 0xb8, 0x95, 0xa6, 0x56, 0x1c, 0x83, 0xed, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x63, 0x6d, 0xd8, 0xdf, 0x2b, 0x15, 0xbc, 0x3b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, + 0x27, 0x11, 0x02, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, + 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xca, 0x44, 0xa4, 0xce, 0xf3, 0x21, 0x48, 0x84, 0x2e, 0x4a, 0x71, + 0x0e, 0xc3, 0xee, 0x01, 0x17, 0x75, 0x5d, 0xd0, 0xf8, 0x8f, 0x59, 0x21, 0x52, 0x30, 0x27, 0x9a, 0x97, 0x8c, 0xd9, 0x59, 0x1a, + 0x3f, 0xe0, 0x97, 0x69, 0x22, 0xef, 0x3f, 0xce, 0xe6, 0x8c, 0x87, 0x14, 0xa6, 0xde, 0xcc, 0xee, 0xd7, 0xcd, 0x83, 0x80, 0x35, + 0x0b, 0xa5, 0x3f, 0x5c, 0xcb, 0xf4, 0x2d, 0x7c, 0x6a, 0xe8, 0xde, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, + 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x56, 0x43, 0xeb, 0xbd, 0xa3, 0x94, 0x98, 0x54, 0xcf, 0x2b, 0xad, + 0xbb, 0xe0, 0x03, 0x9c, 0x1b, 0x6d, 0xb8, 0x84, 0xa7, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, + 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xfe, 0xee, 0xe2, 0xff, 0xda, 0xc6, + 0x8f, 0xe0, 0x37, 0x02, 0x54, 0x91, 0xfe, 0x66, 0x80, 0xd9, 0xbe, 0xd4, 0x56, 0xde, 0x73, 0xa8, 0x5e, 0x3d, 0x83, 0x7b, 0x55, + 0x59, 0x05, 0x08, 0x90, 0x12, 0x77, 0x25, 0xf5, 0x51, 0x71, 0xeb, 0xdb, 0x6a, 0x27, 0x69, 0x6a, 0xca, 0x87, 0x6a, 0x54, 0xb1, + 0x0a, 0x20, 0x95, 0xe3, 0xe7, 0xcf, 0x6e, 0xcf, 0xee, 0xb8, 0x95, 0xa6, 0x56, 0x1c, 0x83, 0xed, 0x18, }; extern const uint32_t sTestCert_Node01_02_Chip_Len = sizeof(sTestCert_Node01_02_Chip); @@ -1290,20 +1283,20 @@ RriG+1f5wu8mtc7t9jC49VqUXBJRGk2bmg== */ extern const uint8_t sTestCert_Node02_01_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x25, 0x6d, 0xd0, 0x98, 0xbf, 0x97, 0xb5, 0xf2, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x02, - 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, - 0x01, 0x30, 0x09, 0x41, 0x04, 0xba, 0xba, 0x8e, 0x3e, 0x18, 0xce, 0xfc, 0xb6, 0x56, 0x8a, 0xf6, 0xce, 0x32, 0xcc, 0x0d, 0xdf, - 0x62, 0x5f, 0xed, 0xa5, 0x55, 0x2a, 0xce, 0x70, 0xed, 0xf1, 0xda, 0xe9, 0x2c, 0xa9, 0xc0, 0x47, 0xde, 0x23, 0xe7, 0x57, 0x0b, - 0x25, 0xad, 0x46, 0xb8, 0x86, 0xfb, 0x57, 0xf9, 0xc2, 0xef, 0x26, 0xb5, 0xce, 0xed, 0xf6, 0x30, 0xb8, 0xf5, 0x5a, 0x94, 0x5c, - 0x12, 0x51, 0x1a, 0x4d, 0x9b, 0x9a, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, - 0x01, 0x18, 0x30, 0x04, 0x14, 0xc2, 0x92, 0x42, 0x54, 0x44, 0x76, 0x84, 0x14, 0x9e, 0x93, 0x34, 0xef, 0x5b, 0x9d, 0xa6, 0x17, - 0x4c, 0x33, 0x8c, 0x1c, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, - 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x01, 0x4c, 0x7e, 0xe3, 0xec, 0x5f, 0x79, 0x18, 0xa4, 0x70, 0x87, - 0x64, 0xb5, 0xff, 0x44, 0x23, 0x50, 0x52, 0xfc, 0xb0, 0xe9, 0x4e, 0xe8, 0x7a, 0x1f, 0x68, 0x18, 0xf3, 0x97, 0x09, 0xb1, 0xbd, - 0x46, 0x7b, 0xf3, 0xe6, 0xac, 0x29, 0x23, 0xe1, 0x81, 0xaf, 0x75, 0x6e, 0x93, 0xca, 0x75, 0x95, 0xa0, 0x5c, 0x6b, 0xf5, 0x09, - 0xb2, 0x76, 0xc0, 0x35, 0xa7, 0x6a, 0x1d, 0x77, 0x41, 0x8f, 0x00, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x25, 0x6d, 0xd0, 0x98, 0xbf, 0x97, 0xb5, 0xf2, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, + 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, + 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x02, 0x00, 0xde, 0xde, + 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, + 0x09, 0x41, 0x04, 0xba, 0xba, 0x8e, 0x3e, 0x18, 0xce, 0xfc, 0xb6, 0x56, 0x8a, 0xf6, 0xce, 0x32, 0xcc, 0x0d, 0xdf, 0x62, + 0x5f, 0xed, 0xa5, 0x55, 0x2a, 0xce, 0x70, 0xed, 0xf1, 0xda, 0xe9, 0x2c, 0xa9, 0xc0, 0x47, 0xde, 0x23, 0xe7, 0x57, 0x0b, + 0x25, 0xad, 0x46, 0xb8, 0x86, 0xfb, 0x57, 0xf9, 0xc2, 0xef, 0x26, 0xb5, 0xce, 0xed, 0xf6, 0x30, 0xb8, 0xf5, 0x5a, 0x94, + 0x5c, 0x12, 0x51, 0x1a, 0x4d, 0x9b, 0x9a, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, + 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xc2, 0x92, 0x42, 0x54, 0x44, 0x76, 0x84, 0x14, 0x9e, 0x93, 0x34, 0xef, 0x5b, + 0x9d, 0xa6, 0x17, 0x4c, 0x33, 0x8c, 0x1c, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, + 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x01, 0x4c, 0x7e, 0xe3, 0xec, 0x5f, + 0x79, 0x18, 0xa4, 0x70, 0x87, 0x64, 0xb5, 0xff, 0x44, 0x23, 0x50, 0x52, 0xfc, 0xb0, 0xe9, 0x4e, 0xe8, 0x7a, 0x1f, 0x68, + 0x18, 0xf3, 0x97, 0x09, 0xb1, 0xbd, 0x46, 0x7b, 0xf3, 0xe6, 0xac, 0x29, 0x23, 0xe1, 0x81, 0xaf, 0x75, 0x6e, 0x93, 0xca, + 0x75, 0x95, 0xa0, 0x5c, 0x6b, 0xf5, 0x09, 0xb2, 0x76, 0xc0, 0x35, 0xa7, 0x6a, 0x1d, 0x77, 0x41, 0x8f, 0x00, 0x18, }; extern const uint32_t sTestCert_Node02_01_Chip_Len = sizeof(sTestCert_Node02_01_Chip); @@ -1420,22 +1413,22 @@ z2kjhV56xyNhxxOWBvymec+RZZcQzOffeA== */ extern const uint8_t sTestCert_Node02_02_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x5c, 0x26, 0x8a, 0xe9, 0x5c, 0xcf, 0xc7, 0x55, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x02, - 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x28, 0x54, 0x45, 0x53, - 0x54, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x41, 0x74, - 0x74, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x30, 0x32, 0x5f, 0x30, 0x32, 0x18, 0x24, 0x07, 0x01, 0x24, - 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xb2, 0x87, 0x29, 0x92, 0x2c, 0xb1, 0xc1, 0xeb, 0x3a, 0x67, 0xc1, 0x8a, 0xb3, 0x1f, 0xf3, - 0xbf, 0x27, 0xf8, 0xe8, 0x8e, 0x1f, 0x1d, 0x70, 0x98, 0x9b, 0x30, 0x10, 0x90, 0xd0, 0xe3, 0x62, 0xa4, 0x6b, 0x47, 0x08, 0x11, - 0xd1, 0x70, 0x85, 0xcf, 0x69, 0x23, 0x85, 0x5e, 0x7a, 0xc7, 0x23, 0x61, 0xc7, 0x13, 0x96, 0x06, 0xfc, 0xa6, 0x79, 0xcf, 0x91, - 0x65, 0x97, 0x10, 0xcc, 0xe7, 0xdf, 0x78, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, - 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x40, 0x90, 0xa7, 0x74, 0xda, 0x49, 0x53, 0xcf, 0xa8, 0x46, 0x66, 0x7e, 0x8d, 0x7f, 0xb7, - 0x4a, 0x51, 0x80, 0xd0, 0xea, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, - 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x46, 0x56, 0xbe, 0x52, 0x4b, 0x97, 0x29, 0xff, 0x9c, 0x79, - 0x93, 0xd2, 0x86, 0x0f, 0x18, 0x86, 0x2d, 0x05, 0x93, 0x77, 0x10, 0xaa, 0xf0, 0x50, 0x61, 0x3c, 0xab, 0x66, 0x57, 0xd4, 0x60, - 0xf1, 0xfe, 0x59, 0xc2, 0x1e, 0x2b, 0x2d, 0x46, 0xfc, 0xb8, 0x64, 0xf5, 0xf5, 0x82, 0xf5, 0x45, 0xf9, 0x99, 0x33, 0x67, 0xdb, - 0x41, 0x84, 0x44, 0x10, 0x79, 0x7a, 0x60, 0x2a, 0x3f, 0x15, 0x4f, 0xe0, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x5c, 0x26, 0x8a, 0xe9, 0x5c, 0xcf, 0xc7, 0x55, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x28, 0x54, 0x45, 0x53, 0x54, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x20, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x41, 0x74, 0x74, 0x72, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x30, 0x32, 0x5f, 0x30, 0x32, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, + 0xb2, 0x87, 0x29, 0x92, 0x2c, 0xb1, 0xc1, 0xeb, 0x3a, 0x67, 0xc1, 0x8a, 0xb3, 0x1f, 0xf3, 0xbf, 0x27, 0xf8, 0xe8, 0x8e, 0x1f, + 0x1d, 0x70, 0x98, 0x9b, 0x30, 0x10, 0x90, 0xd0, 0xe3, 0x62, 0xa4, 0x6b, 0x47, 0x08, 0x11, 0xd1, 0x70, 0x85, 0xcf, 0x69, 0x23, + 0x85, 0x5e, 0x7a, 0xc7, 0x23, 0x61, 0xc7, 0x13, 0x96, 0x06, 0xfc, 0xa6, 0x79, 0xcf, 0x91, 0x65, 0x97, 0x10, 0xcc, 0xe7, 0xdf, + 0x78, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, + 0x40, 0x90, 0xa7, 0x74, 0xda, 0x49, 0x53, 0xcf, 0xa8, 0x46, 0x66, 0x7e, 0x8d, 0x7f, 0xb7, 0x4a, 0x51, 0x80, 0xd0, 0xea, 0x30, + 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, + 0x84, 0x18, 0x30, 0x0b, 0x40, 0x46, 0x56, 0xbe, 0x52, 0x4b, 0x97, 0x29, 0xff, 0x9c, 0x79, 0x93, 0xd2, 0x86, 0x0f, 0x18, 0x86, + 0x2d, 0x05, 0x93, 0x77, 0x10, 0xaa, 0xf0, 0x50, 0x61, 0x3c, 0xab, 0x66, 0x57, 0xd4, 0x60, 0xf1, 0xfe, 0x59, 0xc2, 0x1e, 0x2b, + 0x2d, 0x46, 0xfc, 0xb8, 0x64, 0xf5, 0xf5, 0x82, 0xf5, 0x45, 0xf9, 0x99, 0x33, 0x67, 0xdb, 0x41, 0x84, 0x44, 0x10, 0x79, 0x7a, + 0x60, 0x2a, 0x3f, 0x15, 0x4f, 0xe0, 0x18, }; extern const uint32_t sTestCert_Node02_02_Chip_Len = sizeof(sTestCert_Node02_02_Chip); @@ -1556,21 +1549,21 @@ plKw3BnVKjDqLVhrsSILac3W6wo+4vJfYQ== */ extern const uint8_t sTestCert_Node02_03_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x66, 0xdf, 0xb3, 0x7c, 0x2a, 0xba, 0x67, 0xcd, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x03, 0x00, 0x02, - 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x0d, 0x54, 0x65, 0x73, - 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x33, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x26, 0x17, 0x02, 0xb0, 0x01, - 0xa0, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x43, 0xcd, 0xfa, 0xbc, 0xf2, 0xf4, 0x8c, 0x10, 0x6f, - 0x5f, 0xd8, 0x90, 0x87, 0x29, 0xee, 0xfd, 0x6e, 0xea, 0x92, 0xb6, 0x49, 0x0e, 0x10, 0x53, 0x6d, 0x1b, 0x0b, 0xb0, 0xc9, 0x7a, - 0x28, 0x83, 0x57, 0x21, 0x69, 0x1b, 0x2a, 0x4e, 0xd2, 0xa6, 0x52, 0xb0, 0xdc, 0x19, 0xd5, 0x2a, 0x30, 0xea, 0x2d, 0x58, 0x6b, - 0xb1, 0x22, 0x0b, 0x69, 0xcd, 0xd6, 0xeb, 0x0a, 0x3e, 0xe2, 0xf2, 0x5f, 0x61, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, - 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x31, 0x1f, 0x1b, 0x10, 0x15, 0x5c, 0xe5, 0x4f, 0xf0, - 0xc8, 0xfc, 0xf4, 0x6e, 0xf5, 0x28, 0xb9, 0xb7, 0xb0, 0x0b, 0x0a, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, - 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0xe1, 0xf6, 0x61, 0x61, - 0x0e, 0xc6, 0x8a, 0x42, 0xe9, 0x00, 0x73, 0x67, 0xd0, 0x74, 0xf7, 0x1a, 0x60, 0x80, 0xa0, 0xa4, 0x4d, 0xa6, 0xbd, 0xd7, 0xd2, - 0x0f, 0x8b, 0x15, 0xec, 0x2f, 0xaa, 0xc4, 0x65, 0xa5, 0x19, 0x47, 0x72, 0xe9, 0xfd, 0x57, 0x66, 0x00, 0x3d, 0xce, 0x7c, 0xa0, - 0xc0, 0x1d, 0x66, 0xfb, 0xa7, 0x2d, 0x9b, 0xe4, 0x7c, 0xec, 0x41, 0xff, 0x29, 0x00, 0x3c, 0x16, 0x43, 0x5d, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x66, 0xdf, 0xb3, 0x7c, 0x2a, 0xba, 0x67, 0xcd, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x03, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, + 0x32, 0x5f, 0x30, 0x33, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x18, 0x24, 0x07, 0x01, 0x24, + 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x43, 0xcd, 0xfa, 0xbc, 0xf2, 0xf4, 0x8c, 0x10, 0x6f, 0x5f, 0xd8, 0x90, 0x87, 0x29, 0xee, + 0xfd, 0x6e, 0xea, 0x92, 0xb6, 0x49, 0x0e, 0x10, 0x53, 0x6d, 0x1b, 0x0b, 0xb0, 0xc9, 0x7a, 0x28, 0x83, 0x57, 0x21, 0x69, 0x1b, + 0x2a, 0x4e, 0xd2, 0xa6, 0x52, 0xb0, 0xdc, 0x19, 0xd5, 0x2a, 0x30, 0xea, 0x2d, 0x58, 0x6b, 0xb1, 0x22, 0x0b, 0x69, 0xcd, 0xd6, + 0xeb, 0x0a, 0x3e, 0xe2, 0xf2, 0x5f, 0x61, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, + 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x31, 0x1f, 0x1b, 0x10, 0x15, 0x5c, 0xe5, 0x4f, 0xf0, 0xc8, 0xfc, 0xf4, 0x6e, 0xf5, 0x28, + 0xb9, 0xb7, 0xb0, 0x0b, 0x0a, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, + 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0xe1, 0xf6, 0x61, 0x61, 0x0e, 0xc6, 0x8a, 0x42, 0xe9, 0x00, + 0x73, 0x67, 0xd0, 0x74, 0xf7, 0x1a, 0x60, 0x80, 0xa0, 0xa4, 0x4d, 0xa6, 0xbd, 0xd7, 0xd2, 0x0f, 0x8b, 0x15, 0xec, 0x2f, 0xaa, + 0xc4, 0x65, 0xa5, 0x19, 0x47, 0x72, 0xe9, 0xfd, 0x57, 0x66, 0x00, 0x3d, 0xce, 0x7c, 0xa0, 0xc0, 0x1d, 0x66, 0xfb, 0xa7, 0x2d, + 0x9b, 0xe4, 0x7c, 0xec, 0x41, 0xff, 0x29, 0x00, 0x3c, 0x16, 0x43, 0x5d, 0x18, }; extern const uint32_t sTestCert_Node02_03_Chip_Len = sizeof(sTestCert_Node02_03_Chip); @@ -1692,21 +1685,21 @@ AwEHoUQDQgAEWOtvoDRKCEWvz9bPMf5ekidOtjHqraujS4TujQFu4lfVN0++qASG */ extern const uint8_t sTestCert_Node02_04_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x06, 0xdb, 0xd2, 0x60, 0x78, 0x4a, 0x6e, 0x50, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, - 0xa0, 0x2c, 0x01, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x34, 0x27, 0x15, 0x1d, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x04, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, - 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x58, 0xeb, 0x6f, 0xa0, 0x34, 0x4a, 0x08, 0x45, 0xaf, - 0xcf, 0xd6, 0xcf, 0x31, 0xfe, 0x5e, 0x92, 0x27, 0x4e, 0xb6, 0x31, 0xea, 0xad, 0xab, 0xa3, 0x4b, 0x84, 0xee, 0x8d, 0x01, 0x6e, - 0xe2, 0x57, 0xd5, 0x37, 0x4f, 0xbe, 0xa8, 0x04, 0x86, 0xd3, 0xd9, 0x3f, 0x15, 0x1c, 0x3f, 0xea, 0x24, 0x25, 0xa6, 0xf4, 0x57, - 0xb1, 0xb7, 0x87, 0x79, 0x9f, 0x4b, 0xa8, 0x24, 0x01, 0x00, 0x99, 0xf8, 0x8c, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, - 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x44, 0xfa, 0x8c, 0x5f, 0x32, 0xee, 0x1f, 0xfc, 0x9d, - 0x98, 0x1f, 0x90, 0xab, 0x2e, 0xcc, 0xd0, 0x65, 0xac, 0xed, 0x05, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, - 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x58, 0x80, 0xe4, 0x98, - 0x79, 0x04, 0x6e, 0xc1, 0x08, 0x51, 0x38, 0xfd, 0x42, 0xc7, 0x48, 0x8d, 0xfc, 0xa1, 0xaa, 0xaa, 0x81, 0xd8, 0x37, 0x87, 0xa2, - 0xee, 0x2a, 0x65, 0xd9, 0xf2, 0x4f, 0x09, 0x91, 0x85, 0x9a, 0x9d, 0x2d, 0x08, 0x0d, 0x9b, 0x0b, 0x14, 0xa2, 0x28, 0x99, 0xf1, - 0xfb, 0xc2, 0x52, 0xcf, 0x52, 0x94, 0xa0, 0xbe, 0x8f, 0x3c, 0xe5, 0xbb, 0x22, 0x58, 0x7b, 0x9a, 0xc2, 0xb4, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x06, 0xdb, 0xd2, 0x60, 0x78, 0x4a, 0x6e, 0x50, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x2c, 0x01, 0x0d, 0x54, 0x65, + 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x34, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, + 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x04, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, + 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x58, 0xeb, 0x6f, 0xa0, 0x34, 0x4a, 0x08, 0x45, 0xaf, 0xcf, 0xd6, 0xcf, 0x31, 0xfe, 0x5e, + 0x92, 0x27, 0x4e, 0xb6, 0x31, 0xea, 0xad, 0xab, 0xa3, 0x4b, 0x84, 0xee, 0x8d, 0x01, 0x6e, 0xe2, 0x57, 0xd5, 0x37, 0x4f, 0xbe, + 0xa8, 0x04, 0x86, 0xd3, 0xd9, 0x3f, 0x15, 0x1c, 0x3f, 0xea, 0x24, 0x25, 0xa6, 0xf4, 0x57, 0xb1, 0xb7, 0x87, 0x79, 0x9f, 0x4b, + 0xa8, 0x24, 0x01, 0x00, 0x99, 0xf8, 0x8c, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, + 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x44, 0xfa, 0x8c, 0x5f, 0x32, 0xee, 0x1f, 0xfc, 0x9d, 0x98, 0x1f, 0x90, 0xab, 0x2e, 0xcc, + 0xd0, 0x65, 0xac, 0xed, 0x05, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, + 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x58, 0x80, 0xe4, 0x98, 0x79, 0x04, 0x6e, 0xc1, 0x08, 0x51, + 0x38, 0xfd, 0x42, 0xc7, 0x48, 0x8d, 0xfc, 0xa1, 0xaa, 0xaa, 0x81, 0xd8, 0x37, 0x87, 0xa2, 0xee, 0x2a, 0x65, 0xd9, 0xf2, 0x4f, + 0x09, 0x91, 0x85, 0x9a, 0x9d, 0x2d, 0x08, 0x0d, 0x9b, 0x0b, 0x14, 0xa2, 0x28, 0x99, 0xf1, 0xfb, 0xc2, 0x52, 0xcf, 0x52, 0x94, + 0xa0, 0xbe, 0x8f, 0x3c, 0xe5, 0xbb, 0x22, 0x58, 0x7b, 0x9a, 0xc2, 0xb4, 0x18, }; extern const uint32_t sTestCert_Node02_04_Chip_Len = sizeof(sTestCert_Node02_04_Chip); @@ -1829,22 +1822,22 @@ G/SQP4FH4KQvpw9GbslSf5mVApR6RJ3r9w== */ extern const uint8_t sTestCert_Node02_05_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x29, 0xe7, 0xc5, 0x6c, 0x4a, 0x23, 0x77, 0x1b, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, - 0xa0, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x05, 0x00, - 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xc3, 0x85, 0xf5, 0xb5, - 0x79, 0x09, 0xea, 0x91, 0xd2, 0x08, 0x45, 0xf8, 0x1b, 0xe1, 0x01, 0x10, 0x36, 0x93, 0x60, 0xf7, 0xdc, 0x25, 0x80, 0x22, 0x91, - 0x6d, 0x0e, 0x55, 0x39, 0xb2, 0x47, 0x78, 0x2d, 0xfa, 0xf0, 0x1c, 0x61, 0xf8, 0xeb, 0x1b, 0xf4, 0x90, 0x3f, 0x81, 0x47, 0xe0, - 0xa4, 0x2f, 0xa7, 0x0f, 0x46, 0x6e, 0xc9, 0x52, 0x7f, 0x99, 0x95, 0x02, 0x94, 0x7a, 0x44, 0x9d, 0xeb, 0xf7, 0x37, 0x0a, 0x35, - 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, 0x8e, 0x1d, 0x22, - 0x39, 0x40, 0xb9, 0xb6, 0x01, 0x0b, 0xa7, 0x58, 0x96, 0xe1, 0x1d, 0x7a, 0x3e, 0x09, 0x6a, 0x72, 0x30, 0x05, 0x14, 0xcf, 0x42, - 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x06, 0x1a, - 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, - 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x18, 0x30, 0x0b, 0x40, 0x5a, 0x8f, 0xf8, 0x2a, 0x9c, 0xa9, 0x24, 0x24, 0x89, 0x0d, 0x5d, 0x71, - 0x4a, 0x1d, 0xab, 0x05, 0x94, 0xcb, 0x8d, 0x6a, 0xb0, 0x36, 0x55, 0xc8, 0xcb, 0xd5, 0x1d, 0x68, 0x29, 0x8c, 0xd8, 0x09, 0x15, - 0x71, 0xfb, 0x40, 0x95, 0x5a, 0x22, 0x64, 0xb9, 0xad, 0x86, 0xd8, 0x94, 0xb4, 0x06, 0xa0, 0x46, 0xef, 0x80, 0xb8, 0xc2, 0xc5, - 0x8d, 0xa9, 0xb0, 0x17, 0x20, 0x0f, 0x68, 0xb0, 0x6f, 0x14, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x29, 0xe7, 0xc5, 0x6c, 0x4a, 0x23, 0x77, 0x1b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, + 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, + 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x27, 0x15, + 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x05, 0x00, 0x02, 0x00, + 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xc3, 0x85, 0xf5, 0xb5, 0x79, + 0x09, 0xea, 0x91, 0xd2, 0x08, 0x45, 0xf8, 0x1b, 0xe1, 0x01, 0x10, 0x36, 0x93, 0x60, 0xf7, 0xdc, 0x25, 0x80, 0x22, 0x91, + 0x6d, 0x0e, 0x55, 0x39, 0xb2, 0x47, 0x78, 0x2d, 0xfa, 0xf0, 0x1c, 0x61, 0xf8, 0xeb, 0x1b, 0xf4, 0x90, 0x3f, 0x81, 0x47, + 0xe0, 0xa4, 0x2f, 0xa7, 0x0f, 0x46, 0x6e, 0xc9, 0x52, 0x7f, 0x99, 0x95, 0x02, 0x94, 0x7a, 0x44, 0x9d, 0xeb, 0xf7, 0x37, + 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, + 0x8e, 0x1d, 0x22, 0x39, 0x40, 0xb9, 0xb6, 0x01, 0x0b, 0xa7, 0x58, 0x96, 0xe1, 0x1d, 0x7a, 0x3e, 0x09, 0x6a, 0x72, 0x30, + 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, + 0x3d, 0x84, 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, + 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x18, 0x30, 0x0b, 0x40, 0x5a, 0x8f, 0xf8, 0x2a, 0x9c, + 0xa9, 0x24, 0x24, 0x89, 0x0d, 0x5d, 0x71, 0x4a, 0x1d, 0xab, 0x05, 0x94, 0xcb, 0x8d, 0x6a, 0xb0, 0x36, 0x55, 0xc8, 0xcb, + 0xd5, 0x1d, 0x68, 0x29, 0x8c, 0xd8, 0x09, 0x15, 0x71, 0xfb, 0x40, 0x95, 0x5a, 0x22, 0x64, 0xb9, 0xad, 0x86, 0xd8, 0x94, + 0xb4, 0x06, 0xa0, 0x46, 0xef, 0x80, 0xb8, 0xc2, 0xc5, 0x8d, 0xa9, 0xb0, 0x17, 0x20, 0x0f, 0x68, 0xb0, 0x6f, 0x14, 0x18, }; extern const uint32_t sTestCert_Node02_05_Chip_Len = sizeof(sTestCert_Node02_05_Chip); @@ -1974,23 +1967,23 @@ TvJK2J6ARZRf3dBAC0WYFz/XW6Cy9EMnMg== */ extern const uint8_t sTestCert_Node02_06_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x68, 0x4e, 0xd2, 0x84, 0xb5, 0x1a, 0x0d, 0x86, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x06, 0x00, 0x02, - 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, - 0x01, 0x30, 0x09, 0x41, 0x04, 0x9f, 0x7b, 0x6e, 0xa3, 0x42, 0xa5, 0x02, 0x10, 0xda, 0x1d, 0xfa, 0xff, 0xba, 0xca, 0x6b, 0x70, - 0x11, 0xc0, 0x2a, 0x7f, 0xac, 0x39, 0x73, 0xbd, 0xd3, 0x06, 0x24, 0xc9, 0xc7, 0x09, 0x6c, 0xcb, 0x97, 0xfa, 0x26, 0xcb, 0x50, - 0xff, 0x83, 0x4e, 0xf2, 0x4a, 0xd8, 0x9e, 0x80, 0x45, 0x94, 0x5f, 0xdd, 0xd0, 0x40, 0x0b, 0x45, 0x98, 0x17, 0x3f, 0xd7, 0x5b, - 0xa0, 0xb2, 0xf4, 0x43, 0x27, 0x32, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, - 0x01, 0x18, 0x30, 0x04, 0x14, 0xab, 0x89, 0x94, 0x81, 0xdd, 0x06, 0xd6, 0x22, 0xa0, 0x13, 0xc8, 0xba, 0x7d, 0x95, 0xc4, 0x8d, - 0xb9, 0x7e, 0x5b, 0x2f, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, - 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, - 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, 0x20, 0x06, 0x08, - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, - 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xe2, 0x9a, 0x0e, 0xbd, 0x45, 0xbe, 0x4f, 0x52, - 0xbd, 0x83, 0xca, 0x06, 0x97, 0x15, 0xed, 0x08, 0x37, 0xf6, 0x25, 0x82, 0xc0, 0x02, 0x26, 0x28, 0x57, 0xb2, 0xf2, 0x2f, 0x9d, - 0xb1, 0xe1, 0x24, 0xd9, 0x0a, 0xda, 0xe9, 0x11, 0x80, 0x79, 0x72, 0xf2, 0xf3, 0x74, 0x4e, 0x29, 0x95, 0xd4, 0xf8, 0xbf, 0x19, - 0xf9, 0xd4, 0x3f, 0xcd, 0xa6, 0x3d, 0x28, 0x56, 0x6f, 0x87, 0xce, 0x3d, 0xaf, 0xb4, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x68, 0x4e, 0xd2, 0x84, 0xb5, 0x1a, 0x0d, 0x86, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x06, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9f, + 0x7b, 0x6e, 0xa3, 0x42, 0xa5, 0x02, 0x10, 0xda, 0x1d, 0xfa, 0xff, 0xba, 0xca, 0x6b, 0x70, 0x11, 0xc0, 0x2a, 0x7f, 0xac, 0x39, + 0x73, 0xbd, 0xd3, 0x06, 0x24, 0xc9, 0xc7, 0x09, 0x6c, 0xcb, 0x97, 0xfa, 0x26, 0xcb, 0x50, 0xff, 0x83, 0x4e, 0xf2, 0x4a, 0xd8, + 0x9e, 0x80, 0x45, 0x94, 0x5f, 0xdd, 0xd0, 0x40, 0x0b, 0x45, 0x98, 0x17, 0x3f, 0xd7, 0x5b, 0xa0, 0xb2, 0xf4, 0x43, 0x27, 0x32, + 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xab, + 0x89, 0x94, 0x81, 0xdd, 0x06, 0xd6, 0x22, 0xa0, 0x13, 0xc8, 0xba, 0x7d, 0x95, 0xc4, 0x8d, 0xb9, 0x7e, 0x5b, 0x2f, 0x30, 0x05, + 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, + 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, + 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, + 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xe2, 0x9a, 0x0e, 0xbd, 0x45, 0xbe, 0x4f, 0x52, 0xbd, 0x83, 0xca, 0x06, 0x97, 0x15, + 0xed, 0x08, 0x37, 0xf6, 0x25, 0x82, 0xc0, 0x02, 0x26, 0x28, 0x57, 0xb2, 0xf2, 0x2f, 0x9d, 0xb1, 0xe1, 0x24, 0xd9, 0x0a, 0xda, + 0xe9, 0x11, 0x80, 0x79, 0x72, 0xf2, 0xf3, 0x74, 0x4e, 0x29, 0x95, 0xd4, 0xf8, 0xbf, 0x19, 0xf9, 0xd4, 0x3f, 0xcd, 0xa6, 0x3d, + 0x28, 0x56, 0x6f, 0x87, 0xce, 0x3d, 0xaf, 0xb4, 0x18, }; extern const uint32_t sTestCert_Node02_06_Chip_Len = sizeof(sTestCert_Node02_06_Chip); @@ -2119,23 +2112,23 @@ RKIKjPnEHoKMOKVvVojR+q/SiyGHqPQudA== */ extern const uint8_t sTestCert_Node02_07_Chip[] = { - 0xd5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x01, 0x08, 0x2a, 0x17, 0x96, 0x53, 0xd7, 0xaa, 0x08, 0xbf, 0x24, 0x02, 0x01, - 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, - 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x07, 0x00, 0x02, - 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, - 0x01, 0x30, 0x09, 0x41, 0x04, 0xf1, 0x1b, 0x05, 0x37, 0xf3, 0x73, 0x5c, 0xdc, 0xfa, 0xc5, 0x86, 0x15, 0xdd, 0x1b, 0x13, 0x4a, - 0x83, 0x85, 0xa4, 0x75, 0x15, 0x58, 0xfb, 0xd1, 0xfe, 0xd2, 0x55, 0x93, 0x35, 0xd0, 0xc2, 0x42, 0x6f, 0x60, 0x08, 0xf6, 0x05, - 0x01, 0xf6, 0x44, 0xa2, 0x0a, 0x8c, 0xf9, 0xc4, 0x1e, 0x82, 0x8c, 0x38, 0xa5, 0x6f, 0x56, 0x88, 0xd1, 0xfa, 0xaf, 0xd2, 0x8b, - 0x21, 0x87, 0xa8, 0xf4, 0x2e, 0x74, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, - 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, 0x58, 0x71, 0xe3, 0xad, 0x6d, 0xab, 0x0d, 0xbf, 0x29, 0xa5, 0x3c, 0xaa, 0x5b, 0x99, 0x1e, - 0x10, 0xbe, 0x71, 0x98, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, - 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x06, 0x1d, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x11, - 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, - 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, - 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xf1, 0x10, 0x28, 0xaa, 0x62, - 0xe4, 0xe9, 0xcd, 0xab, 0xab, 0xc5, 0x6c, 0x79, 0xc4, 0x5c, 0x4f, 0x04, 0xad, 0xc8, 0x03, 0x37, 0x68, 0x4c, 0xec, 0x78, 0xdc, - 0x86, 0x0c, 0x1b, 0xe8, 0x95, 0xd2, 0x8c, 0x3b, 0x50, 0x55, 0x63, 0xef, 0x99, 0xb2, 0x98, 0x2f, 0x7b, 0xea, 0x03, 0xf3, 0x21, - 0x56, 0xec, 0x98, 0xd0, 0xe5, 0xb8, 0xbf, 0xd1, 0x45, 0x52, 0x04, 0x52, 0xc6, 0x2a, 0x63, 0xc9, 0xb2, 0x18, + 0x15, 0x30, 0x01, 0x08, 0x2a, 0x17, 0x96, 0x53, 0xd7, 0xaa, 0x08, 0xbf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x07, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xf1, + 0x1b, 0x05, 0x37, 0xf3, 0x73, 0x5c, 0xdc, 0xfa, 0xc5, 0x86, 0x15, 0xdd, 0x1b, 0x13, 0x4a, 0x83, 0x85, 0xa4, 0x75, 0x15, 0x58, + 0xfb, 0xd1, 0xfe, 0xd2, 0x55, 0x93, 0x35, 0xd0, 0xc2, 0x42, 0x6f, 0x60, 0x08, 0xf6, 0x05, 0x01, 0xf6, 0x44, 0xa2, 0x0a, 0x8c, + 0xf9, 0xc4, 0x1e, 0x82, 0x8c, 0x38, 0xa5, 0x6f, 0x56, 0x88, 0xd1, 0xfa, 0xaf, 0xd2, 0x8b, 0x21, 0x87, 0xa8, 0xf4, 0x2e, 0x74, + 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, + 0x58, 0x71, 0xe3, 0xad, 0x6d, 0xab, 0x0d, 0xbf, 0x29, 0xa5, 0x3c, 0xaa, 0x5b, 0x99, 0x1e, 0x10, 0xbe, 0x71, 0x98, 0x30, 0x05, + 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, + 0x30, 0x06, 0x1d, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, + 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, + 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xf1, 0x10, 0x28, 0xaa, 0x62, 0xe4, 0xe9, 0xcd, 0xab, 0xab, 0xc5, + 0x6c, 0x79, 0xc4, 0x5c, 0x4f, 0x04, 0xad, 0xc8, 0x03, 0x37, 0x68, 0x4c, 0xec, 0x78, 0xdc, 0x86, 0x0c, 0x1b, 0xe8, 0x95, 0xd2, + 0x8c, 0x3b, 0x50, 0x55, 0x63, 0xef, 0x99, 0xb2, 0x98, 0x2f, 0x7b, 0xea, 0x03, 0xf3, 0x21, 0x56, 0xec, 0x98, 0xd0, 0xe5, 0xb8, + 0xbf, 0xd1, 0x45, 0x52, 0x04, 0x52, 0xc6, 0x2a, 0x63, 0xc9, 0xb2, 0x18, }; extern const uint32_t sTestCert_Node02_07_Chip_Len = sizeof(sTestCert_Node02_07_Chip); diff --git a/src/tools/chip-cert/CertUtils.cpp b/src/tools/chip-cert/CertUtils.cpp index 789a9e20dbcf17..46ffe701749e5a 100644 --- a/src/tools/chip-cert/CertUtils.cpp +++ b/src/tools/chip-cert/CertUtils.cpp @@ -163,10 +163,10 @@ namespace { CertFormat DetectCertFormat(uint8_t * cert, uint32_t certLen) { - static const uint8_t chipRawPrefix[] = { 0xD5, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00 }; - static const char * chipB64Prefix = "1QAACAAB"; - static const uint32_t chipB64PrefixLen = sizeof(chipB64Prefix) - 1; - static const char * pemMarker = "-----BEGIN CERTIFICATE-----"; + static const uint8_t chipRawPrefix[] = { 0x15, 0x30, 0x01 }; + static const char * chipB64Prefix = "FTABC"; + static const size_t chipB64PrefixLen = strlen(chipB64Prefix); + static const char * pemMarker = "-----BEGIN CERTIFICATE-----"; if (certLen > sizeof(chipRawPrefix) && memcmp(cert, chipRawPrefix, sizeof(chipRawPrefix)) == 0) { From ac9c7758913beb8870719d4caaaba57933a4adb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Fri, 9 Jul 2021 20:28:19 +0200 Subject: [PATCH 35/47] [nrfconnect] Update nRF Connect version (#8242) * [nrfconnect] Update nRF Connect version Bump supported nRF Connect SDK version, including the Docker image, and fix all related build issues. * Restyled by clang-format Co-authored-by: Restyled.io --- config/nrfconnect/.nrfconnect-recommended-revision | 2 +- config/nrfconnect/chip-module/CMakeLists.txt | 8 +++++--- .../docker/images/chip-build-nrf-platform/Dockerfile | 6 ++++-- integrations/docker/images/chip-build/version | 2 +- src/platform/OpenThread/OpenThreadUtils.cpp | 5 +++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/config/nrfconnect/.nrfconnect-recommended-revision b/config/nrfconnect/.nrfconnect-recommended-revision index ca034d72135e1d..09f7be2e8aea04 100644 --- a/config/nrfconnect/.nrfconnect-recommended-revision +++ b/config/nrfconnect/.nrfconnect-recommended-revision @@ -1 +1 @@ -910c9ce5ba8ea30155b50b9d12f03ece7123a0c2 +55ae470380f17a949fe45b7686cf5c8743d5fb30 diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index c8d8d808b04021..fb308760159415 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -99,9 +99,11 @@ if (CONFIG_POSIX_API) endif() if (CONFIG_NORDIC_SECURITY_BACKEND) - # TODO: Remove when the missing dependency is fixed in nRF Connect SDK - zephyr_include_directories(${ZEPHYR_BASE}/../nrfxlib/crypto/nrf_cc310_platform/include) - + zephyr_include_directories($) + zephyr_include_directories($) + if(TARGET platform_cc3xx) + zephyr_include_directories($) + endif() list(APPEND CHIP_CFLAGS -DMBEDTLS_CONFIG_FILE=) endif() diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index 826dfb66a957a3..c658a5fa87225d 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -2,7 +2,7 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} # Compatible Nordic Connect SDK revision. -ARG NCS_REVISION=910c9ce5ba8ea30155b50b9d12f03ece7123a0c2 +ARG NCS_REVISION=55ae470380f17a949fe45b7686cf5c8743d5fb30 # ================================================== # nRF Connect SDK dependencies @@ -27,11 +27,13 @@ RUN set -x \ WORKDIR /opt/NordicSemiconductor/nrfconnect RUN set -x \ + # python3-yaml package conflicts with nRF Python requirements + && (apt remove -fy python3-yaml && apt autoremove || exit 0) \ && 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 config update.narrow true \ && west config update.fetch smart \ - && west update -o=--depth=1 \ + && west update -o=--depth=1 -n -f smart \ && 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 \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 48c7cdb0aaa3c3..385186430a8f04 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.4.30 +0.4.31 diff --git a/src/platform/OpenThread/OpenThreadUtils.cpp b/src/platform/OpenThread/OpenThreadUtils.cpp index 6a8a673a2f6250..43632428f8fa51 100644 --- a/src/platform/OpenThread/OpenThreadUtils.cpp +++ b/src/platform/OpenThread/OpenThreadUtils.cpp @@ -95,8 +95,13 @@ void LogOpenThreadStateChange(otInstance * otInst, uint32_t flags) { #if CHIP_DETAIL_LOGGING +#if OPENTHREAD_API_VERSION >= 126 + const uint32_t kParamsChanged = (OT_CHANGED_THREAD_NETWORK_NAME | OT_CHANGED_THREAD_PANID | OT_CHANGED_THREAD_EXT_PANID | + OT_CHANGED_THREAD_CHANNEL | OT_CHANGED_NETWORK_KEY | OT_CHANGED_PSKC); +#else const uint32_t kParamsChanged = (OT_CHANGED_THREAD_NETWORK_NAME | OT_CHANGED_THREAD_PANID | OT_CHANGED_THREAD_EXT_PANID | OT_CHANGED_THREAD_CHANNEL | OT_CHANGED_MASTER_KEY | OT_CHANGED_PSKC); +#endif static char strBuf[64]; From 8109c009ca8aca73f3fa88a40bf2fc1165e5c02a Mon Sep 17 00:00:00 2001 From: Faqiang Zhu <71302147+FaqiangZhu-nxp@users.noreply.github.com> Date: Sat, 10 Jul 2021 04:45:01 +0800 Subject: [PATCH 36/47] add a custom toolchain for customized use (#8077) * add a linux_arm toolchain for customized use This tool chain is targeted to Linux running on ARM SoC, because there is a demand of running some of the example tools like "chip-tool" on embeded linux device instead of on Linux laptop. If the target_os is linux and the target_cpu is "arm" or "arm64", this toolchain will be used. It is similar to the "CROSS_COMPILE" when build kernel, a build arg named "linux_arm_cross_compile" need to be specified also, it should be a path to the cross compile tools. Take the embedded linux SDK into consideration, other build args to specify in the command line includes: * target_os * target_cpu * arm_arch * target_cflags * target_ldflags * etc. And the pkg-config tool need below two enviroment to be well set to correctly find the include path: * PKG_CONFIG_SYSROOT_DIR * PKG_CONFIG_LIBDIR A demo command to generate ninja files are listed below, the content in angle brackets need to be updated with developer's local env. PKG_CONFIG_SYSROOT_DIR= \ PKG_CONFIG_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig:${PKG_CONFIG_SYSROOT_DIR}/usr/share/pkgconfig \ gn gen out out/aarch64 --args='target_os="linux" target_cpu="arm64" arm_arch="armv8-a" target_cflags=[ "--sysroot=" ] target_ldflags=[ "--sysroot=" ] linux_arm_cross_compile=""' Change-Id: Id4b7b4932e16fcc42d77af7020ebb6a7133e237b Signed-off-by: faqiang.zhu * Restyled by gn * rename the linux_arm toolchain as custom toolchain The original linux_arm toolchain is not arm specific, it's just a customizable toolchain. rename it as custom. Do not use this toolchain based on the target_cpu and target_os, use build argument "custom_toolchain" to specify this toolchain. For example, to build with tools in NXP i.MX 8M yocto release SDK, the command to generate ninja files can be: PKG_CONFIG_SYSROOT_DIR= \ PKG_CONFIG_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig:${PKG_CONFIG_SYSROOT_DIR}/usr/share/pkgconfig \ gn gen out/aarch64 --args='target_os="linux" target_cpu="arm64" arm_arch="armv8-a" import("//build_overrides/build.gni") target_cflags=[ "--sysroot=" ] target_ldflags=[ "--sysroot=" ] custom_toolchain="${build_root}/toolchain/custom" target_cc="" target_cxx="" target_ar=""' Signed-off-by: faqiang.zhu Co-authored-by: Restyled.io --- build/toolchain/custom/BUILD.gn | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 build/toolchain/custom/BUILD.gn diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn new file mode 100644 index 00000000000000..f0ee798e9db194 --- /dev/null +++ b/build/toolchain/custom/BUILD.gn @@ -0,0 +1,45 @@ +# 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("//build_overrides/build.gni") +import("${build_root}/config/compiler/compiler.gni") +import("${build_root}/toolchain/gcc_toolchain.gni") + +declare_args() { + # C compiler to use for target build. + target_cc = "" + + # C++ compiler to use for target build. + target_cxx = "" + + # Archive tool to use for target build. + target_ar = "" +} + +gcc_toolchain("custom") { + if (target_cc == "" || target_cxx == "" || target_ar == "") { + assert(false, + "build arguments target_cc, target_cxx and target_ar need to be set") + } + + ar = target_ar + cc = target_cc + cxx = target_cxx + + toolchain_args = { + current_os = target_os + current_cpu = target_cpu + is_clang = is_clang + } +} From fb773e8a5f455777bc74caf770f2b8cf45418846 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 9 Jul 2021 13:52:37 -0700 Subject: [PATCH 37/47] Add IM subscribe request/response builder and parser (#8194) Summary of Changes: -- Add IM subscribe request/response builder and parser -- Add ReturnLogErrorOnFailure and VerifyOrReturnLogError --- src/app/BUILD.gn | 2 + src/app/MessageDef/SubscribeRequest.cpp | 312 +++++++++++++++++++++++ src/app/MessageDef/SubscribeRequest.h | 183 +++++++++++++ src/app/MessageDef/SubscribeResponse.cpp | 136 ++++++++++ src/app/MessageDef/SubscribeResponse.h | 99 +++++++ src/app/tests/TestMessageDef.cpp | 165 ++++++++++++ src/lib/support/CodeUtils.h | 51 ++++ 7 files changed, 948 insertions(+) create mode 100644 src/app/MessageDef/SubscribeRequest.cpp create mode 100644 src/app/MessageDef/SubscribeRequest.h create mode 100644 src/app/MessageDef/SubscribeResponse.cpp create mode 100644 src/app/MessageDef/SubscribeResponse.h diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 9fd877d4cc7c33..949492eea54c73 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -87,6 +87,8 @@ static_library("app") { "MessageDef/ReportData.h", "MessageDef/StatusElement.cpp", "MessageDef/StatusElement.h", + "MessageDef/SubscribeRequest.cpp", + "MessageDef/SubscribeResponse.cpp", "MessageDef/WriteRequest.cpp", "MessageDef/WriteResponse.cpp", "ReadClient.cpp", diff --git a/src/app/MessageDef/SubscribeRequest.cpp b/src/app/MessageDef/SubscribeRequest.cpp new file mode 100644 index 00000000000000..c196814f788dc3 --- /dev/null +++ b/src/app/MessageDef/SubscribeRequest.cpp @@ -0,0 +1,312 @@ +/** + * + * 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. + */ + +#include "SubscribeRequest.h" +#include "MessageDefHelper.h" + +namespace chip { +namespace app { +CHIP_ERROR SubscribeRequest::Parser::Init(const chip::TLV::TLVReader & aReader) +{ + // make a copy of the reader here + mReader.Init(aReader); + + VerifyOrReturnLogError(chip::TLV::kTLVType_Structure == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnLogErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); + return CHIP_NO_ERROR; +} + +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK +CHIP_ERROR SubscribeRequest::Parser::CheckSchemaValidity() const +{ + CHIP_ERROR err = CHIP_NO_ERROR; + uint16_t TagPresenceMask = 0; + chip::TLV::TLVReader reader; + AttributePathList::Parser attributePathList; + EventPathList::Parser eventPathList; + AttributeDataVersionList::Parser attributeDataVersionList; + PRETTY_PRINT("SubscribeRequest ="); + PRETTY_PRINT("{"); + + // make a copy of the reader + reader.Init(mReader); + + while (CHIP_NO_ERROR == (err = reader.Next())) + { + VerifyOrReturnLogError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (chip::TLV::TagNumFromTag(reader.GetTag())) + { + case kCsTag_AttributePathList: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_AttributePathList)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_AttributePathList); + VerifyOrReturnLogError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + + attributePathList.Init(reader); + + PRETTY_PRINT_INCDEPTH(); + ReturnLogErrorOnFailure(attributePathList.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + break; + case kCsTag_EventPathList: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_EventPathList)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_EventPathList); + VerifyOrReturnLogError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + + eventPathList.Init(reader); + + PRETTY_PRINT_INCDEPTH(); + + ReturnLogErrorOnFailure(eventPathList.CheckSchemaValidity()); + + PRETTY_PRINT_DECDEPTH(); + break; + case kCsTag_AttributeDataVersionList: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_AttributeDataVersionList)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_AttributeDataVersionList); + VerifyOrReturnLogError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + + attributeDataVersionList.Init(reader); + + PRETTY_PRINT_INCDEPTH(); + ReturnLogErrorOnFailure(attributeDataVersionList.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + break; + case kCsTag_EventNumber: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_EventNumber)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_EventNumber); + VerifyOrReturnLogError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + uint64_t eventNumber; + ReturnLogErrorOnFailure(reader.Get(eventNumber)); + PRETTY_PRINT("\tEventNumber = 0x%" PRIx64 ",", eventNumber); + } +#endif // CHIP_DETAIL_LOGGING + break; + case kCsTag_MinInterval: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_MinInterval)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_MinInterval); + VerifyOrReturnLogError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + uint16_t minInterval; + ReturnLogErrorOnFailure(reader.Get(minInterval)); + PRETTY_PRINT("\tMinInterval = 0x%" PRIx16 ",", minInterval); + } + break; +#endif // CHIP_DETAIL_LOGGING + case kCsTag_MaxInterval: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_MaxInterval)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_MaxInterval); + VerifyOrReturnLogError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + uint16_t maxInterval; + ReturnLogErrorOnFailure(reader.Get(maxInterval)); + PRETTY_PRINT("\tkMaxInterval = 0x%" PRIx16 ",", maxInterval); + } +#endif // CHIP_DETAIL_LOGGING + break; + case kCsTag_KeepExistingSubscriptions: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_KeepExistingSubscriptions)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_KeepExistingSubscriptions); + VerifyOrReturnLogError(chip::TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + bool keepExistingSubscriptions; + ReturnLogErrorOnFailure(reader.Get(keepExistingSubscriptions)); + PRETTY_PRINT("\tKeepExistingSubscriptions = %s, ", keepExistingSubscriptions ? "true" : "false"); + } +#endif // CHIP_DETAIL_LOGGING + break; + case kCsTag_IsProxy: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_IsProxy)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_IsProxy); + VerifyOrReturnLogError(chip::TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + bool isProxy; + ReturnLogErrorOnFailure(reader.Get(isProxy)); + PRETTY_PRINT("\tIsProxy = %s, ", isProxy ? "true" : "false"); + } +#endif // CHIP_DETAIL_LOGGING + break; + default: + ReturnLogErrorOnFailure(CHIP_ERROR_INVALID_TLV_TAG); + } + } + + PRETTY_PRINT("}"); + PRETTY_PRINT(""); + if (CHIP_END_OF_TLV == err) + { + const uint16_t RequiredFields = (1 << kCsTag_MinInterval) | (1 << kCsTag_MaxInterval); + + if ((TagPresenceMask & RequiredFields) == RequiredFields) + { + err = CHIP_NO_ERROR; + } + } + ReturnLogErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); +} +#endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + +CHIP_ERROR SubscribeRequest::Parser::GetAttributePathList(AttributePathList::Parser * const apAttributePathList) const +{ + TLV::TLVReader reader; + ReturnLogErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributePathList), reader)); + VerifyOrReturnLogError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + return apAttributePathList->Init(reader); +} + +CHIP_ERROR SubscribeRequest::Parser::GetEventPathList(EventPathList::Parser * const apEventPathList) const +{ + TLV::TLVReader reader; + ReturnLogErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_EventPathList), reader)); + VerifyOrReturnLogError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + return apEventPathList->Init(reader); +} + +CHIP_ERROR +SubscribeRequest::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const +{ + TLV::TLVReader reader; + ReturnLogErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributeDataVersionList), reader)); + VerifyOrReturnLogError(TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + return apAttributeDataVersionList->Init(reader); +} + +CHIP_ERROR SubscribeRequest::Parser::GetEventNumber(uint64_t * const apEventNumber) const +{ + return GetUnsignedInteger(kCsTag_EventNumber, apEventNumber); +} + +CHIP_ERROR SubscribeRequest::Parser::GetMinIntervalSeconds(uint16_t * const apMinIntervalSeconds) const +{ + return GetUnsignedInteger(kCsTag_EventNumber, apMinIntervalSeconds); +} + +CHIP_ERROR SubscribeRequest::Parser::GetMaxIntervalSeconds(uint16_t * const apMaxIntervalSeconds) const +{ + return GetUnsignedInteger(kCsTag_EventNumber, apMaxIntervalSeconds); +} + +CHIP_ERROR SubscribeRequest::Parser::GetKeepExistingSubscriptions(bool * const apKeepExistingSubscription) const +{ + return GetSimpleValue(kCsTag_KeepExistingSubscriptions, chip::TLV::kTLVType_Boolean, apKeepExistingSubscription); +} + +CHIP_ERROR SubscribeRequest::Parser::GetIsProxy(bool * const apIsProxy) const +{ + return GetSimpleValue(kCsTag_IsProxy, chip::TLV::kTLVType_Boolean, apIsProxy); +} + +CHIP_ERROR SubscribeRequest::Builder::Init(chip::TLV::TLVWriter * const apWriter) +{ + return InitAnonymousStructure(apWriter); +} + +AttributePathList::Builder & SubscribeRequest::Builder::CreateAttributePathListBuilder() +{ + if (mError == CHIP_NO_ERROR) + { + mError = mAttributePathListBuilder.Init(mpWriter, kCsTag_AttributePathList); + ChipLogFunctError(mError); + } + + return mAttributePathListBuilder; +} + +EventPathList::Builder & SubscribeRequest::Builder::CreateEventPathListBuilder() +{ + if (mError == CHIP_NO_ERROR) + { + mError = mEventPathListBuilder.Init(mpWriter, kCsTag_EventPathList); + ChipLogFunctError(mError); + } + + return mEventPathListBuilder; +} + +AttributeDataVersionList::Builder & SubscribeRequest::Builder::CreateAttributeDataVersionListBuilder() +{ + if (mError == CHIP_NO_ERROR) + { + mError = mAttributeDataVersionListBuilder.Init(mpWriter, kCsTag_AttributeDataVersionList); + ChipLogFunctError(mError); + } + + return mAttributeDataVersionListBuilder; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::EventNumber(const uint64_t aEventNumber) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_EventNumber), aEventNumber); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::MinIntervalSeconds(const uint16_t aMinIntervalSeconds) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_MinInterval), aMinIntervalSeconds); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::MaxIntervalSeconds(const uint16_t aMaxIntervalSeconds) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_MaxInterval), aMaxIntervalSeconds); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::KeepExistingSubscriptions(const bool aKeepExistingSubscriptions) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_KeepExistingSubscriptions), aKeepExistingSubscriptions); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::IsProxy(const bool aIsProxy) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_IsProxy), aIsProxy); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeRequest::Builder & SubscribeRequest::Builder::EndOfSubscribeRequest() +{ + EndOfContainer(); + return *this; +} +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/SubscribeRequest.h b/src/app/MessageDef/SubscribeRequest.h new file mode 100644 index 00000000000000..f989cc13c1988d --- /dev/null +++ b/src/app/MessageDef/SubscribeRequest.h @@ -0,0 +1,183 @@ +/** + * + * 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 "AttributeDataVersionList.h" +#include "AttributePathList.h" +#include "Builder.h" +#include "EventPathList.h" +#include "Parser.h" +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace SubscribeRequest { +enum +{ + kCsTag_AttributePathList = 0, + kCsTag_EventPathList = 1, + kCsTag_AttributeDataVersionList = 2, + kCsTag_EventNumber = 3, + kCsTag_MinInterval = 4, + kCsTag_MaxInterval = 5, + kCsTag_KeepExistingSubscriptions = 6, + kCsTag_IsProxy = 7, +}; + +class Parser : public chip::app::Parser +{ +public: + /** + * @param [in] aReader A pointer to a TLVReader, which should point to the beginning of this request + */ + CHIP_ERROR Init(const chip::TLV::TLVReader & aReader); +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + /** + * @brief Roughly verify the message is correctly formed + * 1) all mandatory tags are present + * 2) all elements have expected data type + * 3) any tag can only appear once + * 4) At the top level of the structure, unknown tags are ignored for forward compatibility + * @note The main use of this function is to print out what we're + * receiving during protocol development and debugging. + * The encoding rule has changed in IM encoding spec so this + * check is only "roughly" conformant now. + */ + CHIP_ERROR CheckSchemaValidity() const; +#endif + + /** + * @brief Get a TLVReader for the AttributePathList. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetAttributePathList(AttributePathList::Parser * const apAttributePathList) const; + + /** + * @brief Get a TLVReader for the EventPathList. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetEventPathList(EventPathList::Parser * const apEventPathList) const; + + /** + * @brief Get a parser for the AttributeDataVersionList. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const; + + /** + * @brief Get Event Number. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetEventNumber(uint64_t * const apEventNumber) const; + + /** + * @brief Get Min Interval. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetMinIntervalSeconds(uint16_t * const apMinIntervalSeconds) const; + + /** + * @brief Get Max Interval. Next() must be called before accessing them. + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetMaxIntervalSeconds(uint16_t * const apMaxIntervalSeconds) const; + + /** + * @brief Check if subscription is kept. Next() must be called before accessing them. + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetKeepExistingSubscriptions(bool * const apKeepExistingSubscription) const; + + /** + * @brief Check if subscription is kept. Next() must be called before accessing them. + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetIsProxy(bool * const apIsProxy) const; +}; + +class Builder : public chip::app::Builder +{ +public: + CHIP_ERROR Init(chip::TLV::TLVWriter * const apWriter); + + AttributePathList::Builder & CreateAttributePathListBuilder(); + + /** + * @brief Initialize a EventPathList::Builder for writing into the TLV stream + */ + EventPathList::Builder & CreateEventPathListBuilder(); + + /** + * @brief Initialize a AttributeDataVersionList::Builder for writing into the TLV stream + */ + AttributeDataVersionList::Builder & CreateAttributeDataVersionListBuilder(); + + /** + * @brief An initiator can optionally specify an EventNumber it has already to limit the + * set of retrieved events on the server for optimization purposes. + */ + SubscribeRequest::Builder & EventNumber(const uint64_t aEventNumber); + + SubscribeRequest::Builder & MinIntervalSeconds(const uint16_t aMinIntervalSeconds); + + SubscribeRequest::Builder & MaxIntervalSeconds(const uint16_t aMinIntervalSeconds); + + /** + * @brief This is set to 'true' by the subscriber to indicate preservation of previous subscriptions. If omitted, it implies + * 'false' as a value. + */ + SubscribeRequest::Builder & KeepExistingSubscriptions(const bool aKeepExistingSubscriptions); + + /** + * @brief This is set to true by the subscriber if it is a proxy-type device proxying for another client. This + * confers it special privileges on the publisher that might result in evictions of other non-proxy subscriptions + * to make way for the proxy. + */ + SubscribeRequest::Builder & IsProxy(const bool aIsProxy); + + /** + * @brief Mark the end of this SubscribeRequest + */ + SubscribeRequest::Builder & EndOfSubscribeRequest(); + +private: + AttributePathList::Builder mAttributePathListBuilder; + EventPathList::Builder mEventPathListBuilder; + AttributeDataVersionList::Builder mAttributeDataVersionListBuilder; +}; +} // namespace SubscribeRequest +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/SubscribeResponse.cpp b/src/app/MessageDef/SubscribeResponse.cpp new file mode 100644 index 00000000000000..e53c9fe86bebdd --- /dev/null +++ b/src/app/MessageDef/SubscribeResponse.cpp @@ -0,0 +1,136 @@ +/** + * + * 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. + */ + +#include "SubscribeResponse.h" +#include "MessageDefHelper.h" + +namespace chip { +namespace app { +CHIP_ERROR SubscribeResponse::Parser::Init(const chip::TLV::TLVReader & aReader) +{ + // make a copy of the reader here + mReader.Init(aReader); + + VerifyOrReturnLogError(chip::TLV::kTLVType_Structure == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + + ReturnLogErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); + return CHIP_NO_ERROR; +} + +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK +CHIP_ERROR SubscribeResponse::Parser::CheckSchemaValidity() const +{ + CHIP_ERROR err = CHIP_NO_ERROR; + uint16_t TagPresenceMask = 0; + chip::TLV::TLVReader reader; + PRETTY_PRINT("SubscribeResponse ="); + PRETTY_PRINT("{"); + + // make a copy of the reader + reader.Init(mReader); + + while (CHIP_NO_ERROR == (err = reader.Next())) + { + VerifyOrReturnLogError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (chip::TLV::TagNumFromTag(reader.GetTag())) + { + case kCsTag_SubscriptionId: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_SubscriptionId)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_SubscriptionId); + VerifyOrReturnLogError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + uint64_t subscriptionId; + ReturnLogErrorOnFailure(reader.Get(subscriptionId)); + PRETTY_PRINT("\tSubscriptionId = 0x%" PRIx64 ",", subscriptionId); + } +#endif // CHIP_DETAIL_LOGGING + break; + case kCsTag_FinalSyncInterval: + VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_FinalSyncInterval)), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << kCsTag_FinalSyncInterval); + VerifyOrReturnLogError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); +#if CHIP_DETAIL_LOGGING + { + uint16_t finalSyncInterval; + ReturnLogErrorOnFailure(reader.Get(finalSyncInterval)); + PRETTY_PRINT("\tFinalSyncInterval = 0x%" PRIx16 ",", finalSyncInterval); + } +#endif // CHIP_DETAIL_LOGGING + break; + default: + ReturnLogErrorOnFailure(CHIP_ERROR_INVALID_TLV_TAG); + } + } + PRETTY_PRINT("}"); + PRETTY_PRINT(""); + + if (CHIP_END_OF_TLV == err) + { + const uint16_t RequiredFields = (1 << kCsTag_SubscriptionId) | (1 << kCsTag_FinalSyncInterval); + + if ((TagPresenceMask & RequiredFields) == RequiredFields) + { + err = CHIP_NO_ERROR; + } + } + ReturnLogErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); +} +#endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + +CHIP_ERROR SubscribeResponse::Parser::GetSubscriptionId(uint64_t * const apSubscribeId) const +{ + return GetUnsignedInteger(kCsTag_SubscriptionId, apSubscribeId); +} + +CHIP_ERROR SubscribeResponse::Parser::GetFinalSyncIntervalSeconds(uint16_t * const apFinalSyncIntervalSeconds) const +{ + return GetUnsignedInteger(kCsTag_FinalSyncInterval, apFinalSyncIntervalSeconds); +} + +CHIP_ERROR SubscribeResponse::Builder::Init(chip::TLV::TLVWriter * const apWriter) +{ + return InitAnonymousStructure(apWriter); +} + +SubscribeResponse::Builder & SubscribeResponse::Builder::SubscriptionId(const uint64_t aSubscribeId) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_SubscriptionId), aSubscribeId); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeResponse::Builder & SubscribeResponse::Builder::FinalSyncIntervalSeconds(const uint16_t aFinalSyncIntervalSeconds) +{ + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_FinalSyncInterval), aFinalSyncIntervalSeconds); + ChipLogFunctError(mError); + } + return *this; +} + +SubscribeResponse::Builder & SubscribeResponse::Builder::EndOfSubscribeResponse() +{ + EndOfContainer(); + return *this; +} +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/SubscribeResponse.h b/src/app/MessageDef/SubscribeResponse.h new file mode 100644 index 00000000000000..bf99708d54e28e --- /dev/null +++ b/src/app/MessageDef/SubscribeResponse.h @@ -0,0 +1,99 @@ +/** + * + * 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. + */ + +#pragma once +#include "Builder.h" +#include "EventPathList.h" +#include "Parser.h" +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace SubscribeResponse { +enum +{ + kCsTag_SubscriptionId = 0, + kCsTag_FinalSyncInterval = 1, +}; + +class Parser : public chip::app::Parser +{ +public: + /** + * @param [in] aReader A pointer to a TLVReader, which should point to the beginning of this response + */ + CHIP_ERROR Init(const chip::TLV::TLVReader & aReader); +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + /** + * @brief Roughly verify the message is correctly formed + * 1) all mandatory tags are present + * 2) all elements have expected data type + * 3) any tag can only appear once + * 4) At the top level of the structure, unknown tags are ignored for forward compatibility + * @note The main use of this function is to print out what we're + * receiving during protocol development and debugging. + * The encoding rule has changed in IM encoding spec so this + * check is only "roughly" conformant now. + */ + CHIP_ERROR CheckSchemaValidity() const; +#endif + + /** + * @brief Get Subscription ID. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetSubscriptionId(uint64_t * const apSubscriptionId) const; + + /** + * @brief Get FinalSyncInterval. Next() must be called before accessing them. + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetFinalSyncIntervalSeconds(uint16_t * const apFinalSyncIntervalSeconds) const; +}; + +class Builder : public chip::app::Builder +{ +public: + CHIP_ERROR Init(chip::TLV::TLVWriter * const apWriter); + + /** + * @brief final subscription Id for the subscription back to the client.s. + */ + SubscribeResponse::Builder & SubscriptionId(const uint64_t SubscriptionId); + + /** + * @brief Final Sync Interval for the subscription back to the clients. + */ + SubscribeResponse::Builder & FinalSyncIntervalSeconds(const uint16_t aFinalSyncIntervalSeconds); + + /** + * @brief Mark the end of this SubscribeResponse + */ + SubscribeResponse::Builder & EndOfSubscribeResponse(); +}; +} // namespace SubscribeResponse +} // namespace app +} // namespace chip diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp index b31f7ba75fdc57..e5b6c4c3ccad7d 100644 --- a/src/app/tests/TestMessageDef.cpp +++ b/src/app/tests/TestMessageDef.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include @@ -882,6 +884,129 @@ void ParseWriteResponse(nlTestSuite * apSuite, chip::TLV::TLVReader & aReader) NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } +void BuildSubscribeRequest(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + SubscribeRequest::Builder subscribeRequestBuilder; + + err = subscribeRequestBuilder.Init(&aWriter); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + AttributePathList::Builder attributePathList = subscribeRequestBuilder.CreateAttributePathListBuilder(); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildAttributePathList(apSuite, attributePathList); + + EventPathList::Builder eventPathList = subscribeRequestBuilder.CreateEventPathListBuilder(); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildEventPathList(apSuite, eventPathList); + + AttributeDataVersionList::Builder attributeDataVersionList = subscribeRequestBuilder.CreateAttributeDataVersionListBuilder(); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildAttributeDataVersionList(apSuite, attributeDataVersionList); + + subscribeRequestBuilder.EventNumber(1); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.MinIntervalSeconds(1); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.MaxIntervalSeconds(1); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.KeepExistingSubscriptions(true); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.IsProxy(true); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.EndOfSubscribeRequest(); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); +} + +void ParseSubscribeRequest(nlTestSuite * apSuite, chip::TLV::TLVReader & aReader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + SubscribeRequest::Parser subscribeRequestParser; + AttributePathList::Parser attributePathListParser; + EventPathList::Parser eventPathListParser; + AttributeDataVersionList::Parser attributeDataVersionListParser; + uint64_t eventNumber = 0; + uint16_t minIntervalSeconds = 0; + uint16_t maxIntervalSeconds = 0; + bool keepExistingSubscription = false; + bool isProxy = false; + + err = subscribeRequestParser.Init(aReader); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + err = subscribeRequestParser.CheckSchemaValidity(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); +#endif + err = subscribeRequestParser.GetAttributePathList(&attributePathListParser); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetEventPathList(&eventPathListParser); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetAttributeDataVersionList(&attributeDataVersionListParser); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetEventNumber(&eventNumber); + NL_TEST_ASSERT(apSuite, eventNumber == 1 && err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetMinIntervalSeconds(&minIntervalSeconds); + NL_TEST_ASSERT(apSuite, minIntervalSeconds == 1 && err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetMaxIntervalSeconds(&maxIntervalSeconds); + NL_TEST_ASSERT(apSuite, maxIntervalSeconds == 1 && err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetKeepExistingSubscriptions(&keepExistingSubscription); + NL_TEST_ASSERT(apSuite, keepExistingSubscription && err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetIsProxy(&isProxy); + NL_TEST_ASSERT(apSuite, isProxy && err == CHIP_NO_ERROR); +} + +void BuildSubscribeResponse(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + SubscribeResponse::Builder subscribeResponseBuilder; + + err = subscribeResponseBuilder.Init(&aWriter); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + subscribeResponseBuilder.SubscriptionId(1); + NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); + + subscribeResponseBuilder.FinalSyncIntervalSeconds(1); + NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); + + subscribeResponseBuilder.EndOfSubscribeResponse(); + NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); +} + +void ParseSubscribeResponse(nlTestSuite * apSuite, chip::TLV::TLVReader & aReader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + SubscribeResponse::Parser subscribeResponseParser; + uint64_t subscriptionId = 0; + uint16_t finalSyncIntervalSeconds = 0; + + err = subscribeResponseParser.Init(aReader); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); +#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK + err = subscribeResponseParser.CheckSchemaValidity(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); +#endif + err = subscribeResponseParser.GetSubscriptionId(&subscriptionId); + NL_TEST_ASSERT(apSuite, subscriptionId == 1 && err == CHIP_NO_ERROR); + + err = subscribeResponseParser.GetFinalSyncIntervalSeconds(&finalSyncIntervalSeconds); + NL_TEST_ASSERT(apSuite, finalSyncIntervalSeconds == 1 && err == CHIP_NO_ERROR); +} + void AttributePathTest(nlTestSuite * apSuite, void * apContext) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1348,6 +1473,44 @@ void WriteResponseTest(nlTestSuite * apSuite, void * apContext) ParseWriteResponse(apSuite, reader); } +void SubscribeRequestTest(nlTestSuite * apSuite, void * apContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::System::PacketBufferTLVWriter writer; + chip::System::PacketBufferTLVReader reader; + writer.Init(chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSize)); + BuildSubscribeRequest(apSuite, writer); + chip::System::PacketBufferHandle buf; + err = writer.Finalize(&buf); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + DebugPrettyPrint(buf); + + reader.Init(std::move(buf)); + err = reader.Next(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + ParseSubscribeRequest(apSuite, reader); +} + +void SubscribeResponseTest(nlTestSuite * apSuite, void * apContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::System::PacketBufferTLVWriter writer; + chip::System::PacketBufferTLVReader reader; + writer.Init(chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSize)); + BuildSubscribeResponse(apSuite, writer); + chip::System::PacketBufferHandle buf; + err = writer.Finalize(&buf); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + DebugPrettyPrint(buf); + + reader.Init(std::move(buf)); + err = reader.Next(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + ParseSubscribeResponse(apSuite, reader); +} + void CheckPointRollbackTest(nlTestSuite * apSuite, void * apContext) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1429,6 +1592,8 @@ const nlTest sTests[] = NL_TEST_DEF("ReadRequestTest", ReadRequestTest), NL_TEST_DEF("WriteRequestTest", WriteRequestTest), NL_TEST_DEF("WriteResponseTest", WriteResponseTest), + NL_TEST_DEF("SubscribeRequestTest", SubscribeRequestTest), + NL_TEST_DEF("SubscribeResponseTest", SubscribeResponseTest), NL_TEST_DEF("CheckPointRollbackTest", CheckPointRollbackTest), NL_TEST_SENTINEL() }; diff --git a/src/lib/support/CodeUtils.h b/src/lib/support/CodeUtils.h index 79167a340cb141..586aabe8bda15f 100644 --- a/src/lib/support/CodeUtils.h +++ b/src/lib/support/CodeUtils.h @@ -183,6 +183,32 @@ constexpr inline const _T & max(const _T & a, const _T & b) } \ } while (false) +/** + * @def ReturnLogErrorOnFailure(expr) + * + * @brief + * Returns the error code if the expression returns something different + * than CHIP_NO_ERROR. + * + * Example usage: + * + * @code + * ReturnLogErrorOnFailure(channel->SendMsg(msg)); + * @endcode + * + * @param[in] expr A scalar expression to be evaluated against CHIP_NO_ERROR. + */ +#define ReturnLogErrorOnFailure(expr) \ + do \ + { \ + CHIP_ERROR __err = (expr); \ + if (__err != CHIP_NO_ERROR) \ + { \ + ChipLogError(NotSpecified, "%s at %s:%d", ErrorStr(__err), __FILE__, __LINE__); \ + return __err; \ + } \ + } while (false) + /** * @def ReturnOnFailure(expr) * @@ -255,6 +281,31 @@ constexpr inline const _T & max(const _T & a, const _T & b) } \ } while (false) +/** + * @def VerifyOrReturnLogError(expr, code) + * + * @brief + * Returns and print a specified error code if expression evaluates to false + * + * Example usage: + * + * @code + * VerifyOrReturnLogError(param != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + * @endcode + * + * @param[in] expr A Boolean expression to be evaluated. + * @param[in] code A value to return if @a expr is false. + */ +#define VerifyOrReturnLogError(expr, code) \ + do \ + { \ + if (!(expr)) \ + { \ + ChipLogError(NotSpecified, "%s at %s:%d", ErrorStr(code), __FILE__, __LINE__); \ + return code; \ + } \ + } while (false) + /** * @def ReturnErrorCodeIf(expr, code) * From 0b78067a255dfb316b785eb512d4ca47422fdd78 Mon Sep 17 00:00:00 2001 From: Austin Hsieh <77706079+austinh0@users.noreply.github.com> Date: Fri, 9 Jul 2021 13:55:27 -0700 Subject: [PATCH 38/47] Support discovery capabilities in setup payload (#8178) --- .../google/chip/chiptool/CHIPToolActivity.kt | 10 +-- .../setuppayloadscanner/BarcodeFragment.kt | 12 +-- .../CHIPDeviceDetailsFragment.kt | 73 ++++++++++--------- .../setuppayloadscanner/CHIPDeviceInfo.kt | 42 +++++++++-- .../res/layout/chip_device_info_fragment.xml | 22 +++--- .../app/src/main/res/values/strings.xml | 2 +- src/setup_payload/java/BUILD.gn | 1 + .../java/SetupPayloadParser-JNI.cpp | 47 ++++++++++-- .../setuppayload/DiscoveryCapability.java | 8 ++ .../src/chip/setuppayload/SetupPayload.java | 7 +- 10 files changed, 141 insertions(+), 83 deletions(-) create mode 100644 src/setup_payload/java/src/chip/setuppayload/DiscoveryCapability.java diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt index fb2f166f49a7f8..c50f8e523ea12f 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt @@ -36,7 +36,6 @@ import com.google.chip.chiptool.provisioning.ProvisionNetworkType import com.google.chip.chiptool.setuppayloadscanner.BarcodeFragment import com.google.chip.chiptool.setuppayloadscanner.CHIPDeviceDetailsFragment import com.google.chip.chiptool.setuppayloadscanner.CHIPDeviceInfo -import com.google.chip.chiptool.setuppayloadscanner.QrCodeInfo import chip.devicecontroller.PreferencesKeyValueStoreManager import chip.setuppayload.SetupPayload import chip.setuppayload.SetupPayloadParser @@ -160,14 +159,7 @@ class CHIPToolActivity : return } - val deviceInfo = CHIPDeviceInfo( - setupPayload.version, - setupPayload.vendorId, - setupPayload.productId, - setupPayload.discriminator, - setupPayload.setupPinCode, - setupPayload.optionalQRCodeInfo.mapValues { (_, info) -> QrCodeInfo(info.tag, info.type, info.data, info.int32) } - ) + val deviceInfo = CHIPDeviceInfo.fromSetupPayload(setupPayload) val buttons = arrayOf( getString(R.string.nfc_tag_action_show), diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt index 220d0b89aac6c1..40c5f250f0252d 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt @@ -133,18 +133,8 @@ class BarcodeFragment : Fragment(), CHIPBarcodeProcessor.BarcodeDetectionListene } return@post } - val deviceInfo = CHIPDeviceInfo( - payload.version, - payload.vendorId, - payload.productId, - payload.discriminator, - payload.setupPinCode, - payload.optionalQRCodeInfo.mapValues { (_, info) -> - QrCodeInfo(info.tag, info.type, info.data, info.int32) - } - ) FragmentUtil.getHost(this, Callback::class.java) - ?.onCHIPDeviceInfoReceived(deviceInfo) + ?.onCHIPDeviceInfoReceived(CHIPDeviceInfo.fromSetupPayload(payload)) } } diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt index cdcd5524f916ce..afcfb015d69f79 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt @@ -25,6 +25,7 @@ import android.view.ViewGroup import android.widget.TextView import androidx.fragment.app.Fragment import com.google.chip.chiptool.R +import kotlinx.android.synthetic.main.chip_device_info_fragment.view.discoveryCapabilitiesTv import kotlinx.android.synthetic.main.chip_device_info_fragment.view.discriminatorTv import kotlinx.android.synthetic.main.chip_device_info_fragment.view.productIdTv import kotlinx.android.synthetic.main.chip_device_info_fragment.view.setupCodeTv @@ -36,48 +37,52 @@ import kotlinx.android.synthetic.main.chip_device_info_fragment.view.versionTv /** Show the [CHIPDeviceInfo]. */ class CHIPDeviceDetailsFragment : Fragment() { - private lateinit var deviceInfo: CHIPDeviceInfo + private lateinit var deviceInfo: CHIPDeviceInfo - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - deviceInfo = checkNotNull(requireArguments().getParcelable(ARG_DEVICE_INFO)) + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + deviceInfo = checkNotNull(requireArguments().getParcelable(ARG_DEVICE_INFO)) - return inflater.inflate(R.layout.chip_device_info_fragment, container, false).apply { + return inflater.inflate(R.layout.chip_device_info_fragment, container, false).apply { - // Display CHIP setup code info to user for manual connect to soft AP - versionTv.text = "${deviceInfo.version}" - vendorIdTv.text = "${deviceInfo.vendorId}" - productIdTv.text = "${deviceInfo.productId}" - setupCodeTv.text = "${deviceInfo.setupPinCode}" - discriminatorTv.text = "${deviceInfo.discriminator}" + versionTv.text = "${deviceInfo.version}" + vendorIdTv.text = "${deviceInfo.vendorId}" + productIdTv.text = "${deviceInfo.productId}" + setupCodeTv.text = "${deviceInfo.setupPinCode}" + discriminatorTv.text = "${deviceInfo.discriminator}" + discoveryCapabilitiesTv.text = requireContext().getString( + R.string.chip_device_info_discovery_capabilities_text, + deviceInfo.discoveryCapabilities + ) - if (deviceInfo.optionalQrCodeInfoMap.isEmpty()) { - vendorTagsLabelTv.visibility = View.GONE - vendorTagsContainer.visibility = View.GONE - } else { - vendorTagsLabelTv.visibility = View.VISIBLE - vendorTagsContainer.visibility = View.VISIBLE + if (deviceInfo.optionalQrCodeInfoMap.isEmpty()) { + vendorTagsLabelTv.visibility = View.GONE + vendorTagsContainer.visibility = View.GONE + } else { + vendorTagsLabelTv.visibility = View.VISIBLE + vendorTagsContainer.visibility = View.VISIBLE - deviceInfo.optionalQrCodeInfoMap.forEach { (_, qrCodeInfo) -> - val tv = inflater.inflate(R.layout.barcode_vendor_tag, null, false) as TextView - val info = "${qrCodeInfo.tag}. ${qrCodeInfo.data}, ${qrCodeInfo.intDataValue}" - tv.text = info - vendorTagsContainer.addView(tv) - } - } + deviceInfo.optionalQrCodeInfoMap.forEach { (_, qrCodeInfo) -> + val tv = inflater.inflate(R.layout.barcode_vendor_tag, null, false) as TextView + val info = "${qrCodeInfo.tag}. ${qrCodeInfo.data}, ${qrCodeInfo.intDataValue}" + tv.text = info + vendorTagsContainer.addView(tv) } + } } + } - companion object { - private const val ARG_DEVICE_INFO = "device_info" + companion object { + private const val ARG_DEVICE_INFO = "device_info" - @JvmStatic fun newInstance(deviceInfo: CHIPDeviceInfo): CHIPDeviceDetailsFragment { - return CHIPDeviceDetailsFragment().apply { - arguments = Bundle(1).apply { putParcelable(ARG_DEVICE_INFO, deviceInfo) } - } - } + @JvmStatic + fun newInstance(deviceInfo: CHIPDeviceInfo): CHIPDeviceDetailsFragment { + return CHIPDeviceDetailsFragment().apply { + arguments = Bundle(1).apply { putParcelable(ARG_DEVICE_INFO, deviceInfo) } + } } + } } diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt index 1a3d5bdadd3c77..f63d608d31f5b5 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt @@ -19,14 +19,40 @@ package com.google.chip.chiptool.setuppayloadscanner import android.os.Parcelable +import chip.setuppayload.DiscoveryCapability +import chip.setuppayload.SetupPayload import kotlinx.android.parcel.Parcelize /** Class to hold the CHIP device information. */ -@Parcelize data class CHIPDeviceInfo( - val version: Int, - val vendorId: Int, - val productId: Int, - val discriminator: Int, - val setupPinCode: Long, - val optionalQrCodeInfoMap: Map -) : Parcelable +@Parcelize +data class CHIPDeviceInfo( + val version: Int, + val vendorId: Int, + val productId: Int, + val discriminator: Int, + val setupPinCode: Long, + val optionalQrCodeInfoMap: Map, + val discoveryCapabilities: Set +) : Parcelable { + + companion object { + fun fromSetupPayload(setupPayload: SetupPayload): CHIPDeviceInfo { + return CHIPDeviceInfo( + setupPayload.version, + setupPayload.vendorId, + setupPayload.productId, + setupPayload.discriminator, + setupPayload.setupPinCode, + setupPayload.optionalQRCodeInfo.mapValues { (_, info) -> + QrCodeInfo( + info.tag, + info.type, + info.data, + info.int32 + ) + }, + setupPayload.discoveryCapabilities + ) + } + } +} diff --git a/src/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml b/src/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml index 6d1686491f0db7..bbcdf5efee899b 100644 --- a/src/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml +++ b/src/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml @@ -17,22 +17,13 @@ android:layout_alignParentTop="true" android:textSize="20sp"/> - - @@ -142,5 +133,14 @@ android:orientation="vertical" android:layout_marginBottom="8dp" android:layout_below="@id/vendorTagsLabelTv"/> + + diff --git a/src/android/CHIPTool/app/src/main/res/values/strings.xml b/src/android/CHIPTool/app/src/main/res/values/strings.xml index 9ca6b5537936b4..cbdcd7cc49680f 100644 --- a/src/android/CHIPTool/app/src/main/res/values/strings.xml +++ b/src/android/CHIPTool/app/src/main/res/values/strings.xml @@ -5,13 +5,13 @@ Location permission required Since location permission was denied, some functions of the app may be unavailable. CHIP Device Info: - Please manually connect to this device\'s soft AP using the information below. Version: Vendor ID: Product ID: Discriminator: Setup PIN Code: Optional Vendor tags: + Discovery capabilities: %1s Camera permission missing Camera permission required to be able to scan the QR code. Try again diff --git a/src/setup_payload/java/BUILD.gn b/src/setup_payload/java/BUILD.gn index fcff906e5efe10..ae8d01118e2cc6 100644 --- a/src/setup_payload/java/BUILD.gn +++ b/src/setup_payload/java/BUILD.gn @@ -40,6 +40,7 @@ android_library("java") { ] sources = [ + "src/chip/setuppayload/DiscoveryCapability.java", "src/chip/setuppayload/OptionalQRCodeInfo.java", "src/chip/setuppayload/SetupPayload.java", "src/chip/setuppayload/SetupPayloadParser.java", diff --git a/src/setup_payload/java/SetupPayloadParser-JNI.cpp b/src/setup_payload/java/SetupPayloadParser-JNI.cpp index 0b069671dd2b4e..4de2d5cf0b75f3 100644 --- a/src/setup_payload/java/SetupPayloadParser-JNI.cpp +++ b/src/setup_payload/java/SetupPayloadParser-JNI.cpp @@ -24,6 +24,7 @@ using namespace chip; #define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_chip_setuppayload_SetupPayloadParser_##METHOD_NAME static jobject TransformSetupPayload(JNIEnv * env, SetupPayload & payload); +static jobject CreateCapabilitiesHashSet(JNIEnv * env, RendezvousInformationFlags flags); static CHIP_ERROR ThrowUnrecognizedQRCodeException(JNIEnv * env, jstring qrCodeObj); static CHIP_ERROR ThrowInvalidEntryCodeFormatException(JNIEnv * env, jstring entryCodeObj); @@ -88,12 +89,13 @@ jobject TransformSetupPayload(JNIEnv * env, SetupPayload & payload) jmethodID setupConstr = env->GetMethodID(setupPayloadClass, "", "()V"); jobject setupPayload = env->NewObject(setupPayloadClass, setupConstr); - jfieldID version = env->GetFieldID(setupPayloadClass, "version", "I"); - jfieldID vendorId = env->GetFieldID(setupPayloadClass, "vendorId", "I"); - jfieldID productId = env->GetFieldID(setupPayloadClass, "productId", "I"); - jfieldID commissioningFlow = env->GetFieldID(setupPayloadClass, "commissioningFlow", "I"); - jfieldID discriminator = env->GetFieldID(setupPayloadClass, "discriminator", "I"); - jfieldID setUpPinCode = env->GetFieldID(setupPayloadClass, "setupPinCode", "J"); + jfieldID version = env->GetFieldID(setupPayloadClass, "version", "I"); + jfieldID vendorId = env->GetFieldID(setupPayloadClass, "vendorId", "I"); + jfieldID productId = env->GetFieldID(setupPayloadClass, "productId", "I"); + jfieldID commissioningFlow = env->GetFieldID(setupPayloadClass, "commissioningFlow", "I"); + jfieldID discriminator = env->GetFieldID(setupPayloadClass, "discriminator", "I"); + jfieldID setUpPinCode = env->GetFieldID(setupPayloadClass, "setupPinCode", "J"); + jfieldID discoveryCapabilities = env->GetFieldID(setupPayloadClass, "discoveryCapabilities", "Ljava/util/Set;"); env->SetIntField(setupPayload, version, payload.version); env->SetIntField(setupPayload, vendorId, payload.vendorID); @@ -102,6 +104,8 @@ jobject TransformSetupPayload(JNIEnv * env, SetupPayload & payload) env->SetIntField(setupPayload, discriminator, payload.discriminator); env->SetLongField(setupPayload, setUpPinCode, payload.setUpPINCode); + env->SetObjectField(setupPayload, discoveryCapabilities, CreateCapabilitiesHashSet(env, payload.rendezvousInformation)); + jmethodID addOptionalInfoMid = env->GetMethodID(setupPayloadClass, "addOptionalQRCodeInfo", "(Lchip/setuppayload/OptionalQRCodeInfo;)V"); @@ -163,6 +167,37 @@ jobject TransformSetupPayload(JNIEnv * env, SetupPayload & payload) return setupPayload; } +jobject CreateCapabilitiesHashSet(JNIEnv * env, RendezvousInformationFlags flags) +{ + jclass hashSetClass = env->FindClass("java/util/HashSet"); + jmethodID hashSetConstructor = env->GetMethodID(hashSetClass, "", "()V"); + jobject capabilitiesHashSet = env->NewObject(hashSetClass, hashSetConstructor); + + jmethodID hashSetAddMethod = env->GetMethodID(hashSetClass, "add", "(Ljava/lang/Object;)Z"); + jclass capabilityEnum = env->FindClass("chip/setuppayload/DiscoveryCapability"); + + if (flags.Has(chip::RendezvousInformationFlag::kBLE)) + { + jfieldID bleCapability = env->GetStaticFieldID(capabilityEnum, "BLE", "Lchip/setuppayload/DiscoveryCapability;"); + jobject enumObj = env->GetStaticObjectField(capabilityEnum, bleCapability); + env->CallBooleanMethod(capabilitiesHashSet, hashSetAddMethod, enumObj); + } + if (flags.Has(chip::RendezvousInformationFlag::kSoftAP)) + { + jfieldID softApCapability = env->GetStaticFieldID(capabilityEnum, "SOFT_AP", "Lchip/setuppayload/DiscoveryCapability;"); + jobject enumObj = env->GetStaticObjectField(capabilityEnum, softApCapability); + env->CallBooleanMethod(capabilitiesHashSet, hashSetAddMethod, enumObj); + } + if (flags.Has(chip::RendezvousInformationFlag::kOnNetwork)) + { + jfieldID onNetworkCapability = + env->GetStaticFieldID(capabilityEnum, "ON_NETWORK", "Lchip/setuppayload/DiscoveryCapability;"); + jobject enumObj = env->GetStaticObjectField(capabilityEnum, onNetworkCapability); + env->CallBooleanMethod(capabilitiesHashSet, hashSetAddMethod, enumObj); + } + return capabilitiesHashSet; +} + CHIP_ERROR ThrowUnrecognizedQRCodeException(JNIEnv * env, jstring qrCodeObj) { jclass exceptionCls = nullptr; diff --git a/src/setup_payload/java/src/chip/setuppayload/DiscoveryCapability.java b/src/setup_payload/java/src/chip/setuppayload/DiscoveryCapability.java new file mode 100644 index 00000000000000..06811152172d78 --- /dev/null +++ b/src/setup_payload/java/src/chip/setuppayload/DiscoveryCapability.java @@ -0,0 +1,8 @@ +package chip.setuppayload; + +/** Enum values for possible bits in the onboarding paylod's discovery capabilities bitmask. */ +public enum DiscoveryCapability { + SOFT_AP, + BLE, + ON_NETWORK +} diff --git a/src/setup_payload/java/src/chip/setuppayload/SetupPayload.java b/src/setup_payload/java/src/chip/setuppayload/SetupPayload.java index 2cd33ffc377462..5d702ad8da4297 100644 --- a/src/setup_payload/java/src/chip/setuppayload/SetupPayload.java +++ b/src/setup_payload/java/src/chip/setuppayload/SetupPayload.java @@ -2,6 +2,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Set; /** Class to hold the data from the scanned QR code or manual entry code. */ public class SetupPayload { @@ -14,7 +15,7 @@ public class SetupPayload { /** Commissioning flow: 0 = standard, 1 = requires user action, 2 = custom */ public int commissioningFlow; /** The CHIP device supported rendezvous flags */ - public int rendezvousInformation; + public Set discoveryCapabilities; /** The CHIP device discriminator */ public int discriminator; /** The CHIP device manual setup code */ @@ -31,14 +32,14 @@ public SetupPayload( int vendorId, int productId, int commissioningFlow, - int rendezvousInfo, + Set discoveryCapabilities, int discriminator, long setupPinCode) { this.version = version; this.vendorId = vendorId; this.productId = productId; this.commissioningFlow = commissioningFlow; - this.rendezvousInformation = rendezvousInfo; + this.discoveryCapabilities = discoveryCapabilities; this.discriminator = discriminator; this.setupPinCode = setupPinCode; this.optionalQRCodeInfo = new HashMap(); From a999ccd8243ead267cf65a38b6fe330ecd4ef0e6 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Sat, 10 Jul 2021 05:02:55 +0800 Subject: [PATCH 39/47] ESP32C3 Support: (#8201) use onboard RGB-LED(WS2812) for status-LED in all-clusters-app add colorcontrol cluster for ESP32C3_DevkitM --- .../all-clusters-app/esp32/CMakeLists.txt | 11 +- examples/all-clusters-app/esp32/README.md | 25 ++++- .../esp32/main/CMakeLists.txt | 8 +- .../esp32/main/DeviceCallbacks.cpp | 36 +++++- .../esp32/main/Kconfig.projbuild | 3 +- .../all-clusters-app/esp32/main/LEDWidget.cpp | 105 +++++++++++++++++- .../esp32/main/include/DeviceCallbacks.h | 3 + .../esp32/main/include/LEDWidget.h | 8 ++ examples/all-clusters-app/esp32/main/main.cpp | 2 +- 9 files changed, 181 insertions(+), 20 deletions(-) diff --git a/examples/all-clusters-app/esp32/CMakeLists.txt b/examples/all-clusters-app/esp32/CMakeLists.txt index 930da3d1be2d3e..9d98e41df4be5c 100644 --- a/examples/all-clusters-app/esp32/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/CMakeLists.txt @@ -24,12 +24,11 @@ set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../common/QRCode" ) if(${IDF_TARGET} STREQUAL "esp32") -set(EXTRA_COMPONENT_DIRS - ${EXTRA_COMPONENT_DIRS} - "${CMAKE_CURRENT_LIST_DIR}/../../common/m5stack-tft/repo/components/tft" - "${CMAKE_CURRENT_LIST_DIR}/../../common/m5stack-tft/repo/components/spidriver" - "${CMAKE_CURRENT_LIST_DIR}/../../common/screen-framework" -) + list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../common/m5stack-tft/repo/components/tft" + "${CMAKE_CURRENT_LIST_DIR}/../../common/m5stack-tft/repo/components/spidriver" + "${CMAKE_CURRENT_LIST_DIR}/../../common/screen-framework") +elseif(${IDF_TARGET} STREQUAL "esp32c3") + list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/peripherals/rmt/led_strip/components") endif() project(chip-all-clusters-app) diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index a9cab13a1b2476..9ad8ee6c7b906e 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -209,11 +209,23 @@ commissioning and cluster control. ### Cluster control -- After successful commissioning, use the OnOff cluster command to control the - OnOff attribute. This allows you to toggle a parameter implemented by the - device to be On or Off. +- After successful commissioning, use the OnOff cluster commands to control + the OnOff attribute. This allows you to toggle a parameter implemented by + the device to be On or Off. - `chip-device-ctrl > zcl OnOff Off 135246 1 0` + `chip-device-ctrl > zcl OnOff Off 135246 1 1` + +- Use the LevelControl cluster commands to control the CurrentLevel attribute. + This allows you to control the brightness of the led. + + `chip-device-ctrl > zcl LevelControl MoveToLevel 135246 1 1 level=10 transitionTime=0 optionMask=0 optionOverride=0` + +- For ESP32C3-DevKitM, use the ColorContorl cluster commands to control the + CurrentHue and CurrentSaturation attribute. This allows you to control the + color of on-board LED. + + `zcl ColorControl MoveToHue 135246 1 1 hue=100 direction=0 transitionTime=0 optionsMask=0 optionsOverride=0` + `zcl ColorControl MoveToSaturation 135245 1 1 saturation=200 transitionTime=0 optionsMask=0 optionsOverride=0` ### Flashing app using script @@ -243,5 +255,6 @@ through the on/off/toggle commands from the `python-controller`. For `M5Stack`, a virtual Green LED on the display is used for the same. If you wish to see the actual effect of the commands on `ESP32-DevKitC`, -`ESP32-WROVER-KIT_V4.1` and `ESP32C3-DevKitM`, you will have to connect an -external LED to GPIO `STATUS_LED_GPIO_NUM`. +`ESP32-WROVER-KIT_V4.1`, you will have to connect an external LED to GPIO +`STATUS_LED_GPIO_NUM`. For `ESP32C3-DevKitM`, the on-board LED will show the +actual effect of the commands. diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 1124c7077833e1..06eb182bcf810d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -69,13 +69,17 @@ set(SRC_DIRS_LIST ) if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y")) - set(PRIV_INCLUDE_DIRS_LIST ${PRIV_INCLUDE_DIRS_LIST} - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include") + list(APPEND PRIV_INCLUDE_DIRS_LIST + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include") set(PRIV_REQUIRES_LIST chip QRCode bt) elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y")) set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework) endif() +if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") + list(APPEND PRIV_REQUIRES_LIST led_strip) +endif() + idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} SRC_DIRS ${SRC_DIRS_LIST} PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index 21be643045fb58..1f549bca131380 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -95,7 +95,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster case ZCL_LEVEL_CONTROL_CLUSTER_ID: OnLevelControlAttributeChangeCallback(endpointId, attributeId, value); break; - +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + case ZCL_COLOR_CONTROL_CLUSTER_ID: + OnColorControlAttributeChangeCallback(endpointId, attributeId, value); + break; +#endif default: ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId); break; @@ -164,6 +168,36 @@ void DeviceCallbacks::OnLevelControlAttributeChangeCallback(EndpointId endpointI return; } +// Currently we only support ColorControl cluster for ESP32C3_DEVKITM which has an on-board RGB-LED +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM +void DeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + VerifyOrExit(attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID || + attributeId == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04x", attributeId)); + VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId)); + if (endpointId == 1) + { + uint8_t hue, saturation; + if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) + { + hue = *value; + emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + &saturation, sizeof(uint8_t)); + } + else + { + saturation = *value; + emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, + sizeof(uint8_t)); + } + statusLED1.SetColor(hue, saturation); + } +exit: + return; +} +#endif + void IdentifyTimerHandler(Layer * systemLayer, void * appState, CHIP_ERROR error) { statusLED1.Animate(); diff --git a/examples/all-clusters-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-app/esp32/main/Kconfig.projbuild index 487528fce73940..89911735fbf307 100644 --- a/examples/all-clusters-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-app/esp32/main/Kconfig.projbuild @@ -22,7 +22,8 @@ menu "Demo" choice prompt "Device Type" - default DEVICE_TYPE_ESP32_DEVKITC + default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32 + default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3 help Specifies the type of ESP32 device. diff --git a/examples/all-clusters-app/esp32/main/LEDWidget.cpp b/examples/all-clusters-app/esp32/main/LEDWidget.cpp index c6a5a8c5986510..13dcdc4893c2cf 100644 --- a/examples/all-clusters-app/esp32/main/LEDWidget.cpp +++ b/examples/all-clusters-app/esp32/main/LEDWidget.cpp @@ -27,12 +27,19 @@ #include "ScreenManager.h" -#include "driver/ledc.h" #include "esp_log.h" #include "esp_system.h" #include "esp_timer.h" +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM +#include "driver/rmt.h" +#include "led_strip.h" +#define RMT_TX_DEFAULT_GPIO GPIO_NUM_8 +#define RMT_TX_DEFAULT_CHANNEL RMT_CHANNEL_0 +static led_strip_t * strip = NULL; +#else +#include "driver/ledc.h" #include "hal/ledc_types.h" - +#endif void LEDWidget::Init(gpio_num_t gpioNum) { mLastChangeTimeUS = 0; @@ -44,7 +51,20 @@ void LEDWidget::Init(gpio_num_t gpioNum) mState = false; mError = false; errorTimer = NULL; - +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + if (gpioNum == RMT_TX_DEFAULT_GPIO) + { + rmt_config_t config = RMT_DEFAULT_CONFIG_TX(RMT_TX_DEFAULT_GPIO, RMT_TX_DEFAULT_CHANNEL); + config.clk_div = 2; + rmt_config(&config); + rmt_driver_install(config.channel, 0, 0); + led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t) config.channel); + strip = led_strip_new_rmt_ws2812(&strip_config); + mDefaultOnBrightness = UINT8_MAX; + mHue = 0; + mSaturation = 0; + } +#else if (gpioNum < GPIO_NUM_MAX) { ledc_timer_config_t ledc_timer = { @@ -67,6 +87,7 @@ void LEDWidget::Init(gpio_num_t gpioNum) ledc_channel_config(&ledc_channel); mDefaultOnBrightness = UINT8_MAX; } +#endif } void LEDWidget::Set(bool state) @@ -77,11 +98,21 @@ void LEDWidget::Set(bool state) void LEDWidget::SetBrightness(uint8_t brightness) { +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + if (strip) + { + uint8_t red, green, blue; + HSB2rgb(mHue, mSaturation, brightness, red, green, blue); + strip->set_pixel(strip, 0, red, green, blue); + strip->refresh(strip, 100); + } +#else if (mGPIONum < GPIO_NUM_MAX) { ledc_set_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, brightness); ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0); } +#endif if (brightness > 0) { mDefaultOnBrightness = brightness; @@ -155,11 +186,22 @@ void LEDWidget::DoSet(bool state) { bool stateChange = (mState != state); mState = state; +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + if (strip) + { + uint8_t red, green, blue; + uint8_t brightness = state ? mDefaultOnBrightness : 0; + HSB2rgb(mHue, mSaturation, brightness, red, green, blue); + strip->set_pixel(strip, 0, red, green, blue); + strip->refresh(strip, 100); + } +#else if (mGPIONum < GPIO_NUM_MAX) { ledc_set_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, state ? mDefaultOnBrightness : 0); ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0); } +#endif if (stateChange) { #if CONFIG_HAVE_DISPLAY @@ -186,3 +228,60 @@ void LEDWidget::SetVLED(int id1, int id2) } } #endif + +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM +void LEDWidget::SetColor(uint8_t Hue, uint8_t Saturation) +{ + uint8_t red, green, blue; + uint8_t brightness = mState ? mDefaultOnBrightness : 0; + mHue = static_cast(Hue) * 360 / 254; // mHue [0, 360] + mSaturation = static_cast(Saturation) * 100 / 254; // mSaturation [0 , 100] + + HSB2rgb(mHue, mSaturation, brightness, red, green, blue); + strip->set_pixel(strip, 0, red, green, blue); + strip->refresh(strip, 100); +} + +void LEDWidget::HSB2rgb(uint16_t Hue, uint8_t Saturation, uint8_t brightness, uint8_t & red, uint8_t & green, uint8_t & blue) +{ + uint16_t i = Hue / 60; + uint16_t rgb_max = brightness; + uint16_t rgb_min = rgb_max * (100 - Saturation) / 100; + uint16_t diff = Hue % 60; + uint16_t rgb_adj = (rgb_max - rgb_min) * diff / 60; + + switch (i) + { + case 0: + red = rgb_max; + green = rgb_min + rgb_adj; + blue = rgb_min; + break; + case 1: + red = rgb_max - rgb_adj; + green = rgb_max; + blue = rgb_min; + break; + case 2: + red = rgb_min; + green = rgb_max; + blue = rgb_min + rgb_adj; + break; + case 3: + red = rgb_min; + green = rgb_max - rgb_adj; + blue = rgb_max; + break; + case 4: + red = rgb_min + rgb_adj; + green = rgb_min; + blue = rgb_max; + break; + default: + red = rgb_max; + green = rgb_min; + blue = rgb_max - rgb_adj; + break; + } +} +#endif diff --git a/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h b/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h index e68b61a018d077..7917c79cc80308 100644 --- a/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h +++ b/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h @@ -42,6 +42,9 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event); void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); void OnLevelControlAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + void OnColorControlAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +#endif void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); bool mEndpointOnOffState[2]; diff --git a/examples/all-clusters-app/esp32/main/include/LEDWidget.h b/examples/all-clusters-app/esp32/main/include/LEDWidget.h index a3f6f6c9c4ed08..f90b0d76332b7c 100644 --- a/examples/all-clusters-app/esp32/main/include/LEDWidget.h +++ b/examples/all-clusters-app/esp32/main/include/LEDWidget.h @@ -45,7 +45,11 @@ class LEDWidget void BlinkOnError(); void Animate(); +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + void SetColor(uint8_t Hue, uint8_t Saturation); + void HSB2rgb(uint16_t Hue, uint8_t Saturation, uint8_t brightness, uint8_t & red, uint8_t & green, uint8_t & blue); +#endif #if CONFIG_HAVE_DISPLAY void SetVLED(int id1, int id2); #endif @@ -55,6 +59,10 @@ class LEDWidget uint32_t mBlinkOnTimeMS; uint32_t mBlinkOffTimeMS; uint8_t mDefaultOnBrightness; +#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM + uint16_t mHue; // mHue [0, 360] + uint8_t mSaturation; // mSaturation [0, 100] +#endif gpio_num_t mGPIONum; int mVLED1; int mVLED2; diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 6de0390eaa204b..dbe0a53e8028b2 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -87,7 +87,7 @@ using namespace ::chip::DeviceLayer; #elif CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM -#define STATUS_LED_GPIO_NUM GPIO_NUM_2 +#define STATUS_LED_GPIO_NUM GPIO_NUM_8 #else // !CONFIG_DEVICE_TYPE_ESP32_DEVKITC From 28c499e07016ce0ed28e820eadc93ac8908ca6bf Mon Sep 17 00:00:00 2001 From: ricardo-casallas <77841255+ricardo-casallas@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:07:11 -0400 Subject: [PATCH 40/47] Window Covering cluster: ZAP configuration updated. (#8249) --- .../window-app/common/gen/endpoint_config.h | 47 ++++- examples/window-app/common/window-app.zap | 169 ++++++++++++++---- .../data_model/controller-clusters.zap | 2 +- 3 files changed, 179 insertions(+), 39 deletions(-) diff --git a/examples/window-app/common/gen/endpoint_config.h b/examples/window-app/common/gen/endpoint_config.h index cf6872f79cae7c..cad46dd33b831d 100644 --- a/examples/window-app/common/gen/endpoint_config.h +++ b/examples/window-app/common/gen/endpoint_config.h @@ -583,7 +583,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 106 +#define GENERATED_ATTRIBUTE_COUNT 115 #define GENERATED_ATTRIBUTES \ { \ \ @@ -710,11 +710,20 @@ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ + { 0x0008, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ + { 0x0009, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ + { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ + { 0x000B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ + { 0x000C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionTiltPercent100ths */ \ + { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ + { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ + { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x14) }, /* Mode */ \ + { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* SafetyStatus */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ } @@ -762,7 +771,7 @@ 0x003E, ZAP_ATTRIBUTE_INDEX(94), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(96), 10, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(96), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ } @@ -771,7 +780,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 9, 1586 }, { ZAP_CLUSTER_INDEX(9), 1, 17 }, \ + { ZAP_CLUSTER_INDEX(0), 9, 1586 }, { ZAP_CLUSTER_INDEX(9), 1, 31 }, \ } // Largest attribute size is needed for various buffers @@ -781,7 +790,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (240) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1603) +#define ATTRIBUTE_MAX_SIZE (1617) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) @@ -922,10 +931,36 @@ #define ZAP_REPORT_DIRECTION(x) ZRD(x) // User options for plugin Reporting -#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (0) +#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (8) #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS -#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (0) +#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (8) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ + \ + /* Endpoint: 1, Cluster: Window Covering (server) */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x0008, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* CurrentPositionLiftPercentage */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x0009, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* CurrentPositionTiltPercentage */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x000A, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* OperationalStatus */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x000B, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* TargetPositionLiftPercent100ths */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x000C, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* TargetPositionTiltPercent100ths */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x000E, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* CurrentPositionLiftPercent100ths */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x000F, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* CurrentPositionTiltPercent100ths */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0102, 0x001A, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* SafetyStatus */ \ } diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 658a8a95595690..c3463002135425 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -2614,7 +2614,7 @@ "enabled": 0, "commands": [ { - "name": "WindowCoveringUpOpen", + "name": "UpOrOpen", "code": 0, "mfgCode": null, "source": "client", @@ -2622,7 +2622,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringDownClose", + "name": "DownOrClose", "code": 1, "mfgCode": null, "source": "client", @@ -2630,7 +2630,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringStop", + "name": "StopMotion", "code": 2, "mfgCode": null, "source": "client", @@ -2666,7 +2666,7 @@ "commands": [], "attributes": [ { - "name": "window covering type", + "name": "Type", "code": 0, "mfgCode": null, "side": "server", @@ -2681,7 +2681,7 @@ "reportableChange": 0 }, { - "name": "config status", + "name": "ConfigStatus", "code": 7, "mfgCode": null, "side": "server", @@ -2696,7 +2696,7 @@ "reportableChange": 0 }, { - "name": "installed open limit - lift", + "name": "InstalledOpenLimitLift", "code": 16, "mfgCode": null, "side": "server", @@ -2711,7 +2711,7 @@ "reportableChange": 0 }, { - "name": "installed closed limit - lift", + "name": "InstalledClosedLimitLift", "code": 17, "mfgCode": null, "side": "server", @@ -2726,7 +2726,7 @@ "reportableChange": 0 }, { - "name": "installed open limit - tilt", + "name": "InstalledOpenLimitTilt", "code": 18, "mfgCode": null, "side": "server", @@ -2741,7 +2741,7 @@ "reportableChange": 0 }, { - "name": "installed closed limit - tilt", + "name": "InstalledClosedLimitTilt", "code": 19, "mfgCode": null, "side": "server", @@ -2756,7 +2756,7 @@ "reportableChange": 0 }, { - "name": "mode", + "name": "Mode", "code": 23, "mfgCode": null, "side": "server", @@ -4663,7 +4663,7 @@ "enabled": 0, "commands": [ { - "name": "WindowCoveringUpOpen", + "name": "UpOrOpen", "code": 0, "mfgCode": null, "source": "client", @@ -4671,7 +4671,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringDownClose", + "name": "DownOrClose", "code": 1, "mfgCode": null, "source": "client", @@ -4679,7 +4679,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringStop", + "name": "StopMotion", "code": 2, "mfgCode": null, "source": "client", @@ -4687,7 +4687,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringGoToLiftValue", + "name": "GoToLiftValue", "code": 4, "mfgCode": null, "source": "client", @@ -4695,7 +4695,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringGoToLiftPercentage", + "name": "GoToLiftPercentage", "code": 5, "mfgCode": null, "source": "client", @@ -4703,7 +4703,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringGoToTiltValue", + "name": "GoToTiltValue", "code": 7, "mfgCode": null, "source": "client", @@ -4711,7 +4711,7 @@ "outgoing": 0 }, { - "name": "WindowCoveringGoToTiltPercentage", + "name": "GoToTiltPercentage", "code": 8, "mfgCode": null, "source": "client", @@ -4747,7 +4747,7 @@ "commands": [], "attributes": [ { - "name": "window covering type", + "name": "Type", "code": 0, "mfgCode": null, "side": "server", @@ -4762,7 +4762,7 @@ "reportableChange": 0 }, { - "name": "physical closed limit - lift", + "name": "PhysicalClosedLimitLift", "code": 1, "mfgCode": null, "side": "server", @@ -4777,7 +4777,7 @@ "reportableChange": 0 }, { - "name": "current position - lift", + "name": "CurrentPositionLift", "code": 3, "mfgCode": null, "side": "server", @@ -4792,7 +4792,7 @@ "reportableChange": 0 }, { - "name": "current position - tilt", + "name": "CurrentPositionTilt", "code": 4, "mfgCode": null, "side": "server", @@ -4807,7 +4807,7 @@ "reportableChange": 0 }, { - "name": "config status", + "name": "ConfigStatus", "code": 7, "mfgCode": null, "side": "server", @@ -4822,37 +4822,127 @@ "reportableChange": 0 }, { - "name": "current position lift percentage", + "name": "CurrentPositionLiftPercentage", "code": 8, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0xFF", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current position tilt percentage", + "name": "CurrentPositionTiltPercentage", "code": 9, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalStatus", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TargetPositionLiftPercent100ths", + "code": 11, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TargetPositionTiltPercent100ths", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EndProductType", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "installed open limit - lift", + "name": "CurrentPositionLiftPercent100ths", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentPositionTiltPercent100ths", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "InstalledOpenLimitLift", "code": 16, "mfgCode": null, "side": "server", @@ -4867,7 +4957,7 @@ "reportableChange": 0 }, { - "name": "installed closed limit - lift", + "name": "InstalledClosedLimitLift", "code": 17, "mfgCode": null, "side": "server", @@ -4882,7 +4972,7 @@ "reportableChange": 0 }, { - "name": "installed open limit - tilt", + "name": "InstalledOpenLimitTilt", "code": 18, "mfgCode": null, "side": "server", @@ -4897,7 +4987,7 @@ "reportableChange": 0 }, { - "name": "installed closed limit - tilt", + "name": "InstalledClosedLimitTilt", "code": 19, "mfgCode": null, "side": "server", @@ -4912,7 +5002,7 @@ "reportableChange": 0 }, { - "name": "mode", + "name": "Mode", "code": 23, "mfgCode": null, "side": "server", @@ -4926,6 +5016,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "SafetyStatus", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "cluster revision", "code": 65533, diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 35216d8b2fe229..35cd63fb019f07 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -4691,7 +4691,7 @@ "outgoing": 1 }, { - "name": "StopMotion", + "name": "Stop", "code": 2, "mfgCode": null, "source": "client", From 6c172a28363d1a8d5052aa898ddcc4e200ed08ce Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 17:08:55 -0400 Subject: [PATCH 41/47] Make exchanges handle closing on message receipt more automatically. (#8050) The idea is that the cases that want to keep the exchange open should do so explicitly and in all other cases the exchange should close. This helps avoid exchange leaks and makes it much clearer when an exchange is being kept open. --- examples/shell/shell_common/cmd_send.cpp | 1 - src/app/CommandHandler.cpp | 2 + src/app/CommandSender.cpp | 5 +- src/app/InteractionModelEngine.cpp | 1 - src/app/ReadClient.cpp | 4 +- src/app/ReadHandler.cpp | 13 +++++ src/app/WriteClient.cpp | 10 +--- src/app/WriteHandler.cpp | 2 + src/app/server/Server.cpp | 1 - src/controller/CHIPDevice.cpp | 1 - src/controller/CHIPDeviceController.cpp | 6 -- src/messaging/ExchangeContext.cpp | 43 +++++++++++++- src/messaging/ExchangeContext.h | 6 ++ src/messaging/ExchangeDelegate.h | 13 ++++- src/messaging/ExchangeMgr.cpp | 34 ++++------- src/messaging/ReliableMessageContext.h | 8 +++ src/messaging/tests/TestExchangeMgr.cpp | 1 - .../tests/TestReliableMessageProtocol.cpp | 57 ++++++++++++++++++- src/protocols/echo/EchoClient.cpp | 12 +--- src/protocols/secure_channel/CASESession.cpp | 13 +++-- .../secure_channel/MessageCounterManager.cpp | 2 - src/protocols/secure_channel/PASESession.cpp | 13 +++-- .../tests/TestMessageCounterManager.cpp | 1 - .../secure_channel/tests/TestPASESession.cpp | 1 - 24 files changed, 172 insertions(+), 78 deletions(-) diff --git a/examples/shell/shell_common/cmd_send.cpp b/examples/shell/shell_common/cmd_send.cpp index 5caa790c712464..631b3fe59d5300 100644 --- a/examples/shell/shell_common/cmd_send.cpp +++ b/examples/shell/shell_common/cmd_send.cpp @@ -110,7 +110,6 @@ class MockAppDelegate : public Messaging::ExchangeDelegate streamer_printf(sout, "Response received: len=%u time=%.3fms\n", buffer->DataLength(), static_cast(transitTime) / 1000); - gExchangeCtx->Close(); gExchangeCtx = nullptr; return CHIP_NO_ERROR; } diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 248cf94270f68f..20e3d8cd9776a3 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -72,6 +72,8 @@ CHIP_ERROR CommandHandler::SendCommandResponse() MoveToState(CommandState::Sending); exit: + // Keep Shutdown() from double-closing our exchange. + mpExchangeCtx = nullptr; Shutdown(); ChipLogFunctError(err); return err; diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index ebd67421110960..8764ef842818a6 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -92,9 +92,8 @@ CHIP_ERROR CommandSender::OnMessageReceived(Messaging::ExchangeContext * apExcha exit: ChipLogFunctError(err); - // Close the exchange cleanly so that the ExchangeManager will send an ack for the message we just received. - // This needs to be done before the Reset() call, because Reset() aborts mpExchangeCtx if its not null. - mpExchangeCtx->Close(); + // Null out mpExchangeCtx, so our Shutdown() call below won't try to abort + // it and fail to send an ack for the message we just received. mpExchangeCtx = nullptr; if (mpDelegate != nullptr) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 73b87bba2a1af4..8ba0e2b69e55bc 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -192,7 +192,6 @@ CHIP_ERROR InteractionModelEngine::OnUnknownMsgType(Messaging::ExchangeContext * // err = SendStatusReport(ec, kChipProfile_Common, kStatus_UnsupportedMessage); // SuccessOrExit(err); - apExchangeContext->Close(); apExchangeContext = nullptr; ChipLogFunctError(err); diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index adca991dc3a4ee..e68342a808b2e0 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -229,8 +229,8 @@ CHIP_ERROR ReadClient::OnMessageReceived(Messaging::ExchangeContext * apExchange exit: ChipLogFunctError(err); - // Close the exchange cleanly so that the ExchangeManager will send an ack for the message we just received. - mpExchangeCtx->Close(); + // Null out mpExchangeCtx, so our Shutdown() call below won't try to abort + // it and fail to send an ack for the message we just received. mpExchangeCtx = nullptr; MoveToState(ClientState::Initialized); diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 34898f22057cdd..344fb01ad909cf 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -82,6 +82,8 @@ CHIP_ERROR ReadHandler::OnReadRequest(Messaging::ExchangeContext * apExchangeCon if (err != CHIP_NO_ERROR) { ChipLogFunctError(err); + // Keep Shutdown() from double-closing our exchange. + mpExchangeCtx = nullptr; Shutdown(); } @@ -153,6 +155,17 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa MoveToState(HandlerState::Reportable); err = InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleRun(); + SuccessOrExit(err); + + // mpExchangeCtx can be null here due to + // https://github.com/project-chip/connectedhomeip/issues/8031 + if (mpExchangeCtx) + { + mpExchangeCtx->WillSendMessage(); + } + + // There must be no code after the WillSendMessage() call that can cause + // this method to return a failure. exit: ChipLogFunctError(err); diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index ba43e62a7409ca..c64c147205c34c 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -294,20 +294,16 @@ CHIP_ERROR WriteClient::OnMessageReceived(Messaging::ExchangeContext * apExchang VerifyOrDie(apExchangeContext == mpExchangeCtx); + // We are done with this exchange, and it will be closing itself. + mpExchangeCtx = nullptr; + // Verify that the message is an Write Response. // If not, close the exchange and free the payload. if (!aPayloadHeader.HasMessageType(Protocols::InteractionModel::MsgType::WriteResponse)) { - apExchangeContext->Close(); - mpExchangeCtx = nullptr; ExitNow(); } - // Close the current exchange after receiving the response since the response message marks the - // end of conversation represented by the exchange. We should create an new exchange for a new - // conversation defined in Interaction Model protocol. - ClearExistingExchangeContext(); - err = ProcessWriteResponseMessage(std::move(aPayload)); exit: diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 17d619dc2a741d..f726c13c5e3c8a 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -75,6 +75,8 @@ CHIP_ERROR WriteHandler::OnWriteRequest(Messaging::ExchangeContext * apExchangeC exit: ChipLogFunctError(err); + // Keep Shutdown() from double-closing our exchange. + mpExchangeCtx = nullptr; Shutdown(); return err; } diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 9215fdeb8188e3..bb6997ccecd2ce 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -387,7 +387,6 @@ class ServerCallback : public ExchangeDelegate } exit: - exchangeContext->Close(); return err; } diff --git a/src/controller/CHIPDevice.cpp b/src/controller/CHIPDevice.cpp index 82d4fd5e0e73eb..d04ba07ae9f71b 100644 --- a/src/controller/CHIPDevice.cpp +++ b/src/controller/CHIPDevice.cpp @@ -337,7 +337,6 @@ CHIP_ERROR Device::OnMessageReceived(Messaging::ExchangeContext * exchange, cons HandleDataModelMessage(exchange, std::move(msgBuf)); } } - exchange->Close(); return CHIP_NO_ERROR; } diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index f748aa9516a46b..0fd3b28e8080e3 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -572,7 +572,6 @@ CHIP_ERROR DeviceController::OnMessageReceived(Messaging::ExchangeContext * ec, const PayloadHeader & payloadHeader, System::PacketBufferHandle && msgBuf) { uint16_t index; - bool needClose = true; VerifyOrExit(mState == State::Initialized, ChipLogError(Controller, "OnMessageReceived was called in incorrect state")); @@ -582,14 +581,9 @@ CHIP_ERROR DeviceController::OnMessageReceived(Messaging::ExchangeContext * ec, index = FindDeviceIndex(packetHeader.GetSourceNodeId().Value()); VerifyOrExit(index < kNumMaxActiveDevices, ChipLogError(Controller, "OnMessageReceived was called for unknown device object")); - needClose = false; // Device will handle it mActiveDevices[index].OnMessageReceived(ec, packetHeader, payloadHeader, std::move(msgBuf)); exit: - if (needClose) - { - ec->Close(); - } return CHIP_NO_ERROR; } diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 585aa9e4c7c0c3..fee80615221a15 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -79,6 +79,9 @@ void ExchangeContext::SetResponseTimeout(Timeout timeout) CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgType, PacketBufferHandle && msgBuf, const SendFlags & sendFlags) { + // If we were waiting for a message send, this is it. + mFlags.Clear(Flags::kFlagWillSendMessage); + CHIP_ERROR err = CHIP_NO_ERROR; Transport::PeerConnectionState * state = nullptr; @@ -143,6 +146,8 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp void ExchangeContext::DoClose(bool clearRetransTable) { + mFlags.Set(Flags::kFlagClosed); + // Clear protocol callbacks if (mDelegate != nullptr) { @@ -379,6 +384,14 @@ CHIP_ERROR ExchangeContext::HandleMessage(const PacketHeader & packetHeader, con // layer has completed its work on the ExchangeContext. Retain(); + // Keep track of whether we're nested under an outer HandleMessage + // invocation. + bool alreadyHandlingMessage = mFlags.Has(Flags::kFlagHandlingMessage); + mFlags.Set(Flags::kFlagHandlingMessage); + + bool isStandaloneAck = payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StandaloneAck); + bool isDuplicate = msgFlags.Has(MessageFlagValues::kDuplicateMessage); + CHIP_ERROR err = mDispatch->OnMessageReceived(payloadHeader, packetHeader.GetMessageId(), peerAddress, msgFlags, GetReliableMessageContext()); SuccessOrExit(err); @@ -393,13 +406,13 @@ CHIP_ERROR ExchangeContext::HandleMessage(const PacketHeader & packetHeader, con } // The SecureChannel::StandaloneAck message type is only used for MRP; do not pass such messages to the application layer. - if (payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StandaloneAck)) + if (isStandaloneAck) { ExitNow(err = CHIP_NO_ERROR); } // Since the message is duplicate, let's not forward it up the stack - if (msgFlags.Has(MessageFlagValues::kDuplicateMessage)) + if (isDuplicate) { ExitNow(err = CHIP_NO_ERROR); } @@ -422,6 +435,32 @@ CHIP_ERROR ExchangeContext::HandleMessage(const PacketHeader & packetHeader, con } exit: + // Don't close ourselves if we're already closed. + // + // Don't close ourselves if this message is a standalone ack. We're still + // not closed and getting an ack should not affect that. In particular, + // since the standalone ack was not passed to the delegate, the delegate + // never got a chance to say "stay open". The one exception here is if + // mDelegate is null: in that case this is an unsolicited message and we + // were just created to ack it and close after that. + // + // Don't close for duplicates for similar reasons, with the same exception. + // + // Also don't close if there's an outer HandleMessage invocation. It'll + // deal with the closing. + if (!mFlags.Has(Flags::kFlagClosed) && !mFlags.Has(Flags::kFlagWillSendMessage) && !IsResponseExpected() && + (!isStandaloneAck || (mDelegate == nullptr)) && (!isDuplicate || (mDelegate == nullptr)) && !alreadyHandlingMessage) + { + Close(); + } + + if (!alreadyHandlingMessage) + { + // We are the outermost HandleMessage invocation. We're not handling a + // message anymore. + mFlags.Clear(Flags::kFlagHandlingMessage); + } + // Release the reference to the ExchangeContext that was held at the beginning of this function. // This call should also do the needful of closing the ExchangeContext if the protocol has // already made a prior call to Close(). diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 5a83e66af772c5..c766af817a0538 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -109,6 +109,12 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen std::move(msgPayload), sendFlags); } + /** + * A notification that we will have SendMessage called on us in the future + * (and should stay open until that happens). + */ + void WillSendMessage() { mFlags.Set(Flags::kFlagWillSendMessage); } + /** * Handle a received CHIP message on this exchange. * diff --git a/src/messaging/ExchangeDelegate.h b/src/messaging/ExchangeDelegate.h index 9d623baffa791a..db694dd477b3e2 100644 --- a/src/messaging/ExchangeDelegate.h +++ b/src/messaging/ExchangeDelegate.h @@ -49,7 +49,18 @@ class DLL_EXPORT ExchangeDelegate /** * @brief - * This function is the protocol callback for handling a received CHIP message. + * This function is the protocol callback for handling a received CHIP + * message. + * + * After calling this method an exchange will close itself unless one of + * two things happens: + * + * 1) A call to SendMessage on the exchange with the kExpectResponse flag + * set. + * 2) A call to WillSendMessage on the exchange. + * + * Consumers that don't do one of those things MUST NOT retain a pointer + * to the exchange. * * @param[in] ec A pointer to the ExchangeContext object. * @param[in] packetHeader A reference to the PacketHeader object. diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index a769574354bbd4..a412b74ab467d4 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -201,7 +201,6 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const { CHIP_ERROR err = CHIP_NO_ERROR; UnsolicitedMessageHandler * matchingUMH = nullptr; - bool sendAckAndCloseExchange = false; ChipLogProgress(ExchangeManager, "Received message of type %d and protocolId %" PRIu32 " on exchange %d", payloadHeader.GetMessageType(), payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), @@ -269,36 +268,23 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const ExitNow(err = CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR); } - // If we didn't find an existing exchange that matches the message, and no unsolicited message handler registered - // to hand this message, we need to create a temporary exchange to send an ack for this message and then close this exchange. - sendAckAndCloseExchange = payloadHeader.NeedsAck() && (matchingUMH == nullptr); - - // If we found a handler or we need to create a new exchange context (EC). - if (matchingUMH != nullptr || sendAckAndCloseExchange) + // If we found a handler or we need to send an ack, create an exchange to + // handle the message. + if (matchingUMH != nullptr || payloadHeader.NeedsAck()) { - ExchangeContext * ec = nullptr; - - if (sendAckAndCloseExchange) - { - // If rcvd msg is from initiator then this exchange is created as not Initiator. - // If rcvd msg is not from initiator then this exchange is created as Initiator. - // TODO: Figure out which channel to use for the received message - ec = mContextPool.CreateObject(this, payloadHeader.GetExchangeID(), session, !payloadHeader.IsInitiator(), nullptr); - } - else - { - ec = mContextPool.CreateObject(this, payloadHeader.GetExchangeID(), session, false, matchingUMH->Delegate); - } + ExchangeDelegate * delegate = matchingUMH ? matchingUMH->Delegate : nullptr; + // If rcvd msg is from initiator then this exchange is created as not Initiator. + // If rcvd msg is not from initiator then this exchange is created as Initiator. + // Note that if matchingUMH is not null then rcvd msg if from initiator. + // TODO: Figure out which channel to use for the received message + ExchangeContext * ec = + mContextPool.CreateObject(this, payloadHeader.GetExchangeID(), session, !payloadHeader.IsInitiator(), delegate); VerifyOrExit(ec != nullptr, err = CHIP_ERROR_NO_MEMORY); ChipLogDetail(ExchangeManager, "ec id: %d, Delegate: 0x%p", ec->GetExchangeId(), ec->GetDelegate()); ec->HandleMessage(packetHeader, payloadHeader, source, msgFlags, std::move(msgBuf)); - - // Close exchange if it was created only to send ack for a duplicate message. - if (sendAckAndCloseExchange) - ec->Close(); } exit: diff --git a/src/messaging/ReliableMessageContext.h b/src/messaging/ReliableMessageContext.h index d681851deb0629..af6c394dd9a697 100644 --- a/src/messaging/ReliableMessageContext.h +++ b/src/messaging/ReliableMessageContext.h @@ -202,6 +202,14 @@ class ReliableMessageContext /// When set, signifies that at least one message has been received from peer on this exchange context. kFlagMsgRcvdFromPeer = 0x0040, + + /// When set, signifies that this exchange is waiting for a call to SendMessage. + kFlagWillSendMessage = 0x0080, + + /// When set, signifies that we are currently in the middle of HandleMessage. + kFlagHandlingMessage = 0x0100, + /// When set, we have had Close() or Abort() called on us already. + kFlagClosed = 0x0200, }; BitFlags mFlags; // Internal state flags diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index 27b0a0a22c1837..2964d6f7e798b9 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -67,7 +67,6 @@ class MockAppDelegate : public ExchangeDelegate System::PacketBufferHandle && buffer) override { IsOnMessageReceivedCalled = true; - ec->Close(); return CHIP_NO_ERROR; } diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index f6c0c22ceecc1f..84f6891b9894f6 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -88,9 +88,12 @@ class MockAppDelegate : public ExchangeDelegate if (!mRetainExchange) { - ec->Close(); ec = nullptr; } + else + { + ec->WillSendMessage(); + } mExchange = ec; if (mTestSuite != nullptr) @@ -154,7 +157,6 @@ class MockSessionEstablishmentDelegate : public ExchangeDelegate System::PacketBufferHandle && buffer) override { IsOnMessageReceivedCalled = true; - ec->Close(); if (mTestSuite != nullptr) { NL_TEST_ASSERT(mTestSuite, buffer->TotalLength() == sizeof(PAYLOAD)); @@ -943,6 +945,56 @@ void CheckNoPiggybackAfterPiggyback(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0); } +void CheckSendUnsolicitedStandaloneAckMessage(nlTestSuite * inSuite, void * inContext) +{ + /** + * Tests sending a standalone ack message that is: + * 1) Unsolicited. + * 2) Requests an ack. + * + * This is not a thing that would normally happen, but a malicious entity + * could absolutely do this. + */ + TestContext & ctx = *reinterpret_cast(inContext); + + ctx.GetInetLayer().SystemLayer()->Init(nullptr); + + chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData("", 0); + NL_TEST_ASSERT(inSuite, !buffer.IsNull()); + + CHIP_ERROR err = CHIP_NO_ERROR; + + MockAppDelegate mockSender; + ExchangeContext * exchange = ctx.NewExchangeToPeer(&mockSender); + NL_TEST_ASSERT(inSuite, exchange != nullptr); + + mockSender.mTestSuite = inSuite; + + ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); + NL_TEST_ASSERT(inSuite, rm != nullptr); + + // Ensure the retransmit table is empty right now + NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0); + + // We send a message, have it get received by the peer, expect an ack from + // the peer. + gLoopback.mSentMessageCount = 0; + gLoopback.mNumMessagesToDrop = 0; + gLoopback.mDroppedMessageCount = 0; + + // Purposefully sending a standalone ack that requests an ack! + err = exchange->SendMessage(SecureChannel::MsgType::StandaloneAck, std::move(buffer)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + exchange->Close(); + + // Ensure the message and its ack were sent. + NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); + NL_TEST_ASSERT(inSuite, gLoopback.mDroppedMessageCount == 0); + + // And that nothing is waiting for acks. + NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0); +} + void CheckSendStandaloneAckMessage(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); @@ -1106,6 +1158,7 @@ const nlTest sTests[] = NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateMessageClosedExchange", CheckDuplicateMessageClosedExchange), NL_TEST_DEF("Test that a reply after a standalone ack comes through correctly", CheckReceiveAfterStandaloneAck), NL_TEST_DEF("Test that a reply to a non-MRP message does not piggyback an ack even if there were MRP things happening on the context before", CheckNoPiggybackAfterPiggyback), + NL_TEST_DEF("Test sending an unsolicited ack-soliciting 'standalone ack' message", CheckSendUnsolicitedStandaloneAckMessage), NL_TEST_DEF("Test ReliableMessageMgr::CheckSendStandaloneAckMessage", CheckSendStandaloneAckMessage), NL_TEST_DEF("Test command, response, default response, with receiver closing exchange after sending response", CheckMessageAfterClosed), diff --git a/src/protocols/echo/EchoClient.cpp b/src/protocols/echo/EchoClient.cpp index fe14851805303b..d1024773d70b63 100644 --- a/src/protocols/echo/EchoClient.cpp +++ b/src/protocols/echo/EchoClient.cpp @@ -95,22 +95,14 @@ CHIP_ERROR EchoClient::OnMessageReceived(Messaging::ExchangeContext * ec, const // which clears the OnMessageReceived callback. VerifyOrDie(ec == mExchangeCtx); + mExchangeCtx = nullptr; + // Verify that the message is an Echo Response. - // If not, close the exchange and free the payload. if (!payloadHeader.HasMessageType(MsgType::EchoResponse)) { - ec->Close(); - mExchangeCtx = nullptr; return CHIP_ERROR_INVALID_ARGUMENT; } - // Remove the EC from the app state now. OnEchoResponseReceived can call - // SendEchoRequest and install a new one. We abort rather than close - // because we no longer care whether the echo request message has been - // acknowledged at the transport layer. - mExchangeCtx->Abort(); - mExchangeCtx = nullptr; - // Call the registered OnEchoResponseReceived handler, if any. if (OnEchoResponseReceived != nullptr) { diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 4a3b22c207e859..ff18f1b4be259e 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -935,8 +935,8 @@ CHIP_ERROR CASESession::SendSigmaR3() mPairingComplete = true; - // Close the exchange, as no additional messages are expected from the peer - CloseExchange(); + // Forget our exchange, as no additional messages are expected from the peer + mExchangeCtxt = nullptr; // Call delegate to indicate pairing completion mDelegate->OnSessionEstablished(); @@ -1079,8 +1079,8 @@ CHIP_ERROR CASESession::HandleSigmaR3(System::PacketBufferHandle & msg) mPairingComplete = true; - // Close the exchange, as no additional messages are expected from the peer - CloseExchange(); + // Forget our exchange, as no additional messages are expected from the peer + mExchangeCtxt = nullptr; // Call delegate to indicate pairing completion mDelegate->OnSessionEstablished(); @@ -1332,8 +1332,6 @@ CHIP_ERROR CASESession::ValidateReceivedMessage(ExchangeContext * ec, const Pack { if (mExchangeCtxt != ec) { - // Close the incoming exchange explicitly, as the cleanup code only closes mExchangeCtxt - ec->Close(); ReturnErrorOnFailure(CHIP_ERROR_INVALID_ARGUMENT); } } @@ -1401,6 +1399,9 @@ CHIP_ERROR CASESession::OnMessageReceived(ExchangeContext * ec, const PacketHead // Call delegate to indicate session establishment failure. if (err != CHIP_NO_ERROR) { + // Null out mExchangeCtxt so that Clear() doesn't try closing it. The + // exchange will handle that. + mExchangeCtxt = nullptr; Clear(); mDelegate->OnSessionEstablishmentError(err); } diff --git a/src/protocols/secure_channel/MessageCounterManager.cpp b/src/protocols/secure_channel/MessageCounterManager.cpp index 264801d5be5868..cd318ad8b58df7 100644 --- a/src/protocols/secure_channel/MessageCounterManager.cpp +++ b/src/protocols/secure_channel/MessageCounterManager.cpp @@ -277,7 +277,6 @@ CHIP_ERROR MessageCounterManager::HandleMsgCounterSyncReq(Messaging::ExchangeCon ChipLogError(SecureChannel, "Failed to handle MsgCounterSyncReq message with error:%s", ErrorStr(err)); } - exchangeContext->Close(); return err; } @@ -324,7 +323,6 @@ CHIP_ERROR MessageCounterManager::HandleMsgCounterSyncResp(Messaging::ExchangeCo ChipLogError(SecureChannel, "Failed to handle MsgCounterSyncResp message with error:%s", ErrorStr(err)); } - exchangeContext->Close(); return err; } diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index bb935e2f3e0c70..8259524a4e9e33 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -646,8 +646,8 @@ CHIP_ERROR PASESession::HandleMsg2_and_SendMsg3(const System::PacketBufferHandle mPairingComplete = true; - // Close the exchange, as no additional messages are expected from the peer - CloseExchange(); + // Forget our exchange, as no additional messages are expected from the peer + mExchangeCtxt = nullptr; // Call delegate to indicate pairing completion mDelegate->OnSessionEstablished(); @@ -688,8 +688,8 @@ CHIP_ERROR PASESession::HandleMsg3(const System::PacketBufferHandle & msg) mPairingComplete = true; - // Close the exchange, as no additional messages are expected from the peer - CloseExchange(); + // Forget our exchange, as no additional messages are expected from the peer + mExchangeCtxt = nullptr; // Call delegate to indicate pairing completion mDelegate->OnSessionEstablished(); @@ -764,8 +764,6 @@ CHIP_ERROR PASESession::ValidateReceivedMessage(ExchangeContext * exchange, cons { if (mExchangeCtxt != exchange) { - // Close the incoming exchange explicitly, as the cleanup code only closes mExchangeCtxt - exchange->Close(); ReturnErrorOnFailure(CHIP_ERROR_INVALID_ARGUMENT); } } @@ -827,6 +825,9 @@ CHIP_ERROR PASESession::OnMessageReceived(ExchangeContext * exchange, const Pack // Call delegate to indicate pairing failure if (err != CHIP_NO_ERROR) { + // Null out mExchangeCtxt so that Clear() doesn't try closing it. The + // exchange will handle that. + mExchangeCtxt = nullptr; Clear(); ChipLogError(SecureChannel, "Failed during PASE session setup. %s", ErrorStr(err)); mDelegate->OnSessionEstablishmentError(err); diff --git a/src/protocols/secure_channel/tests/TestMessageCounterManager.cpp b/src/protocols/secure_channel/tests/TestMessageCounterManager.cpp index 8e12adc713dc52..db3bfc92042ade 100644 --- a/src/protocols/secure_channel/tests/TestMessageCounterManager.cpp +++ b/src/protocols/secure_channel/tests/TestMessageCounterManager.cpp @@ -63,7 +63,6 @@ class MockAppDelegate : public ExchangeDelegate System::PacketBufferHandle && msgBuf) override { ++ReceiveHandlerCallCount; - ec->Close(); return CHIP_NO_ERROR; } diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index 9d72adb7cce958..236fb0ffbde500 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -99,7 +99,6 @@ class MockAppDelegate : public ExchangeDelegate CHIP_ERROR OnMessageReceived(ExchangeContext * ec, const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, System::PacketBufferHandle && buffer) override { - ec->Close(); return CHIP_NO_ERROR; } From dce4293b97927a58725a43d368e61e201a095e53 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 9 Jul 2021 14:09:13 -0700 Subject: [PATCH 42/47] Conduct platform shutdown after RunEventLoop returns (#8255) --- src/messaging/tests/echo/common.cpp | 1 - src/messaging/tests/echo/echo_requester.cpp | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/messaging/tests/echo/common.cpp b/src/messaging/tests/echo/common.cpp index b90877bd298d56..75a4d7d0e391d6 100644 --- a/src/messaging/tests/echo/common.cpp +++ b/src/messaging/tests/echo/common.cpp @@ -58,7 +58,6 @@ void InitializeChip(void) void ShutdownChip(void) { - chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); chip::DeviceLayer::PlatformMgr().Shutdown(); gMessageCounterManager.Shutdown(); gExchangeManager.Shutdown(); diff --git a/src/messaging/tests/echo/echo_requester.cpp b/src/messaging/tests/echo/echo_requester.cpp index 08b3a27e09e527..400d69364bb6de 100644 --- a/src/messaging/tests/echo/echo_requester.cpp +++ b/src/messaging/tests/echo/echo_requester.cpp @@ -98,12 +98,12 @@ void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_E if (err != CHIP_NO_ERROR) { printf("Send request failed: %s\n", chip::ErrorStr(err)); - Shutdown(); + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); } } else { - Shutdown(); + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); } } @@ -276,12 +276,9 @@ int main(int argc, char * argv[]) chip::DeviceLayer::PlatformMgr().RunEventLoop(); -exit: - if (err != CHIP_NO_ERROR) - { - Shutdown(); - } + Shutdown(); +exit: if ((err != CHIP_NO_ERROR) || (gEchoRespCount != kMaxEchoCount)) { printf("ChipEchoClient failed: %s\n", chip::ErrorStr(err)); From 8ccbbb5027a57a80fb83519d5f146a09373b8559 Mon Sep 17 00:00:00 2001 From: bluebin14 <80577827+bluebin14@users.noreply.github.com> Date: Fri, 9 Jul 2021 23:09:38 +0200 Subject: [PATCH 43/47] chip-tool: do not hardcode Thread network id (#8245) * chip-tool: do not hardcode Thread network id * Apply review suggestions * fix merge conflict --- .../commands/pairing/PairingCommand.cpp | 32 ++++++++++++++++--- .../commands/pairing/PairingCommand.h | 4 +++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index ec9772c1bce42e..f3db0a116cc9ae 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -25,9 +25,8 @@ using namespace ::chip; -constexpr uint64_t kBreadcrumb = 0; -constexpr uint32_t kTimeoutMs = 6000; -constexpr uint8_t kTemporaryThreadNetworkId[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; +constexpr uint64_t kBreadcrumb = 0; +constexpr uint32_t kTimeoutMs = 6000; CHIP_ERROR PairingCommand::Run() { @@ -258,6 +257,26 @@ CHIP_ERROR PairingCommand::AddWiFiNetwork() return mCluster.AddWiFiNetwork(successCallback, failureCallback, mSSID, mPassword, kBreadcrumb, kTimeoutMs); } +chip::ByteSpan PairingCommand::GetThreadNetworkId() +{ + // For Thread devices the networkId is the extendedPanId and it is + // part of the dataset defined by OpenThread + + Thread::OperationalDataset dataset; + + if (dataset.Init(mOperationalDataset) != CHIP_NO_ERROR) + { + return ByteSpan(); + } + + if (dataset.GetExtendedPanId(mExtendedPanId) != CHIP_NO_ERROR) + { + return ByteSpan(); + } + + return ByteSpan(mExtendedPanId); +} + CHIP_ERROR PairingCommand::EnableNetwork() { Callback::Cancelable * successCallback = mOnEnableNetworkCallback->Cancel(); @@ -270,7 +289,12 @@ CHIP_ERROR PairingCommand::EnableNetwork() } else { - networkId = ByteSpan(kTemporaryThreadNetworkId, sizeof(kTemporaryThreadNetworkId)); + networkId = GetThreadNetworkId(); + } + + if (networkId.empty()) + { + return CHIP_ERROR_INVALID_ARGUMENT; } return mCluster.EnableNetwork(successCallback, failureCallback, networkId, kBreadcrumb, kTimeoutMs); diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index ac2353f041f280..dc9edebc1229b3 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -24,6 +24,7 @@ #include "gen/CHIPClusters.h" #include +#include #include #include @@ -140,6 +141,8 @@ class PairingCommand : public Command, CHIP_ERROR EnableNetwork(); CHIP_ERROR UpdateNetworkAddress(); + chip::ByteSpan GetThreadNetworkId(); + const PairingMode mPairingMode; const PairingNetworkType mNetworkType; Command::AddressWithInterface mRemoteAddr; @@ -149,6 +152,7 @@ class PairingCommand : public Command, uint16_t mDiscriminator; uint32_t mSetupPINCode; chip::ByteSpan mOperationalDataset; + uint8_t mExtendedPanId[chip::Thread::kSizeExtendedPanId]; chip::ByteSpan mSSID; chip::ByteSpan mPassword; char * mOnboardingPayload; From 97ab77ffbe86b60fe38032f7c23c37ff1a3aa9b8 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Sat, 10 Jul 2021 02:45:38 -0400 Subject: [PATCH 44/47] RFC: Add common 3rd party warnings config target (#7959) There is an idiom for relaxing warnings for third party in GN: configs -= [ "//buildsys/1st_party_warnings" ] configs += [ "//buildsys/3rd_party_warnings" ] The trouble is that "//buildsys/1st_party_warnings" is an object from the core build system that we have to name which introduces some coupling (e.g., projects may have the same pattern with different target names and this would not work). To minimize this coupling, indirect this through the build_overrides directory where the top level project can provide suitable targets (or not, if the defaults already work). This is provided for discussion in issue #7935 --- build/config/compiler/BUILD.gn | 48 ++++++++++++++++++++++--------- build_overrides/lwip.gni | 5 ++++ examples/build_overrides/lwip.gni | 5 ++++ third_party/lwip/lwip.gni | 19 ++++-------- 4 files changed, 51 insertions(+), 26 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index fd50779710a66d..9514db60332582 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -161,9 +161,27 @@ config("disabled_warnings") { } } +config("warnings_common") { + cflags = [ "-Wall" ] + + ldflags = [] + if (treat_warnings_as_errors) { + cflags += [ "-Werror" ] + ldflags += [ "-Werror" ] + } + + if (current_os != "mac" && current_os != "ios") { + ldflags += [ "-Wl,--fatal-warnings" ] + } + + if (current_os != "mac" && current_os != "ios" && current_os != "linux" && + current_os != "win") { + cflags += [ "-Wstack-usage=8192" ] + } +} + config("strict_warnings") { cflags = [ - "-Wall", "-Wextra", "-Wshadow", "-Wunreachable-code", @@ -173,11 +191,6 @@ config("strict_warnings") { ldflags = [] - if (treat_warnings_as_errors) { - cflags += [ "-Werror" ] - ldflags += [ "-Werror" ] - } - if (is_clang) { cflags += [ "-Wimplicit-fallthrough", @@ -193,18 +206,27 @@ config("strict_warnings") { config("warnings_default") { configs = [ + ":warnings_common", ":strict_warnings", ":disabled_warnings", ] +} - if (current_os != "mac" && current_os != "ios") { - ldflags = [ "-Wl,--fatal-warnings" ] - } +config("disabled_warnings_third_party") { + cflags = [ + "-Wno-unused", + "-Wno-format", + "-Wno-maybe-uninitialized", + "-Wno-address", + ] +} - if (current_os != "mac" && current_os != "ios" && current_os != "linux" && - current_os != "win") { - cflags = [ "-Wstack-usage=8192" ] - } +config("warnings_third_party") { + configs = [ + ":warnings_common", + ":disabled_warnings", + ":disabled_warnings_third_party", + ] } config("symbols_default") { diff --git a/build_overrides/lwip.gni b/build_overrides/lwip.gni index a0a68d95a11dee..6e6452dbee029a 100644 --- a/build_overrides/lwip.gni +++ b/build_overrides/lwip.gni @@ -12,7 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/build.gni") + declare_args() { # Root directory for lwIP. lwip_root = "//third_party/lwip" } + +lwip_remove_configs = [ "${build_root}/config/compiler:warnings_default" ] +lwip_add_configs = [ "${build_root}/config/compiler:warnings_third_party" ] diff --git a/examples/build_overrides/lwip.gni b/examples/build_overrides/lwip.gni index 9a50a46bae6a8b..9faa77ce8472c0 100644 --- a/examples/build_overrides/lwip.gni +++ b/examples/build_overrides/lwip.gni @@ -12,7 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/build.gni") + declare_args() { # Root directory for lwIP. lwip_root = "//third_party/connectedhomeip/third_party/lwip" } + +lwip_remove_configs = [ "${build_root}/config/compiler:warnings_default" ] +lwip_add_configs = [ "${build_root}/config/compiler:warnings_third_party" ] diff --git a/third_party/lwip/lwip.gni b/third_party/lwip/lwip.gni index 0c821cf8f2eb11..68d776be47472f 100644 --- a/third_party/lwip/lwip.gni +++ b/third_party/lwip/lwip.gni @@ -53,17 +53,6 @@ template("lwip_target") { lwip_6lowpan = false } - config("${lwip_target_name}_warnings") { - cflags = [ - "-Wno-address", - "-Wno-format", - "-Wno-type-limits", - "-Wno-unused-variable", - "-Wno-maybe-uninitialized", - "-Wno-format-type-confusion", - ] - } - config("${lwip_target_name}_base_config") { include_dirs = [ "${lwip_root}/repo/lwip/src/include" ] } @@ -212,8 +201,12 @@ template("lwip_target") { sources += [ "${_lwip_root}/src/netif/lowpan6.c" ] } - # Relax warnings for third_party code. - configs += [ ":${lwip_target_name}_warnings" ] + if (defined(lwip_remove_configs)) { + configs -= lwip_remove_configs + } + if (defined(lwip_add_configs)) { + configs += lwip_add_configs + } public_configs += [ ":${lwip_target_name}_base_config" ] } From 5b690c76e07efea4ec627ffc90381f0b47717213 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Sat, 10 Jul 2021 02:11:35 -0700 Subject: [PATCH 45/47] Move IM standalone test run on a single event loop (#8174) * Move IM standalone test run on a single event loop * Shutdown the platform after RunEventLoop is returned --- .../tests/integration/chip_im_initiator.cpp | 217 +++++++++++------- src/app/tests/integration/common.cpp | 1 - 2 files changed, 133 insertions(+), 85 deletions(-) diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 3dbca058058da2..f627300c8fcda9 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -86,7 +85,10 @@ enum class TestCommandResult : uint8_t TestCommandResult gLastCommandResult = TestCommandResult::kUndefined; -std::condition_variable gCond; +void CommandRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error); +void BadCommandRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error); +void ReadRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error); +void WriteRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error); CHIP_ERROR SendCommandRequest(chip::app::CommandSender * commandSender) { @@ -281,8 +283,6 @@ void HandleReadComplete() printf("Read Response: %" PRIu64 "/%" PRIu64 "(%.2f%%) time=%.3fms\n", gReadRespCount, gReadCount, static_cast(gReadRespCount) * 100 / gReadCount, static_cast(transitTime) / 1000); - - gCond.notify_one(); } void HandleWriteComplete() @@ -294,8 +294,133 @@ void HandleWriteComplete() printf("Write Response: %" PRIu64 "/%" PRIu64 "(%.2f%%) time=%.3fms\n", gWriteRespCount, gWriteCount, static_cast(gWriteRespCount) * 100 / gWriteCount, static_cast(transitTime) / 1000); +} + +void CommandRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (gCommandRespCount != gCommandCount) + { + printf("No response received\n"); + + // Set gCommandRespCount to gCommandCount to start next iteration if there is any. + gCommandRespCount = gCommandCount; + } + + if (gCommandRespCount < kMaxCommandMessageCount) + { + chip::app::CommandSender * commandSender; + err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&commandSender); + SuccessOrExit(err); + + err = SendCommandRequest(commandSender); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to send command request with error: %s\n", chip::ErrorStr(err))); + + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, CommandRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + } + else + { + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, BadCommandRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + } + +exit: + if (err != CHIP_NO_ERROR) + { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + } +} + +void BadCommandRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error) +{ + // Test with invalid endpoint / cluster / command combination. + chip::app::CommandSender * commandSender; + CHIP_ERROR err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&commandSender); + SuccessOrExit(err); + + err = SendBadCommandRequest(commandSender); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to send bad command request with error: %s\n", chip::ErrorStr(err))); + + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, ReadRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + +exit: + if (err != CHIP_NO_ERROR) + { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + } +} + +void ReadRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (gReadRespCount != gReadCount) + { + printf("No response received\n"); + + // Set gReadRespCount to gReadCount to start next iteration if there is any. + gReadRespCount = gReadCount; + } + + if (gReadRespCount < kMaxReadMessageCount) + { + err = SendReadRequest(); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to send read request with error: %s\n", chip::ErrorStr(err))); + + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, ReadRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + } + else + { + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, WriteRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + } + +exit: + if (err != CHIP_NO_ERROR) + { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + } +} + +void WriteRequestTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_ERROR error) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (gWriteRespCount != gWriteCount) + { + printf("No response received\n"); - gCond.notify_one(); + // Set gWriteRespCount to gWriteCount to start next iteration if there is any. + gWriteRespCount = gWriteCount; + } + + if (gWriteRespCount < kMaxWriteMessageCount) + { + chip::app::WriteClient * writeClient; + err = chip::app::InteractionModelEngine::GetInstance()->NewWriteClient(&writeClient); + SuccessOrExit(err); + + err = SendWriteRequest(writeClient); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to send write request with error: %s\n", chip::ErrorStr(err))); + + err = chip::DeviceLayer::SystemLayer.StartTimer(gMessageIntervalSeconds * 1000, WriteRequestTimerHandler, NULL); + VerifyOrExit(err == CHIP_NO_ERROR, printf("Failed to schedule timer with error: %s\n", chip::ErrorStr(err))); + } + else + { + // Complete all tests. + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + } } class MockInteractionModelApp : public chip::app::InteractionModelDelegate @@ -346,7 +471,6 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate printf("Command Response: %" PRIu64 "/%" PRIu64 "(%.2f%%) time=%.3fms\n", gCommandRespCount, gCommandCount, static_cast(gCommandRespCount) * 100 / gCommandCount, static_cast(transitTime) / 1000); - gCond.notify_one(); return CHIP_NO_ERROR; } @@ -439,8 +563,6 @@ int main(int argc, char * argv[]) InitializeChip(); - chip::DeviceLayer::PlatformMgr().StartEventLoopTask(); - err = gTransportManager.Init(chip::Transport::UdpListenParameters(&chip::DeviceLayer::InetLayer) .SetAddressType(chip::Inet::kIPAddressType_IPv4) .SetListenPort(IM_CLIENT_PORT)); @@ -463,86 +585,13 @@ int main(int argc, char * argv[]) err = EstablishSecureSession(); SuccessOrExit(err); - // Connection has been established. Now send the CommandRequests. - for (unsigned int i = 0; i < kMaxCommandMessageCount; i++) - { - chip::app::CommandSender * commandSender; - err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&commandSender); - SuccessOrExit(err); - err = SendCommandRequest(commandSender); - if (err != CHIP_NO_ERROR) - { - printf("Send command request failed: %s\n", chip::ErrorStr(err)); - ExitNow(); - } - - if (gCond.wait_for(lock, std::chrono::seconds(gMessageIntervalSeconds)) == std::cv_status::timeout) - { - printf("Invoke Command: No response received\n"); - } - - VerifyOrExit(gLastCommandResult == TestCommandResult::kSuccess, err = CHIP_ERROR_INCORRECT_STATE); - } - - // Test with invalid endpoint / cluster / command combination. - { - chip::app::CommandSender * commandSender; - err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&commandSender); - SuccessOrExit(err); - err = SendBadCommandRequest(commandSender); - if (err != CHIP_NO_ERROR) - { - printf("Send command request failed: %s\n", chip::ErrorStr(err)); - ExitNow(); - } - - if (gCond.wait_for(lock, std::chrono::seconds(gMessageIntervalSeconds)) == std::cv_status::timeout) - { - printf("Invoke Command: No response received\n"); - } - - VerifyOrExit(gLastCommandResult == TestCommandResult::kFailure, err = CHIP_ERROR_INCORRECT_STATE); - } - - // Connection has been established. Now send the ReadRequests. - for (unsigned int i = 0; i < kMaxReadMessageCount; i++) - { - err = SendReadRequest(); - if (err != CHIP_NO_ERROR) - { - printf("Send read request failed: %s\n", chip::ErrorStr(err)); - goto exit; - } - - if (gCond.wait_for(lock, std::chrono::seconds(gMessageIntervalSeconds)) == std::cv_status::timeout) - { - printf("read request: No response received\n"); - } - } - - // Connection has been established. Now send the ReadRequests. - for (unsigned int i = 0; i < kMaxWriteMessageCount; i++) - { - chip::app::WriteClient * writeClient; - err = chip::app::InteractionModelEngine::GetInstance()->NewWriteClient(&writeClient); - SuccessOrExit(err); - err = SendWriteRequest(writeClient); - - if (err != CHIP_NO_ERROR) - { - printf("Send write request failed: %s\n", chip::ErrorStr(err)); - goto exit; - } + err = chip::DeviceLayer::SystemLayer.StartTimer(0, CommandRequestTimerHandler, NULL); + SuccessOrExit(err); - if (gCond.wait_for(lock, std::chrono::seconds(gMessageIntervalSeconds)) == std::cv_status::timeout) - { - printf("write request: No response received\n"); - } - } + chip::DeviceLayer::PlatformMgr().RunEventLoop(); chip::app::InteractionModelEngine::GetInstance()->Shutdown(); ShutdownChip(); - exit: if (err != CHIP_NO_ERROR || (gCommandRespCount != kMaxCommandMessageCount + kTotalFailureCommandMessageCount)) { diff --git a/src/app/tests/integration/common.cpp b/src/app/tests/integration/common.cpp index ba1398062879b5..be0cbcd6ec9b3d 100644 --- a/src/app/tests/integration/common.cpp +++ b/src/app/tests/integration/common.cpp @@ -58,7 +58,6 @@ void InitializeChip(void) void ShutdownChip(void) { - chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); chip::DeviceLayer::PlatformMgr().Shutdown(); gMessageCounterManager.Shutdown(); gExchangeManager.Shutdown(); From 1fde45f3ec7828f2c52ab6a9673a6618a7b165fe Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 10 Jul 2021 11:09:34 -0400 Subject: [PATCH 46/47] Fix merge conflict between PR #7996 and PR #7183 that causes ZAP CI to fail (#8280) --- src/app/common/gen/attributes/Accessors.cpp | 6 +++--- src/app/common/gen/attributes/Accessors.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/common/gen/attributes/Accessors.cpp b/src/app/common/gen/attributes/Accessors.cpp index 3378ea7c58a6d6..9494c4d514ba44 100644 --- a/src/app/common/gen/attributes/Accessors.cpp +++ b/src/app/common/gen/attributes/Accessors.cpp @@ -4751,15 +4751,15 @@ EmberAfStatus SetMaxScaledValue(chip::EndpointId endpoint, int16_t maxScaledValu return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::MaxScaledValue, (uint8_t *) &maxScaledValue, ZCL_INT16S_ATTRIBUTE_TYPE); } -EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, int16_t * scaledTolerance) +EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, uint16_t * scaledTolerance) { return emberAfReadServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledTolerance, (uint8_t *) scaledTolerance, sizeof(*scaledTolerance)); } -EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, int16_t scaledTolerance) +EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, uint16_t scaledTolerance) { return emberAfWriteServerAttribute(endpoint, PressureMeasurement::Id, Ids::ScaledTolerance, (uint8_t *) &scaledTolerance, - ZCL_INT16S_ATTRIBUTE_TYPE); + ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus GetScale(chip::EndpointId endpoint, int8_t * scale) { diff --git a/src/app/common/gen/attributes/Accessors.h b/src/app/common/gen/attributes/Accessors.h index b2b876e61d1fcd..d9bd7fe4f7c9c0 100644 --- a/src/app/common/gen/attributes/Accessors.h +++ b/src/app/common/gen/attributes/Accessors.h @@ -1169,8 +1169,8 @@ EmberAfStatus GetMinScaledValue(chip::EndpointId endpoint, int16_t * minScaledVa EmberAfStatus SetMinScaledValue(chip::EndpointId endpoint, int16_t minScaledValue); EmberAfStatus GetMaxScaledValue(chip::EndpointId endpoint, int16_t * maxScaledValue); // int16s EmberAfStatus SetMaxScaledValue(chip::EndpointId endpoint, int16_t maxScaledValue); -EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, int16_t * scaledTolerance); // int16s -EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, int16_t scaledTolerance); +EmberAfStatus GetScaledTolerance(chip::EndpointId endpoint, uint16_t * scaledTolerance); // int16u +EmberAfStatus SetScaledTolerance(chip::EndpointId endpoint, uint16_t scaledTolerance); EmberAfStatus GetScale(chip::EndpointId endpoint, int8_t * scale); // int8s EmberAfStatus SetScale(chip::EndpointId endpoint, int8_t scale); } // namespace Attributes From 0e19e0dc441b2481c48022856211f3471f9a6600 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel <67607049+kpschoedel@users.noreply.github.com> Date: Sat, 10 Jul 2021 15:10:46 -0400 Subject: [PATCH 47/47] Fix Build on Linux (no_progress_logging) (pull_request) (#8283) #### Problem `Builds / Build on Linux (no_progress_logging) (pull_request)` fails to build due to a misplaced `break`. #### Change overview Move it. #### Testing `Builds / Build on Linux (no_progress_logging) (pull_request)` --- src/app/MessageDef/SubscribeRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/MessageDef/SubscribeRequest.cpp b/src/app/MessageDef/SubscribeRequest.cpp index c196814f788dc3..6fe2aafcb696d9 100644 --- a/src/app/MessageDef/SubscribeRequest.cpp +++ b/src/app/MessageDef/SubscribeRequest.cpp @@ -106,8 +106,8 @@ CHIP_ERROR SubscribeRequest::Parser::CheckSchemaValidity() const ReturnLogErrorOnFailure(reader.Get(minInterval)); PRETTY_PRINT("\tMinInterval = 0x%" PRIx16 ",", minInterval); } - break; #endif // CHIP_DETAIL_LOGGING + break; case kCsTag_MaxInterval: VerifyOrReturnLogError(!(TagPresenceMask & (1 << kCsTag_MaxInterval)), CHIP_ERROR_INVALID_TLV_TAG); TagPresenceMask |= (1 << kCsTag_MaxInterval);