diff --git a/.pullapprove.yml b/.pullapprove.yml index 24688aa33fb50e..027b944aa496bb 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -91,14 +91,14 @@ groups: teams: [reviewers-comcast] reviews: request: 10 - shared-reviewers-espressif: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-espressif] - reviews: - request: 10 +# shared-reviewers-espressif: +# type: optional +# conditions: +# - files.include('*') +# reviewers: +# teams: [reviewers-espressif] +# reviews: +# request: 10 shared-reviewers-google: type: optional conditions: @@ -107,14 +107,14 @@ groups: teams: [reviewers-google] reviews: request: 10 - shared-reviewers-lg: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-lg] - reviews: - request: 10 +# shared-reviewers-lg: +# type: optional +# conditions: +# - files.include('*') +# reviewers: +# teams: [reviewers-lg] +# reviews: +# request: 10 shared-reviewers-nordic: type: optional conditions: diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp index efced9af6a2ffb..52914d0d9e606f 100644 --- a/examples/bridge-app/esp32/main/main.cpp +++ b/examples/bridge-app/esp32/main/main.cpp @@ -185,8 +185,8 @@ void EncodeFixedLabel(const char * label, const char * value, uint8_t * buffer, uint16_t listCount = 1; _LabelStruct labelStruct; - labelStruct.label = chip::ByteSpan(Uint8::from_const_char(label), strlen(label)); - labelStruct.value = chip::ByteSpan(Uint8::from_const_char(value), strlen(value)); + labelStruct.label = chip::CharSpan(label, strlen(label)); + labelStruct.value = chip::CharSpan(value, strlen(value)); emberAfCopyList(ZCL_FIXED_LABEL_CLUSTER_ID, am, true, buffer, reinterpret_cast(&labelStruct), 1); emberAfCopyList(ZCL_FIXED_LABEL_CLUSTER_ID, am, true, buffer, reinterpret_cast(&listCount), 0); diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 3d4d34c0d4c6a9..53288b703dfdbf 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -200,10 +200,14 @@ void EncodeFixedLabel(const char * label, const char * value, uint8_t * buffer, uint16_t listCount = 1; _LabelStruct labelStruct; - labelStruct.label = chip::ByteSpan(reinterpret_cast(label), kFixedLabelElementsOctetStringSize); + // TODO: This size is obviously wrong. See + // https://github.com/project-chip/connectedhomeip/issues/10743 + labelStruct.label = CharSpan(label, kFixedLabelElementsOctetStringSize); strncpy(zclOctetStrBuf, value, sizeof(zclOctetStrBuf)); - labelStruct.value = chip::ByteSpan(reinterpret_cast(&zclOctetStrBuf[0]), sizeof(zclOctetStrBuf)); + // TODO: This size is obviously wrong. See + // https://github.com/project-chip/connectedhomeip/issues/10743 + labelStruct.value = CharSpan(&zclOctetStrBuf[0], sizeof(zclOctetStrBuf)); emberAfCopyList(ZCL_FIXED_LABEL_CLUSTER_ID, am, true, buffer, reinterpret_cast(&labelStruct), 1); emberAfCopyList(ZCL_FIXED_LABEL_CLUSTER_ID, am, true, buffer, reinterpret_cast(&listCount), 0); diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 13420f5ded8ee7..c5d7b912b0c4b3 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -52,6 +52,13 @@ CHIP_ERROR TestCommand::WaitForMs(uint32_t ms) return chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(ms), OnWaitForMsFn, this); } +CHIP_ERROR TestCommand::Log(const char * message) +{ + ChipLogDetail(chipTool, "%s", message); + WaitForMs(0); + return CHIP_NO_ERROR; +} + void TestCommand::Exit(std::string message) { ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str()); diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index d7617a3f4f6917..bb5d2b82cb7632 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -44,6 +44,7 @@ class TestCommand : public CHIPCommand /////////// GlobalCommands Interface ///////// CHIP_ERROR WaitForMs(uint32_t ms); + CHIP_ERROR Log(const char * message); protected: ChipDevice * mDevice; diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index cdd78aebd469c8..ae5aa12d7c12fc 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -96,7 +96,7 @@ class {{filename}}: public TestCommand {{#if (isTestOnlyCluster cluster)}} CHIP_ERROR {{>testCommand}}() { - return {{command}}({{#chip_tests_item_parameters}}{{#not_first}}, {{/not_first}}{{definedValue}}{{/chip_tests_item_parameters}}); + return {{command}}({{#chip_tests_item_parameters}}{{#not_first}}, {{/not_first}}{{#if (isString type)}}"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); } {{else}} {{#*inline "failureResponse"}}OnFailureResponse_{{index}}{{/inline}} @@ -119,7 +119,6 @@ class {{filename}}: public TestCommand {{/chip_tests_item_parameters}} auto success = [](void * context, const responseType & data) { - {{! TODO Update CHAR_STRING to be of type chip::CharSpan instead of chip::ByteSpan }} (static_cast<{{filename}} *>(context))->OnSuccessResponse_{{index}}({{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}data.{{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}); }; @@ -190,16 +189,3 @@ class {{filename}}: public TestCommand }; {{/chip_tests}} - -void registerCommandsTests(Commands & commands) -{ - const char * clusterName = "Tests"; - - commands_list clusterCommands = { - {{#chip_tests tests}} - make_unique<{{filename}}>(), - {{/chip_tests}} - }; - - commands.Register(clusterName, clusterCommands); -} diff --git a/examples/chip-tool/templates/tests-commands.zapt b/examples/chip-tool/templates/tests-commands.zapt index 4a7dee80b7d947..4f950dbcd8f825 100644 --- a/examples/chip-tool/templates/tests-commands.zapt +++ b/examples/chip-tool/templates/tests-commands.zapt @@ -5,3 +5,16 @@ #include {{>test_cluster tests=(getTests)}} + +void registerCommandsTests(Commands & commands) +{ + const char * clusterName = "Tests"; + + commands_list clusterCommands = { + {{#chip_tests (getTests)}} + make_unique<{{filename}}>(), + {{/chip_tests}} + }; + + commands.Register(clusterName, clusterCommands); +} diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 83c7b0bc2b7d14..183d791c290215 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -126,6 +126,7 @@ function getTests() 'TestClusterComplexTypes', 'TestConstraints', 'TestDelayCommands', + 'TestLogCommands', 'TestDescriptorCluster', 'TestOperationalCredentialsCluster', ]; diff --git a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp index 6cf30fc2b4bd1e..61018e7417424d 100644 --- a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp @@ -51,7 +51,7 @@ CHIP_ERROR AudioOutputManager::proxyGetListOfAudioOutputInfo(chip::app::Attribut { chip::app::Clusters::AudioOutput::Structs::AudioOutputInfo::Type audioOutputInfo; audioOutputInfo.outputType = EMBER_ZCL_AUDIO_OUTPUT_TYPE_HDMI; - audioOutputInfo.name = chip::ByteSpan(chip::Uint8::from_char(name), sizeof(name) - 1); + audioOutputInfo.name = chip::CharSpan(name, sizeof(name) - 1); audioOutputInfo.index = static_cast(1 + i); ReturnErrorOnFailure(encoder.Encode(audioOutputInfo)); } diff --git a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp index 21abbdcc9e78bf..bb8dbf2f255a31 100644 --- a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp +++ b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp @@ -47,8 +47,8 @@ CHIP_ERROR MediaInputManager::proxyGetInputList(chip::app::AttributeValueEncoder for (int i = 0; i < maximumVectorSize; ++i) { chip::app::Clusters::MediaInput::Structs::MediaInputInfo::Type mediaInput; - mediaInput.description = chip::ByteSpan(chip::Uint8::from_char(description), sizeof(description) - 1); - mediaInput.name = chip::ByteSpan(chip::Uint8::from_char(name), sizeof(name) - 1); + mediaInput.description = chip::CharSpan(description, sizeof(description) - 1); + mediaInput.name = chip::CharSpan(name, sizeof(name) - 1); mediaInput.inputType = EMBER_ZCL_MEDIA_INPUT_TYPE_HDMI; mediaInput.index = static_cast(1 + i); ReturnErrorOnFailure(encoder.Encode(mediaInput)); diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp index a2f50a11059a50..bb15476209d9b6 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp @@ -47,7 +47,7 @@ CHIP_ERROR TargetNavigatorManager::proxyGetTargetInfoList(chip::app::AttributeVa for (int i = 0; i < maximumVectorSize; ++i) { chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::Type targetInfo; - targetInfo.name = chip::ByteSpan(chip::Uint8::from_char(name), sizeof(name) - 1); + targetInfo.name = chip::CharSpan(name, sizeof(name) - 1); targetInfo.identifier = static_cast(1 + i); ReturnErrorOnFailure(encoder.Encode(targetInfo)); } diff --git a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp b/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp index 3af338aadc8cc0..5d5a1ead456e6d 100644 --- a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp +++ b/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp @@ -55,9 +55,9 @@ CHIP_ERROR TvChannelManager::proxyGetTvChannelList(chip::app::AttributeValueEnco for (int i = 0; i < maximumVectorSize; ++i) { chip::app::Clusters::TvChannel::Structs::TvChannelInfo::Type channelInfo; - channelInfo.affiliateCallSign = ByteSpan(Uint8::from_char(affiliateCallSign), sizeof(affiliateCallSign) - 1); - channelInfo.callSign = ByteSpan(Uint8::from_char(callSign), sizeof(callSign) - 1); - channelInfo.name = ByteSpan(Uint8::from_char(name), sizeof(name) - 1); + channelInfo.affiliateCallSign = CharSpan(affiliateCallSign, sizeof(affiliateCallSign) - 1); + channelInfo.callSign = CharSpan(callSign, sizeof(callSign) - 1); + channelInfo.name = CharSpan(name, sizeof(name) - 1); channelInfo.majorNumber = static_cast(1 + i); channelInfo.minorNumber = static_cast(2 + i); ReturnErrorOnFailure(encoder.Encode(channelInfo)); diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index ee690e35bfa8a4..53855c80306a8a 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -39,6 +39,7 @@ steps: /workspace/artifacts/ waitFor: - Bootstrap + - ESP32 entrypoint: ./scripts/run_in_build_env.sh volumes: - name: pwenv @@ -55,6 +56,7 @@ steps: /workspace/artifacts/ waitFor: - Bootstrap + - NRFConnect entrypoint: ./scripts/run_in_build_env.sh volumes: - name: pwenv @@ -71,12 +73,14 @@ steps: /workspace/artifacts/ waitFor: - Bootstrap + - EFR32 entrypoint: ./scripts/run_in_build_env.sh volumes: - name: pwenv path: /pwenv - name: "connectedhomeip/chip-build-vscode:0.5.18" + id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -86,6 +90,7 @@ steps: --create-archives /workspace/artifacts/ waitFor: - Bootstrap + - Linux entrypoint: ./scripts/run_in_build_env.sh volumes: - name: pwenv diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py b/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py index 956ff44e3bfbb5..dc9b47a78281dd 100755 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py @@ -17,7 +17,9 @@ import sys import subprocess import logging +import time import click +from pathlib import Path from dataclasses import dataclass from enum import Enum from multiprocessing.connection import Listener, Client @@ -73,6 +75,7 @@ def __call__(self): SERVER_ADDRESS = "/tmp/cirque-helper.socket" +CLIENT_WAIT_TIMEOUT_SECONDS = 5 def CommandFactory(args): @@ -105,6 +108,13 @@ def ServerMain(args): def ClientMain(args): if len(args) == 0: sys.exit(1) + # The server may start very slowly, wait for a few seconds to see if the server will start. + for _ in range(CLIENT_WAIT_TIMEOUT_SECONDS): + socks = Path(SERVER_ADDRESS) + if socks.exists(): + break + time.sleep(1) + # If the address does not exist, Client constructor will throw an exception, so no need to add a flag. with Client(SERVER_ADDRESS) as conn: conn.send(args) res = conn.recv() diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index f7f3bc408866f4..11427a25a90416 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -143,12 +143,7 @@ def AndroidTargets(): yield target.Extend('x64-chip-tool', board=AndroidBoard.X64, app=AndroidApp.CHIP_TOOL) yield target.Extend('x86-chip-tool', board=AndroidBoard.X86, app=AndroidApp.CHIP_TOOL) yield target.Extend('arm64-chip-test', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TEST) - # TODO: android studio build is broken: - # - When compile succeeds, build artifact copy fails with "No such file or - # directory: '/android-androidstudio-chip-tool/outputs/apk/debug/app-debug.apk' - # - Compiling locally in the vscode image fails with - # "2 files found with path 'lib/armeabi-v7a/libCHIPController.so'" - # yield target.Extend('androidstudio-chip-tool', board=AndroidBoard.AndroidStudio, app=AndroidApp.CHIP_TOOL) + yield target.Extend('androidstudio-chip-tool', board=AndroidBoard.AndroidStudio, app=AndroidApp.CHIP_TOOL) ALL = [] diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 570ccf826295bb..2939ed92235020 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -217,13 +217,11 @@ def _build(self): title='Building APP ' + self.identifier) def build_outputs(self): - outputs = { - self.app.AppName() + '-debug.apk': + if not self.board.IsIde(): + outputs = { + self.app.AppName() + 'app-debug.apk': os.path.join(self.output_dir, 'outputs', 'apk', 'debug', 'app-debug.apk'), - } - if not self.board.IsIde(): - outputs.update({ 'CHIPController.jar': os.path.join(self.output_dir, 'lib', 'src/controller/java/CHIPController.jar'), @@ -243,6 +241,12 @@ def build_outputs(self): 'jni/%s/libc++_shared.so' % self.board.AbiName(): os.path.join(self.output_dir, 'lib', 'jni', self.board.AbiName(), 'libc++_shared.so'), - }) + } + else: + outputs = { + self.app.AppName() + '-debug.apk': + os.path.join(self.root, "src/android", self.app.AppName(), + 'app/build/outputs/apk/debug/app-debug.apk') + } return outputs diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 4c03b3656e1980..41a2a8edcf0626 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -1,4 +1,5 @@ ameba-amebad-all-clusters +android-androidstudio-chip-tool android-arm-chip-tool android-arm64-chip-test android-arm64-chip-tool diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index b4416cdf0ae570..b2514c7562a03f 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -10,6 +10,18 @@ python3 build/chip/java/tests/generate_jars_for_test.py # Setting up Android deps through Gradle python3 third_party/android_deps/set_up_android_deps.py +# Generating android-androidstudio-chip-tool +gn gen --check --fail-on-unused-args {out}/android-androidstudio-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning="true"' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py + +# Accepting NDK licenses +bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' + +# Generating JARs for Java build rules test +python3 build/chip/java/tests/generate_jars_for_test.py + +# Setting up Android deps through Gradle +python3 third_party/android_deps/set_up_android_deps.py + # Generating android-arm-chip-tool gn gen --check --fail-on-unused-args {out}/android-arm-chip-tool '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning="true"' @@ -248,6 +260,9 @@ gn gen --check --fail-on-unused-args --root={root}/examples/lighting-app/linux ' # Building ameba-amebad-all-clusters ninja -C {out}/ameba-amebad-all-clusters +# Building APP android-androidstudio-chip-tool +{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-androidstudio-chip-tool -PmatterSdkSourceBuild=true assembleDebug + # Building JNI android-arm-chip-tool ninja -C {out}/android-arm-chip-tool diff --git a/src/app/ConcreteAttributePath.h b/src/app/ConcreteAttributePath.h index db5e0a07f3851d..b3b44a8a2f359c 100644 --- a/src/app/ConcreteAttributePath.h +++ b/src/app/ConcreteAttributePath.h @@ -37,9 +37,9 @@ struct ConcreteAttributePath return mEndpointId == other.mEndpointId && mClusterId == other.mClusterId && mAttributeId == other.mAttributeId; } - const EndpointId mEndpointId = 0; - const ClusterId mClusterId = 0; - const AttributeId mAttributeId = 0; + EndpointId mEndpointId = 0; + ClusterId mClusterId = 0; + AttributeId mAttributeId = 0; }; } // namespace app } // namespace chip diff --git a/src/app/ConcreteCommandPath.h b/src/app/ConcreteCommandPath.h index 12b5add8307c04..7287e1289ddbb0 100644 --- a/src/app/ConcreteCommandPath.h +++ b/src/app/ConcreteCommandPath.h @@ -38,9 +38,9 @@ struct ConcreteCommandPath return mEndpointId == other.mEndpointId && mClusterId == other.mClusterId && mCommandId == other.mCommandId; } - const EndpointId mEndpointId = 0; - const ClusterId mClusterId = 0; - const CommandId mCommandId = 0; + EndpointId mEndpointId = 0; + ClusterId mClusterId = 0; + CommandId mCommandId = 0; }; } // namespace app } // namespace chip diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index cce24fc1fe4568..a6eb8bbf60beaf 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -89,9 +89,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadFabricsList(EndpointId endpoint fabricDescriptor.vendorId = fabricInfo.GetVendorId(); fabricDescriptor.fabricId = fabricInfo.GetFabricId(); - // TODO: The type of 'label' should be 'CharSpan', need to fix the XML definition for broken member type. - fabricDescriptor.label = - ByteSpan(Uint8::from_const_char(fabricInfo.GetFabricLabel().data()), fabricInfo.GetFabricLabel().size()); + fabricDescriptor.label = fabricInfo.GetFabricLabel(); fabricDescriptor.rootPublicKey = fabricInfo.GetRootPubkey(); ReturnErrorOnFailure(encoder.Encode(fabricDescriptor)); @@ -176,7 +174,7 @@ EmberAfStatus writeFabric(FabricIndex fabricIndex, FabricId fabricId, NodeId nod fabricDescriptor->NodeId = nodeId; if (!fabricLabel.empty()) { - fabricDescriptor->Label = ByteSpan(Uint8::from_const_char(fabricLabel.data()), fabricLabel.size()); + fabricDescriptor->Label = fabricLabel; } emberAfPrintln(EMBER_AF_PRINT_DEBUG, @@ -407,7 +405,7 @@ namespace { FabricInfo gFabricBeingCommissioned; -CHIP_ERROR SendNOCResponse(app::Command * commandObj, EmberAfNodeOperationalCertStatus status, uint8_t index, ByteSpan debug_text) +CHIP_ERROR SendNOCResponse(app::Command * commandObj, EmberAfNodeOperationalCertStatus status, uint8_t index, CharSpan debug_text) { app::CommandPathParams cmdParams = { emberAfCurrentEndpoint(), /* group id */ 0, ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, ZCL_NOC_RESPONSE_COMMAND_ID, (app::CommandPathFlags::kEndpointIdValid) }; @@ -422,8 +420,7 @@ CHIP_ERROR SendNOCResponse(app::Command * commandObj, EmberAfNodeOperationalCert { ReturnErrorOnFailure(writer->Put(TLV::ContextTag(1), index)); } - // TODO: Change DebugText to CHAR_STRING once strings are supported in command/response fields - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(2), debug_text)); + ReturnErrorOnFailure(writer->PutString(TLV::ContextTag(2), debug_text)); return commandObj->FinishCommand(); } @@ -494,7 +491,7 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co exit: gFabricBeingCommissioned.Reset(); - SendNOCResponse(commandObj, nocResponse, fabricIndex, ByteSpan()); + SendNOCResponse(commandObj, nocResponse, fabricIndex, CharSpan()); if (nocResponse != EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS) { @@ -538,7 +535,7 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler * exit: - SendNOCResponse(commandObj, nocResponse, fabricIndex, ByteSpan()); + SendNOCResponse(commandObj, nocResponse, fabricIndex, CharSpan()); if (nocResponse != EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS) { diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp index 7317343ef57c13..724090aabd2807 100644 --- a/src/app/clusters/ota-provider/ota-provider.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -189,11 +189,6 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(app::CommandHandl ChipLogDetail(Zcl, "OTA Provider received QueryImage"); - // TODO: (#7112) support location param and verify length once CHAR_STRING is supported - // Using location parameter is blocked by #5542 (use Span for string arguments). For now, there is no way to safely get the - // length of the location string because it is not guaranteed to be null-terminated. - Span locationSpan; - if (metadataForProvider.size() > kMaxMetadataLen) { ChipLogError(Zcl, "metadata size %zu exceeds max %zu", metadataForProvider.size(), kMaxMetadataLen); @@ -201,7 +196,7 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(app::CommandHandl } status = delegate->HandleQueryImage(commandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - locationSpan, requestorCanConsent, metadataForProvider); + commandData.location, requestorCanConsent, metadataForProvider); if (status != EMBER_ZCL_STATUS_SUCCESS) { emberAfSendImmediateDefaultResponse(status); diff --git a/src/app/tests/suites/TestLogCommands.yaml b/src/app/tests/suites/TestLogCommands.yaml new file mode 100644 index 00000000000000..75dca381822131 --- /dev/null +++ b/src/app/tests/suites/TestLogCommands.yaml @@ -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. + +name: Log Commands Tests + +config: + cluster: "Test Cluster" + endpoint: 1 + +tests: + - label: "Log a simple message" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: "This is a simple message" diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 93b47c8b0d14e2..6b7ceb907b70b6 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -87,12 +87,6 @@ const EmberAfAttributeMinMaxValue minMaxDefaults[] = GENERATED_MIN_MAX_DEFAULTS; GENERATED_FUNCTION_ARRAYS #endif -#ifdef EMBER_AF_SUPPORT_COMMAND_DISCOVERY -const EmberAfCommandMetadata generatedCommands[] = GENERATED_COMMANDS; -const EmberAfManufacturerCodeEntry commandManufacturerCodes[] = GENERATED_COMMAND_MANUFACTURER_CODES; -const uint16_t commandManufacturerCodeCount = GENERATED_COMMAND_MANUFACTURER_CODE_COUNT; -#endif - const EmberAfAttributeMetadata generatedAttributes[] = GENERATED_ATTRIBUTES; const EmberAfCluster generatedClusters[] = GENERATED_CLUSTERS; const EmberAfEndpointType generatedEmberAfEndpointTypes[] = GENERATED_ENDPOINT_TYPES; @@ -1329,115 +1323,6 @@ EmberAfGenericClusterFunction emberAfFindClusterFunction(EmberAfCluster * cluste return cluster->functions[functionIndex]; } -#ifdef EMBER_AF_SUPPORT_COMMAND_DISCOVERY - -uint16_t emAfGetManufacturerCodeForCommand(EmberAfCommandMetadata * command) -{ - return getManufacturerCode((EmberAfManufacturerCodeEntry *) commandManufacturerCodes, commandManufacturerCodeCount, - static_cast(command - generatedCommands)); -} - -/** - * This function populates command IDs into a given buffer. - * - * It returns true if commands are complete, meaning there are NO MORE - * commands that would be returned after the last command. - * It returns false, if there were more commands, but were not populated - * because of maxIdCount limitation. - */ -bool emberAfExtractCommandIds(bool outgoing, EmberAfClusterCommand * cmd, ClusterId clusterId, uint8_t * buffer, - uint16_t bufferLength, uint16_t * bufferIndex, uint8_t startId, uint8_t maxIdCount) -{ - uint16_t i, count = 0; - bool returnValue = true; - uint8_t cmdDirMask = 0; - - // determine the appropriate mask to match the request - // discover commands generated, client is asking server what commands do you generate? - if (outgoing && (cmd->direction == ZCL_DIRECTION_CLIENT_TO_SERVER)) - { - cmdDirMask = COMMAND_MASK_OUTGOING_SERVER; - // discover commands generated server is asking client what commands do you generate? - } - else if (outgoing && (cmd->direction == ZCL_DIRECTION_SERVER_TO_CLIENT)) - { - cmdDirMask = COMMAND_MASK_OUTGOING_CLIENT; - // discover commands received client is asking server what commands do you receive? - } - else if (!outgoing && (cmd->direction == ZCL_DIRECTION_CLIENT_TO_SERVER)) - { - cmdDirMask = COMMAND_MASK_INCOMING_SERVER; - // discover commands received server is asking client what commands do you receive? - } - else - { - cmdDirMask = COMMAND_MASK_INCOMING_CLIENT; - } - - for (i = 0; i < EMBER_AF_GENERATED_COMMAND_COUNT; i++) - { - if (generatedCommands[i].clusterId != clusterId) - { - continue; - } - - if ((generatedCommands[i].mask & cmdDirMask) == 0) - { - continue; - } - - // Only start from the passed command id - if (generatedCommands[i].commandId < startId) - { - continue; - } - - // According to spec: if cmd->mfgSpecific is set, then we ONLY return the - // mfg specific commands. If it's not, then we ONLY return non-mfg specific. - if (generatedCommands[i].mask & COMMAND_MASK_MANUFACTURER_SPECIFIC) - { - // Command is Mfg specific - if (!cmd->mfgSpecific) - { - continue; // ignore if asking for not mfg specific - } - if (cmd->mfgCode != emAfGetManufacturerCodeForCommand((EmberAfCommandMetadata *) &(generatedCommands[i]))) - { - continue; // Ignore if mfg code doesn't match the commands - } - } - else - { - // Command is not mfg specific. - if (cmd->mfgSpecific) - { - continue; // Ignore if asking for mfg specific - } - } - - // The one we are about to put in, is beyond the maxIdCount, - // so instead of populating it in, we set the return flag to - // false and get out of here. - if (maxIdCount == count || count >= bufferLength) - { - returnValue = false; - break; - } - buffer[count] = generatedCommands[i].commandId; - (*bufferIndex)++; - count++; - } - return returnValue; -} -#else -// We just need an empty stub if we don't support it -bool emberAfExtractCommandIds(bool outgoing, EmberAfClusterCommand * cmd, ClusterId clusterId, uint8_t * buffer, - uint16_t bufferLength, uint16_t * bufferIndex, uint8_t startId, uint8_t maxIdCount) -{ - return true; -} -#endif - bool registerAttributeAccessOverride(app::AttributeAccessInterface * attrOverride) { for (auto * cur = gAttributeAccessOverrides; cur; cur = cur->GetNext()) diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 84a9f84ab06052..8a4b9075cf43d0 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -121,8 +121,6 @@ void emAfCallInits(void); // Initial configuration void emberAfEndpointConfigure(void); -bool emberAfExtractCommandIds(bool outgoing, EmberAfClusterCommand * cmd, chip::ClusterId clusterId, uint8_t * buffer, - uint16_t bufferLength, uint16_t * bufferIndex, uint8_t startId, uint8_t maxIdCount); EmberAfStatus emAfReadOrWriteAttribute(EmberAfAttributeSearchRecord * attRecord, EmberAfAttributeMetadata ** metadata, uint8_t * buffer, uint16_t readLength, bool write, int32_t index = -1); diff --git a/src/app/util/debug-printing-test.h b/src/app/util/debug-printing-test.h index a43877c270861e..ca70c94edf942e 100644 --- a/src/app/util/debug-printing-test.h +++ b/src/app/util/debug-printing-test.h @@ -155,7 +155,6 @@ #define EMBER_AF_PRINT_APP 0x0D80 #define EMBER_AF_PRINT_SECURITY 0x0E01 #define EMBER_AF_PRINT_ATTRIBUTES 0x0E02 -#define EMBER_AF_PRINT_SERVICE_DISCOVERY 0x0E08 #define EMBER_AF_PRINT_REGISTRATION 0x0E10 #define EMBER_AF_PRINT_ZDO 0x0E20 #define EMBER_AF_PRINT_CUSTOM1 0x0E40 diff --git a/src/app/util/debug-printing.h b/src/app/util/debug-printing.h index e4d1a8a9b5d3b3..43852fceda4068 100644 --- a/src/app/util/debug-printing.h +++ b/src/app/util/debug-printing.h @@ -2772,30 +2772,6 @@ #define emberAfAttributesPrintString(buffer) #endif // defined(EMBER_AF_PRINT_ENABLE) && defined(EMBER_AF_PRINT_ATTRIBUTES) -// Printing macros for Service discovery -// Prints messages related to service discovery -#if defined(EMBER_AF_PRINT_ENABLE) && defined(EMBER_AF_PRINT_SERVICE_DISCOVERY) -#define emberAfServiceDiscoveryPrint(...) emberAfPrint(EMBER_AF_PRINT_SERVICE_DISCOVERY, __VA_ARGS__) -#define emberAfServiceDiscoveryPrintln(...) emberAfPrintln(EMBER_AF_PRINT_SERVICE_DISCOVERY, __VA_ARGS__) -// Blocking IO is enabled for all serial ports, therefore flush calls are unnecessary. -#define emberAfServiceDiscoveryFlush() -#define emberAfServiceDiscoveryDebugExec(x) \ - if (emberAfPrintEnabled(EMBER_AF_PRINT_SERVICE_DISCOVERY)) \ - { \ - x; \ - } -#define emberAfServiceDiscoveryPrintBuffer(buffer, len, withSpace) \ - emberAfPrintBuffer(EMBER_AF_PRINT_SERVICE_DISCOVERY, (buffer), (len), (withSpace)) -#define emberAfServiceDiscoveryPrintString(buffer) emberAfPrintString(EMBER_AF_PRINT_SERVICE_DISCOVERY, (buffer)) -#else -#define emberAfServiceDiscoveryPrint(...) -#define emberAfServiceDiscoveryPrintln(...) -#define emberAfServiceDiscoveryFlush() -#define emberAfServiceDiscoveryDebugExec(x) -#define emberAfServiceDiscoveryPrintBuffer(buffer, len, withSpace) -#define emberAfServiceDiscoveryPrintString(buffer) -#endif // defined(EMBER_AF_PRINT_ENABLE) && defined(EMBER_AF_PRINT_SERVICE_DISCOVERY) - // Printing macros for Registration // Prints messages related to registration #if defined(EMBER_AF_PRINT_ENABLE) && defined(EMBER_AF_PRINT_REGISTRATION) diff --git a/src/app/util/process-global-message.cpp b/src/app/util/process-global-message.cpp index 811c412cefea5c..140d53c87200bb 100644 --- a/src/app/util/process-global-message.cpp +++ b/src/app/util/process-global-message.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include @@ -58,45 +57,6 @@ using namespace chip; -// flag to keep track of the fact that we just sent a read attr for time and -// we should set our time to the result of the read attr response. -bool emAfSyncingTime = false; - -#ifdef EMBER_AF_GBCS_COMPATIBLE -// Some GBCS use cases (e.g. GCS15e, GCS21f) require that ReadAttributesResponse -// should be send back with Disable Default Response flag set. The only pattern -// is that the decision is based on the cluster and attribute IDs requested. -// To reduce the possibility of false positives, we disable default response -// only for responses containing at least the specified minimum of attributes. -#define MIN_MATCHING_ATTR_IDS_TO_DISABLE_DEFAULT_RESPONSE 3 -#endif - -#define DISC_ATTR_RSP_MAX_ATTRIBUTES \ - (((EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ - - 1) /* discovery is complete boolean */ \ - / 5) /* size of one discover attributes response entry */ \ - % UINT8_MAX) /* make count fit in an 8 bit integer */ -#define DISC_ATTR_EXT_RSP_MAX_ATTRIBUTES \ - (((EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ - - 1) /* discovery is complete boolean */ \ - / 5) /* size of one discover attributes extended response entry */ \ - % UINT8_MAX) /* make count fit in an 8 bit integer */ - -#if defined(EMBER_AF_SUPPORT_COMMAND_DISCOVERY) -static void printDiscoverCommandsResponse(bool generated, ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t length) -{ - uint16_t i; - emberAfServiceDiscoveryPrint("Discover Commands response (complete: %c), %p IDs: ", (discoveryComplete ? 'y' : 'n'), - (generated ? "Generated" : "Received")); - for (i = 0; i < length; i++) - { - emberAfServiceDiscoveryPrint("0x%X ", buffer[i]); - } - emberAfServiceDiscoveryPrintln(""); -} -#endif - bool emAfProcessGlobalCommand(EmberAfClusterCommand * cmd) { uint8_t frameControl; @@ -156,56 +116,6 @@ bool emAfProcessGlobalCommand(EmberAfClusterCommand * cmd) switch (zclCmd) { - // the format of discover is: [start attr ID:2] [max attr IDs:1] - // the format of the response is: [done:1] ([attrID:2] [type:1]) * N - case ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID: - case ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID: { - AttributeId startingAttributeId; - uint8_t numberAttributes; - uint8_t * complete; - - emberAfAttributesPrintln("%p%p: clus " ChipLogFormatMEI, "DISC_ATTR", - (zclCmd == ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID ? "_EXT" : ""), ChipLogValueMEI(clusterId)); - - // set the cmd byte - this is byte 3 index 2, but since we have - // already incremented past the 3 byte ZCL header (our index is at 3), - // this gets written to "-1" since 3 - 1 = 2. - emberAfPutInt32uInResp((zclCmd == ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID - ? ZCL_DISCOVER_ATTRIBUTES_RESPONSE_COMMAND_ID - : ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID)); - - // get the attrId to start on and the max count - startingAttributeId = emberAfGetInt32u(message, msgIndex, msgLen); - numberAttributes = emberAfGetInt8u(message, msgIndex + 4, msgLen); - - // BUGZID: EMAPPFWKV2-828, EMAPPFWKV2-1401 - if (zclCmd == ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID && numberAttributes > DISC_ATTR_RSP_MAX_ATTRIBUTES) - { - numberAttributes = DISC_ATTR_RSP_MAX_ATTRIBUTES; - } - else if (zclCmd == ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID && numberAttributes > DISC_ATTR_EXT_RSP_MAX_ATTRIBUTES) - { - numberAttributes = DISC_ATTR_EXT_RSP_MAX_ATTRIBUTES; - } - else - { - // MISRA requires ..else if.. to have terminating else. - } - - // The response has a one-byte field indicating whether discovery is - // complete. We can't populate that field until we've finished going - // through all the attributes, so save a placeholder, write a temporary - // value for now (so that the offset moves forward), and write the real - // value when we're done. - complete = &(appResponseData[appResponseLength]); - emberAfPutInt8uInResp(false); - *complete = emberAfReadSequentialAttributesAddToResponse(cmd->apsFrame->destinationEndpoint, clusterId, startingAttributeId, - clientServerMask, cmd->mfgCode, numberAttributes, - (zclCmd == ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID)); - emberAfSendResponse(); - return true; - } - // [command id:4] [status:1] case ZCL_DEFAULT_RESPONSE_COMMAND_ID: { EmberAfStatus status; @@ -219,92 +129,6 @@ bool emAfProcessGlobalCommand(EmberAfClusterCommand * cmd) return true; } - // [discovery complete:1] ([attribute id:4] [type:1])* - case ZCL_DISCOVER_ATTRIBUTES_RESPONSE_COMMAND_ID: - case ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID: { - bool discoveryComplete = emberAfGetInt8u(message, msgIndex, msgLen); - msgIndex++; - if (!emberAfDiscoverAttributesResponseCallback(clusterId, discoveryComplete, message + msgIndex, - static_cast(msgLen - msgIndex), - (zclCmd == ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID))) - { - emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); - } - return true; - } - -#ifdef EMBER_AF_SUPPORT_COMMAND_DISCOVERY - // Command discovery takes a bit of flash because we need to add structs - // for commands into the generated hader. Hence it's all configurable. - case ZCL_DISCOVER_COMMANDS_RECEIVED_COMMAND_ID: - case ZCL_DISCOVER_COMMANDS_GENERATED_COMMAND_ID: { - uint8_t startCommandIdentifier = emberAfGetInt8u(message, msgIndex, msgLen); - uint8_t maximumCommandIdentifiers = emberAfGetInt8u(message, msgIndex + 1, msgLen); - uint16_t savedIndex; - bool flag; - - // Ok. This is the command that matters. - if (zclCmd == ZCL_DISCOVER_COMMANDS_RECEIVED_COMMAND_ID) - { - emberAfPutInt32uInResp(ZCL_DISCOVER_COMMANDS_RECEIVED_RESPONSE_COMMAND_ID); - flag = false; - } - else - { - emberAfPutInt32uInResp(ZCL_DISCOVER_COMMANDS_GENERATED_RESPONSE_COMMAND_ID); - flag = true; - } - savedIndex = appResponseLength; - flag = emberAfExtractCommandIds(flag, cmd, clusterId, appResponseData + appResponseLength + 1, - static_cast(EMBER_AF_RESPONSE_BUFFER_LEN - appResponseLength - 1), - &appResponseLength, startCommandIdentifier, maximumCommandIdentifiers); - appResponseData[savedIndex] = (flag ? 1 : 0); - appResponseLength++; - emberAfSendResponse(); - return true; - } - case ZCL_DISCOVER_COMMANDS_RECEIVED_RESPONSE_COMMAND_ID: { - bool discoveryComplete = emberAfGetInt8u(message, msgIndex, msgLen); - msgIndex++; - if (msgIndex <= msgLen) - { - printDiscoverCommandsResponse(false, // is ZCL command generated? - clusterId, discoveryComplete, message + msgIndex, - static_cast(msgLen - msgIndex)); - if (!emberAfDiscoverCommandsReceivedResponseCallback(clusterId, cmd->mfgCode, discoveryComplete, message + msgIndex, - static_cast(msgLen - msgIndex))) - { - emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); - } - return true; - } - else - { - return false; - } - } - case ZCL_DISCOVER_COMMANDS_GENERATED_RESPONSE_COMMAND_ID: { - bool discoveryComplete = emberAfGetInt8u(message, msgIndex, msgLen); - msgIndex++; - if (msgIndex <= msgLen) - { - printDiscoverCommandsResponse(true, // is ZCL command generated? - clusterId, discoveryComplete, message + msgIndex, - static_cast(msgLen - msgIndex)); - if (!emberAfDiscoverCommandsGeneratedResponseCallback(clusterId, cmd->mfgCode, discoveryComplete, message + msgIndex, - static_cast(msgLen - msgIndex))) - { - emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); - } - return true; - } - else - { - return false; - } - } - -#endif default: // MISRA requires default case. break; diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 6832ec895bf384..82994a6e6bbeca 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -499,12 +499,6 @@ bool emberAfProcessMessage(EmberApsFrame * apsFrame, EmberIncomingMessageType ty printIncomingZclMessage(&curCmd); prepareForResponse(&curCmd); - if (emberAfPreCommandReceivedCallback(&curCmd)) - { - msgHandled = true; - goto kickout; - } - if (interPanHeader != NULL && !(interPanHeader->options & EMBER_AF_INTERPAN_OPTION_MAC_HAS_LONG_ADDRESS)) { // For safety, dump all interpan messages that don't have a long diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index 01de1efd606c31..c3661c8fc38c11 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -27,6 +27,7 @@ const path = require('path'); const templateUtil = require(zapPath + 'dist/src-electron/generator/template-util.js') const { DelayCommands } = require('./simulated-clusters/TestDelayCommands.js'); +const { LogCommands } = require('./simulated-clusters/TestLogCommands.js'); const { Clusters, asBlocks, asPromise } = require('./ClustersHelper.js'); const { asUpperCamelCase } = require(basePath + 'src/app/zap-templates/templates/app/helper.js'); @@ -263,18 +264,31 @@ function getClusters() { // Create a new array to merge the configured clusters list and test // simulated clusters. - return Clusters.getClusters().then(clusters => clusters.concat(DelayCommands)); + return Clusters.getClusters().then(clusters => clusters.concat(DelayCommands, LogCommands)); } function getCommands(clusterName) { - return (clusterName == DelayCommands.name) ? Promise.resolve(DelayCommands.commands) : Clusters.getClientCommands(clusterName); + switch (clusterName) { + case DelayCommands.name: + return Promise.resolve(DelayCommands.commands); + case LogCommands.name: + return Promise.resolve(LogCommands.commands); + default: + return Clusters.getClientCommands(clusterName); + } } function getAttributes(clusterName) { - return (clusterName == DelayCommands.name) ? Promise.resolve(DelayCommands.attributes) - : Clusters.getServerAttributes(clusterName); + switch (clusterName) { + case DelayCommands.name: + return Promise.resolve(DelayCommands.attributes); + case LogCommands.name: + return Promise.resolve(LogCommands.attributes); + default: + return Clusters.getServerAttributes(clusterName); + } } function assertCommandOrAttribute(context) @@ -341,7 +355,11 @@ function chip_tests_items(options) function isTestOnlyCluster(name) { - return name == DelayCommands.name; + const testOnlyClusters = [ + DelayCommands.name, + LogCommands.name, + ]; + return testOnlyClusters.includes(name); } function chip_tests_item_response_type(options) diff --git a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js b/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js index 7c4736dc533e1b..c1825a68857345 100644 --- a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js +++ b/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js @@ -26,7 +26,7 @@ const WaitForMs = { name : 'WaitForMs', - arguments : [ { name : 'ms' } ], + arguments : [ { type : 'INT32U', name : 'ms' } ], response : { arguments : [] } }; diff --git a/src/app/zap-templates/common/simulated-clusters/TestLogCommands.js b/src/app/zap-templates/common/simulated-clusters/TestLogCommands.js new file mode 100644 index 00000000000000..f90ef284287750 --- /dev/null +++ b/src/app/zap-templates/common/simulated-clusters/TestLogCommands.js @@ -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. + */ + +/* + * This file declares test suite utility methods for logging. + * + * Each method declared in this file needs to be implemented on a per-language + * basis and allows exposing methods to the test suites that are not part + * of the regular cluster set of APIs. + * + */ + +const Log = { + name : 'Log', + arguments : [ { type : 'CHAR_STRING', name : 'message' } ], + response : { arguments : [] } +}; + +const LogCommands = { + name : 'LogCommands', + commands : [ Log ], +}; + +// +// Module exports +// +exports.LogCommands = LogCommands; diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 5b6277e05bf89a..5c1d467ea89995 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -123,84 +123,6 @@ namespace { app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - {{#chip_client_clusters}} {{#if (chip_server_has_list_attributes)}} {{#chip_server_cluster_attributes}} diff --git a/src/app/zap-templates/templates/app/att-storage.zapt b/src/app/zap-templates/templates/app/att-storage.zapt index ed664f5f20cc7f..b22f1c06b65e6c 100644 --- a/src/app/zap-templates/templates/app/att-storage.zapt +++ b/src/app/zap-templates/templates/app/att-storage.zapt @@ -38,16 +38,3 @@ #define CLUSTER_MASK_SERVER (0x40) // Cluster is a client #define CLUSTER_MASK_CLIENT (0x80) - -// Command masks modify meanings of commands -// -// Is sending of this client command supported -#define COMMAND_MASK_OUTGOING_CLIENT (0x01) -// Is sending of this server command supported -#define COMMAND_MASK_OUTGOING_SERVER (0x02) -// Is receiving of this client command supported -#define COMMAND_MASK_INCOMING_CLIENT (0x04) -// Is receiving of this server command supported -#define COMMAND_MASK_INCOMING_SERVER (0x08) -// Is this command manufacturer specific? -#define COMMAND_MASK_MANUFACTURER_SPECIFIC (0x10) diff --git a/src/app/zap-templates/templates/app/attribute-size-src.zapt b/src/app/zap-templates/templates/app/attribute-size-src.zapt index a842398ef41cb7..d72e66d18e022d 100644 --- a/src/app/zap-templates/templates/app/attribute-size-src.zapt +++ b/src/app/zap-templates/templates/app/attribute-size-src.zapt @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -85,7 +86,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo {{chipType}} * entry = reinterpret_cast<{{chipType}} *>(write ? src : dest); {{#chip_attribute_list_entryTypes}} {{#if (isString type)}} + {{#if (isOctetString type)}} ByteSpan * {{name}}Span = &entry->{{name}}; // {{type}} + {{else}} + ByteSpan {{name}}SpanStorage(Uint8::from_const_char(entry->{{name}}.data()), entry->{{name}}.size()); // {{type}} + ByteSpan * {{name}}Span = &{{name}}SpanStorage; + {{/if}} if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, {{size}}, {{name}}Span) : ReadByteSpan(src + entryOffset, {{size}}, {{name}}Span))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); diff --git a/src/app/zap-templates/templates/app/callback-stub-src.zapt b/src/app/zap-templates/templates/app/callback-stub-src.zapt index caefa5ff45df7f..7938ae2a36c570 100644 --- a/src/app/zap-templates/templates/app/callback-stub-src.zapt +++ b/src/app/zap-templates/templates/app/callback-stub-src.zapt @@ -155,94 +155,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback( return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback( - ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverCommandsGeneratedResponseCallback( - ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverCommandsReceivedResponseCallback( - ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback( - EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message @@ -505,4 +417,3 @@ void __attribute__((weak)) MatterPostAttributeChangeCallback( uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) { } - diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index c17b37e27b8c73..7c1c8e3bb24a33 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -268,80 +268,6 @@ bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::Cluste */ bool emberAfDefaultResponseCallback(chip::ClusterId clusterId, chip::CommandId commandId, EmberAfStatus status); -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool emberAfDiscoverAttributesResponseCallback(chip::ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended); - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool emberAfDiscoverCommandsGeneratedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - chip::CommandId * commandIds, uint16_t commandIdCount); - - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool emberAfDiscoverCommandsReceivedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - chip::CommandId * commandIds, uint16_t commandIdCount); - - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd); - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/src/app/zap-templates/templates/app/endpoint_config.zapt b/src/app/zap-templates/templates/app/endpoint_config.zapt index 8d1a6bb652a1ca..aecf3b6beb3760 100644 --- a/src/app/zap-templates/templates/app/endpoint_config.zapt +++ b/src/app/zap-templates/templates/app/endpoint_config.zapt @@ -81,16 +81,6 @@ // Array of networks supported on each endpoint #define FIXED_NETWORKS {{endpoint_fixed_network_array}} - -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_ ## mask -#define EMBER_AF_GENERATED_COMMAND_COUNT ({{endpoint_command_count}}) -#define GENERATED_COMMANDS {{endpoint_command_list}} - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT ({{endpoint_command_manufacturer_code_count}}) -#define GENERATED_COMMAND_MANUFACTURER_CODES {{endpoint_command_manufacturer_codes}} - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT ({{endpoint_cluster_manufacturer_code_count}}) #define GENERATED_CLUSTER_MANUFACTURER_CODES {{endpoint_cluster_manufacturer_codes}} diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml index d1cae9fa4aebf0..c6a87f87fed805 100644 --- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml @@ -45,7 +45,7 @@ limitations under the License. - + @@ -58,4 +58,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml index 76f4920c7e5eb7..62497c43e0231e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml @@ -19,8 +19,8 @@ limitations under the License. - - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml index 2d43c339c6385c..8d9edde2dc1bc7 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml @@ -67,8 +67,7 @@ limitations under the License. - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml index a7dd293f03a032..b75e94bca0b0c0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml @@ -53,8 +53,8 @@ limitations under the License. - - + + @@ -73,4 +73,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index 47f7b7f5f484ee..7f5aca0a6087ff 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -24,7 +24,7 @@ limitations under the License. - + @@ -108,12 +108,11 @@ limitations under the License. - Response to AddNOC or UpdateNOC commands. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml index 3bbe5761679676..d24e20ce163cb5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml @@ -19,8 +19,7 @@ limitations under the License. - - + @@ -39,4 +38,4 @@ limitations under the License. Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute - \ No newline at end of file + diff --git a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml index ea6e39e239ae60..1fb16d28ab5740 100644 --- a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml @@ -51,6 +51,6 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml index f6eb0eff80f95d..a149f35746ba31 100644 --- a/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml @@ -59,9 +59,9 @@ limitations under the License. - - - + + + @@ -83,4 +83,4 @@ limitations under the License. - \ No newline at end of file + 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 db1ab863be7af1..0fb4e4ef448c15 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/general.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/general.xml @@ -70,20 +70,6 @@ limitations under the License. - - - Command description for DiscoverAttributes - - - - - - - Command description for DiscoverAttributesResponse - - - - Command description for ReadAttributesStructured @@ -102,36 +88,6 @@ limitations under the License. - - This command may be used to discover all commands processed (received) by this cluster, including optional or manufacturer specific commands. - - - - - The discover commands received response command is sent in response to a discover commands received command, and is used to discover which commands a particular cluster can process. - - - - - This command may be used to discover all commands which may be generated (sent) by the cluster, including optional or manufacturer specific commands. - - - - - The discover client commands response command is sent in response to a discover client commands command, and is used to discover which commands a particular cluster supports. - - - - - This command is similar to the discover attributes command, but also includes a field to indicate whether the attribute is readable, writeable or reportable. - - - - - This command is sent in response to a discover attribute extended command and is used to determine if attributes are readable, writable or reportable. - - - Power Configuration diff --git a/src/app/zap-templates/zcl/data-model/silabs/types.xml b/src/app/zap-templates/zcl/data-model/silabs/types.xml index 425b52421129fa..3476d1f6c05945 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/types.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/types.xml @@ -423,15 +423,6 @@ limitations under the License. - - - - - - - - - diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 8fa9d55018e513..93718ecd41f946 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1448,7 +1448,7 @@ void DeviceCommissioner::OnAddNOCFailureResponse(void * context, uint8_t status) } void DeviceCommissioner::OnOperationalCertificateAddResponse(void * context, uint8_t StatusCode, uint8_t FabricIndex, - ByteSpan DebugText) + CharSpan DebugText) { ChipLogProgress(Controller, "Device returned status %d on receiving the NOC", StatusCode); DeviceCommissioner * commissioner = static_cast(context); diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index fad27a7a9bef02..d2e406c536e264 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -645,7 +645,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, /* Callback when adding operational certs to device results in failure */ static void OnAddNOCFailureResponse(void * context, uint8_t status); /* Callback when the device confirms that it has added the operational certificates */ - static void OnOperationalCertificateAddResponse(void * context, uint8_t StatusCode, uint8_t FabricIndex, ByteSpan DebugText); + static void OnOperationalCertificateAddResponse(void * context, uint8_t StatusCode, uint8_t FabricIndex, CharSpan DebugText); /* Callback when the device confirms that it has added the root certificate */ static void OnRootCertSuccessResponse(void * context); diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index 127dc2c271e00e..eb481608cafd1f 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -462,7 +462,8 @@ class CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCall jbyteArray {{asLowerCamelCase name}} = env->NewByteArray(entry.{{asLowerCamelCase name}}.size()); env->SetByteArrayRegion({{asLowerCamelCase name}}, 0, entry.{{asLowerCamelCase name}}.size(), reinterpret_cast(entry.{{asLowerCamelCase name}}.data())); {{else if (isCharString type)}} - // Implement after ByteSpan is emitted instead of uint8_t *. + UtfString {{asLowerCamelCase name}}Str(env, entry.{{asLowerCamelCase name}}); + jstring {{asLowerCamelCase name}}({{asLowerCamelCase name}}Str.jniValue()); {{else}} {{asJniBasicType type}} {{asLowerCamelCase name}} = entry.{{asLowerCamelCase name}}; {{/if}} @@ -481,7 +482,8 @@ class CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCall jbyteArray {{asLowerCamelCase name}} = env->NewByteArray(entry.size()); env->SetByteArrayRegion({{asLowerCamelCase name}}, 0, entry.size(), reinterpret_cast(entry.data())); {{else if (isCharString type)}} - // Implement after ByteSpan is emitted instead of uint8_t * + UtfString {{asLowerCamelCase name}}Str(env, entry); + jstring {{asLowerCamelCase name}}({{asLowerCamelCase name}}Str.jniValue()); {{else}} jclass entryTypeCls; JniReferences::GetInstance().GetClassRef(env, "java/lang/{{asJavaBasicTypeForZclType type true}}", entryTypeCls); diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 18fd47b6c20e57..2b28eeb3ac9e37 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -5059,7 +5059,7 @@ class CHIPOperationalCredentialsClusterNOCResponseCallback env->DeleteGlobalRef(javaCallbackRef); }; - static void CallbackFn(void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText) + static void CallbackFn(void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -5067,7 +5067,7 @@ class CHIPOperationalCredentialsClusterNOCResponseCallback jobject javaCallbackRef; jmethodID javaMethod; CHIPOperationalCredentialsClusterNOCResponseCallback * cppCallback = nullptr; - jbyteArray DebugTextArr; + UtfString DebugTextStr(env, DebugText); VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); @@ -5077,19 +5077,11 @@ class CHIPOperationalCredentialsClusterNOCResponseCallback javaCallbackRef = cppCallback->javaCallbackRef; VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II[B)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IILjava/lang/String;)V", &javaMethod); SuccessOrExit(err); - DebugTextArr = env->NewByteArray(DebugText.size()); - VerifyOrExit(DebugTextArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(DebugTextArr, 0, DebugText.size(), reinterpret_cast(DebugText.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(StatusCode), static_cast(FabricIndex), - DebugTextArr); - - env->DeleteLocalRef(DebugTextArr); + DebugTextStr.jniValue()); exit: if (err != CHIP_NO_ERROR) @@ -6105,7 +6097,7 @@ class CHIPAudioOutputAudioOutputListAttributeCallback : public Callback::Callbac ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$AudioOutputCluster$AudioOutputListAttribute")); JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(II[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(IILjava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find AudioOutputListAttribute constructor")); auto iter = list.begin(); @@ -6114,8 +6106,8 @@ class CHIPAudioOutputAudioOutputListAttributeCallback : public Callback::Callbac auto & entry = iter.GetValue(); jint index = entry.index; jint outputType = entry.outputType; - jbyteArray name = env->NewByteArray(entry.name.size()); - env->SetByteArrayRegion(name, 0, entry.name.size(), reinterpret_cast(entry.name.data())); + UtfString nameStr(env, entry.name); + jstring name(nameStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, index, outputType, name); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create AudioOutputListAttribute object")); @@ -6655,17 +6647,17 @@ class CHIPFixedLabelLabelListAttributeCallback : public Callback::CallbackGetMethodID(attributeClass, "", "([B[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find LabelListAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jbyteArray label = env->NewByteArray(entry.label.size()); - env->SetByteArrayRegion(label, 0, entry.label.size(), reinterpret_cast(entry.label.data())); - jbyteArray value = env->NewByteArray(entry.value.size()); - env->SetByteArrayRegion(value, 0, entry.value.size(), reinterpret_cast(entry.value.data())); + auto & entry = iter.GetValue(); + UtfString labelStr(env, entry.label); + jstring label(labelStr.jniValue()); + UtfString valueStr(env, entry.value); + jstring value(valueStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, label, value); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create LabelListAttribute object")); @@ -6843,15 +6835,15 @@ class CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback Zcl, "Could not find class chip/devicecontroller/ChipClusters$GeneralDiagnosticsCluster$NetworkInterfacesAttribute")); JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "([BZZZ[BI)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/String;ZZZ[BI)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find NetworkInterfacesAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jbyteArray name = env->NewByteArray(entry.name.size()); - env->SetByteArrayRegion(name, 0, entry.name.size(), reinterpret_cast(entry.name.data())); + auto & entry = iter.GetValue(); + UtfString nameStr(env, entry.name); + jstring name(nameStr.jniValue()); jboolean fabricConnected = entry.fabricConnected; jboolean offPremiseServicesReachableIPv4 = entry.offPremiseServicesReachableIPv4; jboolean offPremiseServicesReachableIPv6 = entry.offPremiseServicesReachableIPv6; @@ -7123,20 +7115,19 @@ class CHIPMediaInputMediaInputListAttributeCallback : public Callback::Callback< err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$MediaInputCluster$MediaInputListAttribute")); JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(II[B[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(IILjava/lang/String;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find MediaInputListAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jint index = entry.index; - jint inputType = entry.inputType; - jbyteArray name = env->NewByteArray(entry.name.size()); - env->SetByteArrayRegion(name, 0, entry.name.size(), reinterpret_cast(entry.name.data())); - jbyteArray description = env->NewByteArray(entry.description.size()); - env->SetByteArrayRegion(description, 0, entry.description.size(), - reinterpret_cast(entry.description.data())); + auto & entry = iter.GetValue(); + jint index = entry.index; + jint inputType = entry.inputType; + UtfString nameStr(env, entry.name); + jstring name(nameStr.jniValue()); + UtfString descriptionStr(env, entry.description); + jstring description(descriptionStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, index, inputType, name, description); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create MediaInputListAttribute object")); @@ -7219,7 +7210,7 @@ class CHIPOperationalCredentialsFabricsListAttributeCallback ChipLogError( Zcl, "Could not find class chip/devicecontroller/ChipClusters$OperationalCredentialsCluster$FabricsListAttribute")); JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(I[BIJJ[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(I[BIJJLjava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find FabricsListAttribute constructor")); auto iter = list.begin(); @@ -7230,11 +7221,11 @@ class CHIPOperationalCredentialsFabricsListAttributeCallback jbyteArray rootPublicKey = env->NewByteArray(entry.rootPublicKey.size()); env->SetByteArrayRegion(rootPublicKey, 0, entry.rootPublicKey.size(), reinterpret_cast(entry.rootPublicKey.data())); - jint vendorId = entry.vendorId; - jlong fabricId = entry.fabricId; - jlong nodeId = entry.nodeId; - jbyteArray label = env->NewByteArray(entry.label.size()); - env->SetByteArrayRegion(label, 0, entry.label.size(), reinterpret_cast(entry.label.data())); + jint vendorId = entry.vendorId; + jlong fabricId = entry.fabricId; + jlong nodeId = entry.nodeId; + UtfString labelStr(env, entry.label); + jstring label(labelStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, rootPublicKey, vendorId, fabricId, nodeId, label); @@ -7390,7 +7381,8 @@ class CHIPTvChannelTvChannelListAttributeCallback : public Callback::CallbackGetMethodID(attributeClass, "", "(II[B[B[B)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TvChannelListAttribute constructor")); auto iter = list.begin(); @@ -7399,13 +7391,12 @@ class CHIPTvChannelTvChannelListAttributeCallback : public Callback::CallbackNewByteArray(entry.name.size()); - env->SetByteArrayRegion(name, 0, entry.name.size(), reinterpret_cast(entry.name.data())); - jbyteArray callSign = env->NewByteArray(entry.callSign.size()); - env->SetByteArrayRegion(callSign, 0, entry.callSign.size(), reinterpret_cast(entry.callSign.data())); - jbyteArray affiliateCallSign = env->NewByteArray(entry.affiliateCallSign.size()); - env->SetByteArrayRegion(affiliateCallSign, 0, entry.affiliateCallSign.size(), - reinterpret_cast(entry.affiliateCallSign.data())); + UtfString nameStr(env, entry.name); + jstring name(nameStr.jniValue()); + UtfString callSignStr(env, entry.callSign); + jstring callSign(callSignStr.jniValue()); + UtfString affiliateCallSignStr(env, entry.affiliateCallSign); + jstring affiliateCallSign(affiliateCallSignStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, majorNumber, minorNumber, name, callSign, affiliateCallSign); @@ -7489,7 +7480,7 @@ class CHIPTargetNavigatorTargetNavigatorListAttributeCallback Zcl, "Could not find class chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute")); JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(I[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(ILjava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TargetNavigatorListAttribute constructor")); auto iter = list.begin(); @@ -7497,8 +7488,8 @@ class CHIPTargetNavigatorTargetNavigatorListAttributeCallback { auto & entry = iter.GetValue(); jint identifier = entry.identifier; - jbyteArray name = env->NewByteArray(entry.name.size()); - env->SetByteArrayRegion(name, 0, entry.name.size(), reinterpret_cast(entry.name.data())); + UtfString nameStr(env, entry.name); + jstring name(nameStr.jniValue()); jobject attributeObj = env->NewObject(attributeClass, attributeCtor, identifier, name); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create TargetNavigatorListAttribute object")); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 8de9e892d8ebe2..6b065eddd92444 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -364,9 +364,9 @@ private native void selectOutput( public static class AudioOutputListAttribute { public int index; public int outputType; - public byte[] name; + public String name; - public AudioOutputListAttribute(int index, int outputType, byte[] name) { + public AudioOutputListAttribute(int index, int outputType, String name) { this.index = index; this.outputType = outputType; this.name = name; @@ -2702,10 +2702,10 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public static class LabelListAttribute { - public byte[] label; - public byte[] value; + public String label; + public String value; - public LabelListAttribute(byte[] label, byte[] value) { + public LabelListAttribute(String label, String value) { this.label = label; this.value = value; } @@ -2899,7 +2899,7 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public static class NetworkInterfacesAttribute { - public byte[] name; + public String name; public boolean fabricConnected; public boolean offPremiseServicesReachableIPv4; public boolean offPremiseServicesReachableIPv6; @@ -2907,7 +2907,7 @@ public static class NetworkInterfacesAttribute { public int type; public NetworkInterfacesAttribute( - byte[] name, + String name, boolean fabricConnected, boolean offPremiseServicesReachableIPv4, boolean offPremiseServicesReachableIPv6, @@ -3594,10 +3594,10 @@ private native void selectInput( public static class MediaInputListAttribute { public int index; public int inputType; - public byte[] name; - public byte[] description; + public String name; + public String description; - public MediaInputListAttribute(int index, int inputType, byte[] name, byte[] description) { + public MediaInputListAttribute(int index, int inputType, String name, String description) { this.index = index; this.inputType = inputType; this.name = name; @@ -4551,7 +4551,7 @@ public interface CertificateChainResponseCallback { } public interface NOCResponseCallback { - void onSuccess(int StatusCode, int FabricIndex, byte[] DebugText); + void onSuccess(int StatusCode, int FabricIndex, String DebugText); void onError(Exception error); } @@ -4568,7 +4568,7 @@ public static class FabricsListAttribute { public int vendorId; public long fabricId; public long nodeId; - public byte[] label; + public String label; public FabricsListAttribute( int fabricIndex, @@ -4576,7 +4576,7 @@ public FabricsListAttribute( int vendorId, long fabricId, long nodeId, - byte[] label) { + String label) { this.fabricIndex = fabricIndex; this.rootPublicKey = rootPublicKey; this.vendorId = vendorId; @@ -5369,16 +5369,16 @@ void onSuccess( public static class TvChannelListAttribute { public int majorNumber; public int minorNumber; - public byte[] name; - public byte[] callSign; - public byte[] affiliateCallSign; + public String name; + public String callSign; + public String affiliateCallSign; public TvChannelListAttribute( int majorNumber, int minorNumber, - byte[] name, - byte[] callSign, - byte[] affiliateCallSign) { + String name, + String callSign, + String affiliateCallSign) { this.majorNumber = majorNumber; this.minorNumber = minorNumber; this.name = name; @@ -5449,9 +5449,9 @@ public interface NavigateTargetResponseCallback { public static class TargetNavigatorListAttribute { public int identifier; - public byte[] name; + public String name; - public TargetNavigatorListAttribute(int identifier, byte[] name) { + public TargetNavigatorListAttribute(int identifier, String name) { this.identifier = identifier; this.name = name; } diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 11bdc42ecf4d00..8778d989815c4b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -176,7 +176,7 @@ static void OnAudioOutputAudioOutputListListAttributeResponse( ChipLogProgress(Zcl, " {"); ChipLogProgress(Zcl, " index: %" PRIu8 ",", entry.index); ChipLogProgress(Zcl, " outputType: %" PRIu8 ",", entry.outputType); - ChipLogProgress(Zcl, " name: %s,", ByteSpanToString(entry.name).c_str()); + ChipLogProgress(Zcl, " name: %.*s,", static_cast(entry.name.size()), entry.name.data()); ChipLogProgress(Zcl, " },"); } @@ -464,8 +464,8 @@ static void OnFixedLabelLabelListListAttributeResponse( auto & entry = iter.GetValue(); #endif // CHIP_PROGRESS_LOGGING ChipLogProgress(Zcl, " {"); - ChipLogProgress(Zcl, " label: %s,", ByteSpanToString(entry.label).c_str()); - ChipLogProgress(Zcl, " value: %s,", ByteSpanToString(entry.value).c_str()); + ChipLogProgress(Zcl, " label: %.*s,", static_cast(entry.label.size()), entry.label.data()); + ChipLogProgress(Zcl, " value: %.*s,", static_cast(entry.value.size()), entry.value.data()); ChipLogProgress(Zcl, " },"); } @@ -555,7 +555,7 @@ static void OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse( auto & entry = iter.GetValue(); #endif // CHIP_PROGRESS_LOGGING ChipLogProgress(Zcl, " {"); - ChipLogProgress(Zcl, " Name: %s,", ByteSpanToString(entry.name).c_str()); + ChipLogProgress(Zcl, " Name: %.*s,", static_cast(entry.name.size()), entry.name.data()); ChipLogProgress(Zcl, " FabricConnected: %d,", entry.fabricConnected); ChipLogProgress(Zcl, " OffPremiseServicesReachableIPv4: %d,", entry.offPremiseServicesReachableIPv4); ChipLogProgress(Zcl, " OffPremiseServicesReachableIPv6: %d,", entry.offPremiseServicesReachableIPv6); @@ -699,8 +699,8 @@ static void OnMediaInputMediaInputListListAttributeResponse( ChipLogProgress(Zcl, " {"); ChipLogProgress(Zcl, " index: %" PRIu8 ",", entry.index); ChipLogProgress(Zcl, " inputType: %" PRIu8 ",", entry.inputType); - ChipLogProgress(Zcl, " name: %s,", ByteSpanToString(entry.name).c_str()); - ChipLogProgress(Zcl, " description: %s,", ByteSpanToString(entry.description).c_str()); + ChipLogProgress(Zcl, " name: %.*s,", static_cast(entry.name.size()), entry.name.data()); + ChipLogProgress(Zcl, " description: %.*s,", static_cast(entry.description.size()), entry.description.data()); ChipLogProgress(Zcl, " },"); } @@ -749,7 +749,7 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse( ChipLogProgress(Zcl, " VendorId: %" PRIu16 ",", entry.vendorId); ChipLogProgress(Zcl, " FabricId: %" PRIu64 ",", entry.fabricId); ChipLogProgress(Zcl, " NodeId: %" PRIu64 ",", entry.nodeId); - ChipLogProgress(Zcl, " Label: %s,", ByteSpanToString(entry.label).c_str()); + ChipLogProgress(Zcl, " Label: %.*s,", static_cast(entry.label.size()), entry.label.data()); ChipLogProgress(Zcl, " },"); } @@ -833,9 +833,10 @@ static void OnTvChannelTvChannelListListAttributeResponse( ChipLogProgress(Zcl, " {"); ChipLogProgress(Zcl, " majorNumber: %" PRIu16 ",", entry.majorNumber); ChipLogProgress(Zcl, " minorNumber: %" PRIu16 ",", entry.minorNumber); - ChipLogProgress(Zcl, " name: %s,", ByteSpanToString(entry.name).c_str()); - ChipLogProgress(Zcl, " callSign: %s,", ByteSpanToString(entry.callSign).c_str()); - ChipLogProgress(Zcl, " affiliateCallSign: %s,", ByteSpanToString(entry.affiliateCallSign).c_str()); + ChipLogProgress(Zcl, " name: %.*s,", static_cast(entry.name.size()), entry.name.data()); + ChipLogProgress(Zcl, " callSign: %.*s,", static_cast(entry.callSign.size()), entry.callSign.data()); + ChipLogProgress(Zcl, " affiliateCallSign: %.*s,", static_cast(entry.affiliateCallSign.size()), + entry.affiliateCallSign.data()); ChipLogProgress(Zcl, " },"); } @@ -880,7 +881,7 @@ static void OnTargetNavigatorTargetNavigatorListListAttributeResponse( #endif // CHIP_PROGRESS_LOGGING ChipLogProgress(Zcl, " {"); ChipLogProgress(Zcl, " identifier: %" PRIu8 ",", entry.identifier); - ChipLogProgress(Zcl, " name: %s,", ByteSpanToString(entry.name).c_str()); + ChipLogProgress(Zcl, " name: %.*s,", static_cast(entry.name.size()), entry.name.data()); ChipLogProgress(Zcl, " },"); } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 47fb703f4a85fe..2b7e5330a1941f 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5952,7 +5952,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor( - Label="Name", Tag=0, Type=bytes), + Label="Name", Tag=0, Type=str), ClusterObjectFieldDescriptor( Label="FabricConnected", Tag=1, Type=bool), ClusterObjectFieldDescriptor( @@ -5965,7 +5965,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: Label="Type", Tag=5, Type=GeneralDiagnostics.Enums.InterfaceType), ]) - Name: 'bytes' = None + Name: 'str' = None FabricConnected: 'bool' = None OffPremiseServicesReachableIPv4: 'bool' = None OffPremiseServicesReachableIPv6: 'bool' = None @@ -6118,7 +6118,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="Id", Tag=0, Type=uint), ClusterObjectFieldDescriptor( - Label="Name", Tag=1, Type=bytes), + Label="Name", Tag=1, Type=str), ClusterObjectFieldDescriptor( Label="StackFreeCurrent", Tag=2, Type=uint), ClusterObjectFieldDescriptor( @@ -6128,7 +6128,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) Id: 'uint' = None - Name: 'bytes' = None + Name: 'str' = None StackFreeCurrent: 'uint' = None StackFreeMinimum: 'uint' = None StackSize: 'uint' = None @@ -8119,7 +8119,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="NodeId", Tag=4, Type=uint), ClusterObjectFieldDescriptor( - Label="Label", Tag=5, Type=bytes), + Label="Label", Tag=5, Type=str), ]) FabricIndex: 'uint' = None @@ -8127,7 +8127,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: VendorId: 'uint' = None FabricId: 'uint' = None NodeId: 'uint' = None - Label: 'bytes' = None + Label: 'str' = None @dataclass class NOCStruct(ClusterObject): @@ -8300,12 +8300,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="FabricIndex", Tag=1, Type=uint), ClusterObjectFieldDescriptor( - Label="DebugText", Tag=2, Type=bytes), + Label="DebugText", Tag=2, Type=str), ]) StatusCode: 'uint' = None FabricIndex: 'uint' = None - DebugText: 'bytes' = None + DebugText: 'str' = None @dataclass class UpdateFabricLabel(ClusterCommand): @@ -8459,13 +8459,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor( - Label="Label", Tag=0, Type=bytes), + Label="Label", Tag=0, Type=str), ClusterObjectFieldDescriptor( - Label="Value", Tag=1, Type=bytes), + Label="Value", Tag=1, Type=str), ]) - Label: 'bytes' = None - Value: 'bytes' = None + Label: 'str' = None + Value: 'str' = None class Attributes: class LabelList(ClusterAttributeDescriptor): @@ -17987,18 +17987,18 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="MinorNumber", Tag=1, Type=uint), ClusterObjectFieldDescriptor( - Label="Name", Tag=2, Type=bytes), + Label="Name", Tag=2, Type=str), ClusterObjectFieldDescriptor( - Label="CallSign", Tag=3, Type=bytes), + Label="CallSign", Tag=3, Type=str), ClusterObjectFieldDescriptor( - Label="AffiliateCallSign", Tag=4, Type=bytes), + Label="AffiliateCallSign", Tag=4, Type=str), ]) MajorNumber: 'uint' = None MinorNumber: 'uint' = None - Name: 'bytes' = None - CallSign: 'bytes' = None - AffiliateCallSign: 'bytes' = None + Name: 'str' = None + CallSign: 'str' = None + AffiliateCallSign: 'str' = None @dataclass class TvChannelLineupInfo(ClusterObject): @@ -18175,11 +18175,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="Identifier", Tag=0, Type=uint), ClusterObjectFieldDescriptor( - Label="Name", Tag=1, Type=bytes), + Label="Name", Tag=1, Type=str), ]) Identifier: 'uint' = None - Name: 'bytes' = None + Name: 'str' = None class Commands: @dataclass @@ -18769,15 +18769,15 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="InputType", Tag=1, Type=MediaInput.Enums.MediaInputType), ClusterObjectFieldDescriptor( - Label="Name", Tag=2, Type=bytes), + Label="Name", Tag=2, Type=str), ClusterObjectFieldDescriptor( - Label="Description", Tag=3, Type=bytes), + Label="Description", Tag=3, Type=str), ]) Index: 'uint' = None InputType: 'MediaInput.Enums.MediaInputType' = None - Name: 'bytes' = None - Description: 'bytes' = None + Name: 'str' = None + Description: 'str' = None class Commands: @dataclass @@ -19370,12 +19370,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="OutputType", Tag=1, Type=AudioOutput.Enums.AudioOutputType), ClusterObjectFieldDescriptor( - Label="Name", Tag=2, Type=bytes), + Label="Name", Tag=2, Type=str), ]) Index: 'uint' = None OutputType: 'AudioOutput.Enums.AudioOutputType' = None - Name: 'bytes' = None + Name: 'str' = None class Commands: @dataclass diff --git a/src/controller/python/templates/python-CHIPClusters-cpp.zapt b/src/controller/python/templates/python-CHIPClusters-cpp.zapt index 9d2b7b00f32520..f75cb2feea4717 100644 --- a/src/controller/python/templates/python-CHIPClusters-cpp.zapt +++ b/src/controller/python/templates/python-CHIPClusters-cpp.zapt @@ -122,7 +122,7 @@ static void On{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttri {{#if (isOctetString type)}} ChipLogProgress(Zcl, " {{asSymbol label}}: %s,", ByteSpanToString(entry.{{asLowerCamelCase name}}).c_str()); {{else if (isCharString type)}} - // Currently the generated code emits `uint8_t *` for CHAR_STRING, it needs to emits chip::ByteSpan + ChipLogProgress(Zcl, " {{asSymbol label}}: %.*s,", static_cast(entry.{{asLowerCamelCase name}}.size()), entry.{{asLowerCamelCase name}}.data()); {{else}} ChipLogProgress(Zcl, " {{asSymbol label}}: {{asPrintFormat type}},", entry.{{asLowerCamelCase name}}); {{/if}} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 5be34e1c073063..92f7279b3f13bb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -104,7 +104,7 @@ [array addObject:@ { @"index" : [NSNumber numberWithUnsignedChar:entry.index], @"outputType" : [NSNumber numberWithUnsignedChar:entry.outputType], - @"name" : [NSData dataWithBytes:entry.name.data() length:entry.name.size()], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -228,8 +228,8 @@ while (iter.Next()) { auto & entry = iter.GetValue(); [array addObject:@ { - @"label" : [NSData dataWithBytes:entry.label.data() length:entry.label.size()], - @"value" : [NSData dataWithBytes:entry.value.data() length:entry.value.size()], + @"label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], + @"value" : [[NSString alloc] initWithBytes:entry.value.data() length:entry.value.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -269,7 +269,7 @@ while (iter.Next()) { auto & entry = iter.GetValue(); [array addObject:@ { - @"Name" : [NSData dataWithBytes:entry.name.data() length:entry.name.size()], + @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], @"FabricConnected" : [NSNumber numberWithBool:entry.fabricConnected], @"OffPremiseServicesReachableIPv4" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv4], @"OffPremiseServicesReachableIPv6" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv6], @@ -339,8 +339,10 @@ [array addObject:@ { @"index" : [NSNumber numberWithUnsignedChar:entry.index], @"inputType" : [NSNumber numberWithUnsignedChar:entry.inputType], - @"name" : [NSData dataWithBytes:entry.name.data() length:entry.name.size()], - @"description" : [NSData dataWithBytes:entry.description.data() length:entry.description.size()], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"description" : [[NSString alloc] initWithBytes:entry.description.data() + length:entry.description.size() + encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -365,7 +367,7 @@ @"VendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], @"FabricId" : [NSNumber numberWithUnsignedLongLong:entry.fabricId], @"NodeId" : [NSNumber numberWithUnsignedLongLong:entry.nodeId], - @"Label" : [NSData dataWithBytes:entry.label.data() length:entry.label.size()], + @"Label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -403,9 +405,13 @@ [array addObject:@ { @"majorNumber" : [NSNumber numberWithUnsignedShort:entry.majorNumber], @"minorNumber" : [NSNumber numberWithUnsignedShort:entry.minorNumber], - @"name" : [NSData dataWithBytes:entry.name.data() length:entry.name.size()], - @"callSign" : [NSData dataWithBytes:entry.callSign.data() length:entry.callSign.size()], - @"affiliateCallSign" : [NSData dataWithBytes:entry.affiliateCallSign.data() length:entry.affiliateCallSign.size()], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"callSign" : [[NSString alloc] initWithBytes:entry.callSign.data() + length:entry.callSign.size() + encoding:NSUTF8StringEncoding], + @"affiliateCallSign" : [[NSString alloc] initWithBytes:entry.affiliateCallSign.data() + length:entry.affiliateCallSign.size() + encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -426,7 +432,7 @@ auto & entry = iter.GetValue(); [array addObject:@ { @"identifier" : [NSNumber numberWithUnsignedChar:entry.identifier], - @"name" : [NSData dataWithBytes:entry.name.data() length:entry.name.size()], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -1127,12 +1133,12 @@ }; void CHIPOperationalCredentialsClusterNOCResponseCallbackBridge::OnSuccessFn( - void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText) + void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) { DispatchSuccess(context, @ { @"StatusCode" : [NSNumber numberWithUnsignedChar:StatusCode], @"FabricIndex" : [NSNumber numberWithUnsignedChar:FabricIndex], - @"DebugText" : [NSData dataWithBytes:DebugText.data() length:DebugText.size()], + @"DebugText" : [[NSString alloc] initWithBytes:DebugText.data() length:DebugText.size() encoding:NSUTF8StringEncoding], }); }; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 81f622b7e98749..9a0209d1a840cd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -1142,7 +1142,7 @@ class CHIPOperationalCredentialsClusterNOCResponseCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText); + static void OnSuccessFn(void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText); }; class CHIPOperationalCredentialsClusterOpCSRResponseCallbackBridge diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp index f1a552b7f9f00b..3b1c2cb81b5fd4 100644 --- a/src/inet/InetLayer.cpp +++ b/src/inet/InetLayer.cpp @@ -101,8 +101,6 @@ void InetLayer::UpdateSnapshot(chip::System::Stats::Snapshot & aSnapshot) */ InetLayer::InetLayer() { - State = kState_NotInitialized; - #if CHIP_SYSTEM_CONFIG_USE_LWIP if (!sInetEventHandlerDelegate.IsInitialized()) sInetEventHandlerDelegate.Init(HandleInetLayerEvent); @@ -237,9 +235,7 @@ void InetLayer::DroppableEventDequeued(void) CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) { Inet::RegisterLayerErrorFormatter(); - - if (State != kState_NotInitialized) - return CHIP_ERROR_INCORRECT_STATE; + VerifyOrReturnError(mLayerState.SetInitializing(), CHIP_ERROR_INCORRECT_STATE); // Platform-specific initialization may elect to set this data // member. Ensure it is set to a sane default value before @@ -256,7 +252,7 @@ CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) static_cast(mSystemLayer)->AddEventHandlerDelegate(sInetEventHandlerDelegate); #endif // CHIP_SYSTEM_CONFIG_USE_LWIP - State = kState_Initialized; + mLayerState.SetInitialized(); return CHIP_NO_ERROR; } @@ -271,35 +267,34 @@ CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) */ CHIP_ERROR InetLayer::Shutdown() { + VerifyOrReturnError(mLayerState.SetShuttingDown(), CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - if (State == kState_Initialized) - { #if INET_CONFIG_ENABLE_TCP_ENDPOINT - // Abort all TCP endpoints owned by this instance. - TCPEndPoint::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { - if ((lEndPoint != nullptr) && lEndPoint->IsCreatedByInetLayer(*this)) - { - lEndPoint->Abort(); - } - return true; - }); + // Abort all TCP endpoints owned by this instance. + TCPEndPoint::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { + if ((lEndPoint != nullptr) && lEndPoint->IsCreatedByInetLayer(*this)) + { + lEndPoint->Abort(); + } + return true; + }); #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT #if INET_CONFIG_ENABLE_UDP_ENDPOINT - // Close all UDP endpoints owned by this instance. - UDPEndPoint::sPool.ForEachActiveObject([&](UDPEndPoint * lEndPoint) { - if ((lEndPoint != nullptr) && lEndPoint->IsCreatedByInetLayer(*this)) - { - lEndPoint->Close(); - } - return true; - }); + // Close all UDP endpoints owned by this instance. + UDPEndPoint::sPool.ForEachActiveObject([&](UDPEndPoint * lEndPoint) { + if ((lEndPoint != nullptr) && lEndPoint->IsCreatedByInetLayer(*this)) + { + lEndPoint->Close(); + } + return true; + }); #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT - } - - State = kState_NotInitialized; + mLayerState.SetShutdown(); + mLayerState.Reset(); // Return to uninitialized state to permit re-initialization. return err; } @@ -455,7 +450,7 @@ CHIP_ERROR InetLayer::NewTCPEndPoint(TCPEndPoint ** retEndPoint) *retEndPoint = nullptr; - VerifyOrReturnError(State == kState_Initialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); *retEndPoint = TCPEndPoint::sPool.TryCreate(); if (*retEndPoint == nullptr) @@ -495,7 +490,7 @@ CHIP_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint) *retEndPoint = nullptr; - VerifyOrReturnError(State == kState_Initialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); *retEndPoint = UDPEndPoint::sPool.TryCreate(); if (*retEndPoint == nullptr) diff --git a/src/inet/InetLayer.h b/src/inet/InetLayer.h index d48f64c483eab1..052353b532d677 100644 --- a/src/inet/InetLayer.h +++ b/src/inet/InetLayer.h @@ -69,6 +69,7 @@ #include #include +#include #if INET_CONFIG_MAX_DROPPABLE_EVENTS @@ -124,16 +125,6 @@ class DLL_EXPORT InetLayer #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT public: - /** - * The current state of the InetLayer object. - * - */ - volatile enum { - kState_NotInitialized = 0, /**< Not initialized state. */ - kState_Initialized = 1, /**< Initialized state. */ - kState_ShutdownInProgress = 2, /**< State where Shutdown has been triggered. */ - } State; /**< [READ-ONLY] Current state. */ - InetLayer(); CHIP_ERROR Init(chip::System::Layer & aSystemLayer, void * aContext); @@ -224,6 +215,7 @@ class DLL_EXPORT InetLayer #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0 private: + ObjectLifeCycle mLayerState; void * mContext; void * mPlatformData; chip::System::Layer * mSystemLayer; diff --git a/src/lib/support/ObjectLifeCycle.h b/src/lib/support/ObjectLifeCycle.h index f86f41b00e4d26..b2a8f2ff85558b 100644 --- a/src/lib/support/ObjectLifeCycle.h +++ b/src/lib/support/ObjectLifeCycle.h @@ -26,75 +26,55 @@ namespace chip { * Track the life cycle of an object. * *
- *                  ┌───────────────┐  Init  ┌─────────────┐  Shutdown  ┌──────────┐  Destroy  ┌───────────┐
- * Construction ───>│ Uninitialized ├───────>│ Initialized ├───────────>│ Shutdown ├──────────>│ Destroyed │
- *                  └──────────┬────┘        └─────────────┘            └─────┬────┘           └───────────┘
- *                      ^      │                               Reset          │
- *                      └──────┴<─────────────────────────────────────────────┘
+ *
+ *      Construction
+ *          ↓
+ *      Uninitialized ‹─┐
+ *          ↓           │
+ *      Initializing    │
+ *          ↓           │
+ *      Initialized     │
+ *          ↓           │
+ *      ShuttingDown    │
+ *          ↓           │
+ *      Shutdown ───────┘
+ *          ↓
+ *      Destroyed
+ *
  * 
*/ -struct ObjectLifeCycle +class ObjectLifeCycle { - /** - * @returns true if and only if the object is in the Initialized state. - */ - bool IsInitialized() const { return mState == State::Initialized; } - - /** - * Transition from Uninitialized to Initialized. - * - * Typical use is `VerifyOrReturnError(state.Init(), CHIP_ERROR_INCORRECT_STATE)`; this function returns `bool` rather than - * a `CHIP_ERROR` so that error source tracking will record the call point rather than this function itself. - * - * @return true if the state was Uninitialized and is now Initialized. - * @return false otherwise. - */ - bool Init() +public: + enum class State : uint8_t { - if (mState == State::Uninitialized) - { - mState = State::Initialized; - return true; - } - return false; - } + Uninitialized = 0, ///< Pre-initialized state. + Initializing = 1, ///< State during intialization. + Initialized = 2, ///< Initialized (active) state. + ShuttingDown = 3, ///< State during shutdown. + Shutdown = 4, ///< Post-shutdown state. + Destroyed = 5, ///< Post-destructor state. + }; + + ObjectLifeCycle() : mState(State::Uninitialized) {} + ~ObjectLifeCycle() { mState = State::Destroyed; } /** - * Transition from Initialized to Shutdown. - * - * Typical use is `VerifyOrReturnError(state.Shutdown(), CHIP_ERROR_INCORRECT_STATE)`; this function returns `bool` rather than - * a `CHIP_ERROR` so that error source tracking will record the call point rather than this function itself. - * - * @return true if the state was Initialized and is now Shutdown. - * @return false otherwise. + * @returns true if and only if the object is in the Initialized state. */ - bool Shutdown() - { - if (mState == State::Initialized) - { - mState = State::Shutdown; - return true; - } - return false; - } + bool IsInitialized() const { return mState == State::Initialized; } - /** - * Transition from Shutdown back to Uninitialized, or remain Uninitialized. - * - * Typical use is `VerifyOrReturnError(state.Reset(), CHIP_ERROR_INCORRECT_STATE)`; this function returns `bool` rather than - * a `CHIP_ERROR` so that error source tracking will record the call point rather than this function itself. + /* + * State transitions. * - * @return true if the state was Uninitialized or Shutdown and is now Uninitialized. - * @return false otherwise. + * Typical use is `VerifyOrReturnError(state.SetInitializing(), CHIP_ERROR_INCORRECT_STATE)`; these functions return `bool` + * rather than a `CHIP_ERROR` so that error source tracking will record the call point rather than this function itself. */ - bool Reset() - { - if (mState == State::Shutdown) - { - mState = State::Uninitialized; - } - return mState == State::Uninitialized; - } + bool SetInitializing() { return Transition(); } + bool SetInitialized() { return Transition(); } + bool SetShuttingDown() { return Transition(); } + bool SetShutdown() { return Transition(); } + bool Reset() { return Transition(); } /** * Transition from Uninitialized or Shutdown to Destroyed. @@ -115,21 +95,21 @@ struct ObjectLifeCycle return false; } - /** - * Return the current state as an integer. This is intended for troubleshooting or logging, since there is no code access to - * the meaning of the integer value. - */ - explicit operator int() const { return static_cast(mState); } + State GetState() const { return mState; } private: - enum class State : uint8_t + template + bool Transition() { - Uninitialized = 0, /**< Pre-initialized state; */ - Initialized = 1, /**< Initialized state. */ - Shutdown = 2, /**< Post-Shutdown state. */ - Destroyed = 3, /**< Post-destructor state. */ - }; - State mState = State::Uninitialized; + if (mState == FROM) + { + mState = TO; + return true; + } + return false; + } + + State mState; }; } // namespace chip diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index b3814d72937fa4..0b9822534560ca 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -57,6 +57,7 @@ ConfigurationManagerImpl ConfigurationManagerImpl::sInstance; CHIP_ERROR ConfigurationManagerImpl::_Init() { CHIP_ERROR err; + uint32_t rebootCount; bool failSafeArmed; // Force initialization of NVS namespaces if they doesn't already exist. @@ -67,6 +68,27 @@ CHIP_ERROR ConfigurationManagerImpl::_Init() err = EnsureNamespace(kConfigNamespace_ChipCounters); SuccessOrExit(err); + if (ConfigValueExists(kCounterKey_RebootCount)) + { + err = GetRebootCount(rebootCount); + SuccessOrExit(err); + + err = StoreRebootCount(rebootCount + 1); + SuccessOrExit(err); + } + else + { + // The first boot after factory reset of the Node. + err = StoreRebootCount(1); + SuccessOrExit(err); + } + + if (!ConfigValueExists(kCounterKey_TotalOperationalHours)) + { + err = StoreTotalOperationalHours(0); + SuccessOrExit(err); + } + // Initialize the generic implementation base class. err = Internal::GenericConfigurationManagerImpl::_Init(); SuccessOrExit(err); @@ -100,6 +122,26 @@ CHIP_ERROR ConfigurationManagerImpl::_Init() return err; } +CHIP_ERROR ConfigurationManagerImpl::GetRebootCount(uint32_t & rebootCount) +{ + return ReadConfigValue(kCounterKey_RebootCount, rebootCount); +} + +CHIP_ERROR ConfigurationManagerImpl::StoreRebootCount(uint32_t rebootCount) +{ + return WriteConfigValue(kCounterKey_RebootCount, rebootCount); +} + +CHIP_ERROR ConfigurationManagerImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + return ReadConfigValue(kCounterKey_TotalOperationalHours, totalOperationalHours); +} + +CHIP_ERROR ConfigurationManagerImpl::StoreTotalOperationalHours(uint32_t totalOperationalHours) +{ + return WriteConfigValue(kCounterKey_TotalOperationalHours, totalOperationalHours); +} + CHIP_ERROR ConfigurationManagerImpl::_GetPrimaryWiFiMACAddress(uint8_t * buf) { #if CHIP_DEVICE_CONFIG_ENABLE_WIFI diff --git a/src/platform/ESP32/ConfigurationManagerImpl.h b/src/platform/ESP32/ConfigurationManagerImpl.h index 6dc1adc7617de1..ca46c1d36fa699 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.h +++ b/src/platform/ESP32/ConfigurationManagerImpl.h @@ -50,6 +50,13 @@ class ConfigurationManagerImpl final : public ConfigurationManager, #endif private Internal::ESP32Config { +public: + CHIP_ERROR GetRebootCount(uint32_t & rebootCount); + CHIP_ERROR StoreRebootCount(uint32_t rebootCount); + CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours); + CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours); + +private: // Allow the ConfigurationManager interface class to delegate method calls to // the implementation methods provided by this class. friend class ConfigurationManager; @@ -60,7 +67,6 @@ class ConfigurationManagerImpl final : public ConfigurationManager, friend class Internal::GenericConfigurationManagerImpl; #endif -private: // ===== Members that implement the ConfigurationManager public interface. CHIP_ERROR _Init(void); diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 7a9a3e61dd9fdf..136097c0b5e02f 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -73,6 +73,11 @@ const ESP32Config::Key ESP32Config::kConfigKey_RegulatoryLocation = { kConfigNam const ESP32Config::Key ESP32Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; const ESP32Config::Key ESP32Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; +// Keys stored in the Chip-counters namespace +const ESP32Config::Key ESP32Config::kCounterKey_RebootCount = { kConfigNamespace_ChipCounters, "reboot-count" }; +const ESP32Config::Key ESP32Config::kCounterKey_UpTime = { kConfigNamespace_ChipCounters, "up-time" }; +const ESP32Config::Key ESP32Config::kCounterKey_TotalOperationalHours = { kConfigNamespace_ChipCounters, "total-hours" }; + // Prefix used for NVS keys that contain Chip group encryption keys. const char ESP32Config::kGroupKeyNamePrefix[] = "gk-"; diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index ec1e1a00e2b5d9..face2c0f37e1ba 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -74,6 +74,9 @@ class ESP32Config static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; static const Key kConfigKey_Breadcrumb; + static const Key kCounterKey_RebootCount; + static const Key kCounterKey_UpTime; + static const Key kCounterKey_TotalOperationalHours; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index d9666da4e26f60..bbcbe8f3330739 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -25,6 +25,7 @@ /* this file behaves like a config.h, comes first */ #include +#include #include #include #include @@ -85,6 +86,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); + mStartTimeMilliseconds = System::SystemClock().GetMonotonicMilliseconds(); // Initialize the ESP WiFi layer. cfg = WIFI_INIT_CONFIG_DEFAULT(); @@ -118,6 +120,31 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) return chip::DeviceLayer::Internal::ESP32Utils::MapError(err); } +CHIP_ERROR PlatformManagerImpl::_Shutdown() +{ + uint64_t upTime = 0; + + if (_GetUpTime(upTime) == CHIP_NO_ERROR) + { + uint32_t totalOperationalHours = 0; + + if (ConfigurationMgrImpl().GetTotalOperationalHours(totalOperationalHours) == CHIP_NO_ERROR) + { + ConfigurationMgrImpl().StoreTotalOperationalHours(totalOperationalHours + static_cast(upTime / 3600)); + } + else + { + ChipLogError(DeviceLayer, "Failed to get total operational hours of the Node"); + } + } + else + { + ChipLogError(DeviceLayer, "Failed to get current uptime since the Node’s last reboot"); + } + + return Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); +} + CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapFree(uint64_t & currentHeapFree) { currentHeapFree = esp_get_free_heap_size(); @@ -136,6 +163,81 @@ CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapHighWatermark(uint64_t & currentH return CHIP_NO_ERROR; } +CHIP_ERROR PlatformManagerImpl::_GetRebootCount(uint16_t & rebootCount) +{ + uint32_t count = 0; + + CHIP_ERROR err = ConfigurationMgrImpl().GetRebootCount(count); + + if (err == CHIP_NO_ERROR) + { + VerifyOrReturnError(count <= UINT16_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE); + rebootCount = static_cast(count); + } + + return err; +} + +CHIP_ERROR PlatformManagerImpl::_GetUpTime(uint64_t & upTime) +{ + uint64_t currentTimeMilliseconds = System::SystemClock().GetMonotonicMilliseconds(); + + if (currentTimeMilliseconds >= mStartTimeMilliseconds) + { + upTime = (currentTimeMilliseconds - mStartTimeMilliseconds) / 1000; + return CHIP_NO_ERROR; + } + + return CHIP_ERROR_INVALID_TIME; +} + +CHIP_ERROR PlatformManagerImpl::_GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + uint64_t upTime = 0; + + if (_GetUpTime(upTime) == CHIP_NO_ERROR) + { + uint32_t totalHours = 0; + if (ConfigurationMgrImpl().GetTotalOperationalHours(totalHours) == CHIP_NO_ERROR) + { + VerifyOrReturnError(upTime / 3600 <= UINT32_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE); + totalOperationalHours = totalHours + static_cast(upTime / 3600); + return CHIP_NO_ERROR; + } + } + + return CHIP_ERROR_INVALID_TIME; +} + +CHIP_ERROR PlatformManagerImpl::_GetBootReasons(uint8_t & bootReason) +{ + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_UNSPECIFIED; + uint8_t reason; + reason = static_cast(esp_reset_reason()); + if (reason == ESP_RST_UNKNOWN) + { + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_UNSPECIFIED; + } + else if (reason == ESP_RST_POWERON) + { + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_POWER_ON_REBOOT; + } + else if (reason == ESP_RST_BROWNOUT) + { + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_BROWN_OUT_RESET; + } + else if (reason == ESP_RST_SW) + { + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_SOFTWARE_RESET; + } + else if (reason == ESP_RST_INT_WDT) + { + bootReason = EMBER_ZCL_BOOT_REASON_TYPE_SOFTWARE_WATCHDOG_RESET; + /* Reboot can be due to hardware or software watchdog*/ + } + return CHIP_NO_ERROR; +} + CHIP_ERROR PlatformManagerImpl::InitLwIPCoreLock(void) { return Internal::InitLwIPCoreLock(); diff --git a/src/platform/ESP32/PlatformManagerImpl.h b/src/platform/ESP32/PlatformManagerImpl.h index 6ee09023f11fb1..c316fca8e0f9f0 100644 --- a/src/platform/ESP32/PlatformManagerImpl.h +++ b/src/platform/ESP32/PlatformManagerImpl.h @@ -55,15 +55,22 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // ===== Methods that implement the PlatformManager abstract interface. CHIP_ERROR _InitChipStack(void); + CHIP_ERROR _Shutdown(); CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); + CHIP_ERROR _GetUpTime(uint64_t & upTime); + CHIP_ERROR _GetTotalOperationalHours(uint32_t & totalOperationalHours); + CHIP_ERROR _GetBootReasons(uint8_t & bootReasons); // ===== Members for internal use by the following friends. friend PlatformManager & PlatformMgr(void); friend PlatformManagerImpl & PlatformMgrImpl(void); + uint64_t mStartTimeMilliseconds = 0; + static PlatformManagerImpl sInstance; }; diff --git a/src/system/SystemLayerImplLibevent.cpp b/src/system/SystemLayerImplLibevent.cpp index 23fb3c61d0eb0a..282039490ed4b0 100644 --- a/src/system/SystemLayerImplLibevent.cpp +++ b/src/system/SystemLayerImplLibevent.cpp @@ -55,7 +55,7 @@ System::SocketEvents SocketEventsFromLibeventFlags(short eventFlags) CHIP_ERROR LayerImplLibevent::Init(System::Layer & systemLayer) { - VerifyOrReturnError(!mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitializing(), CHIP_ERROR_INCORRECT_STATE); RegisterPOSIXErrorFormatter(); @@ -83,7 +83,7 @@ CHIP_ERROR LayerImplLibevent::Init(System::Layer & systemLayer) Mutex::Init(mTimerListMutex); - VerifyOrReturnError(mLayerState.Init(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitialized(), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } @@ -111,7 +111,7 @@ void LayerImplLibevent::MdnsTimeoutCallbackHandler() CHIP_ERROR LayerImplLibevent::Shutdown() { - VerifyOrReturnError(mLayerState.Shutdown(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetShuttingDown(), CHIP_ERROR_INCORRECT_STATE); event_base_loopbreak(mEventBase); @@ -133,6 +133,7 @@ CHIP_ERROR LayerImplLibevent::Shutdown() mEventBase = nullptr; mSystemLayer = nullptr; + mLayerState.SetShutdown(); mLayerState.Reset(); // Return to uninitialized state to permit re-initialization. return CHIP_NO_ERROR; } diff --git a/src/system/SystemLayerImplLibevent.h b/src/system/SystemLayerImplLibevent.h index b0472e3fc4df5e..c013d730ee80d4 100644 --- a/src/system/SystemLayerImplLibevent.h +++ b/src/system/SystemLayerImplLibevent.h @@ -44,7 +44,7 @@ class LayerImplLibevent : public LayerSocketsLoop { public: LayerImplLibevent() : mEventBase(nullptr), mMdnsTimeoutEvent(nullptr) {} - ~LayerImplLibevent() { mLayerState.Destroy(); } + ~LayerImplLibevent() = default; // Layer overrides. CHIP_ERROR Init() override; diff --git a/src/system/SystemLayerImplLwIP.cpp b/src/system/SystemLayerImplLwIP.cpp index 792239a1b93ced..ac4e6e71223c70 100644 --- a/src/system/SystemLayerImplLwIP.cpp +++ b/src/system/SystemLayerImplLwIP.cpp @@ -34,19 +34,20 @@ LayerImplLwIP::LayerImplLwIP() : mHandlingTimerComplete(false), mEventDelegateLi CHIP_ERROR LayerImplLwIP::Init() { - VerifyOrReturnError(!mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitializing(), CHIP_ERROR_INCORRECT_STATE); RegisterLwIPErrorFormatter(); ReturnErrorOnFailure(mTimerList.Init()); - VerifyOrReturnError(mLayerState.Init(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitialized(), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } CHIP_ERROR LayerImplLwIP::Shutdown() { - VerifyOrReturnError(mLayerState.Shutdown(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetShuttingDown(), CHIP_ERROR_INCORRECT_STATE); + mLayerState.SetShutdown(); mLayerState.Reset(); // Return to uninitialized state to permit re-initialization. return CHIP_NO_ERROR; } diff --git a/src/system/SystemLayerImplLwIP.h b/src/system/SystemLayerImplLwIP.h index f95e8c8de6f387..4ff2686d4e597e 100644 --- a/src/system/SystemLayerImplLwIP.h +++ b/src/system/SystemLayerImplLwIP.h @@ -32,7 +32,7 @@ class LayerImplLwIP : public LayerLwIP { public: LayerImplLwIP(); - ~LayerImplLwIP() { mLayerState.Destroy(); } + ~LayerImplLwIP() = default; // Layer overrides. CHIP_ERROR Init() override; diff --git a/src/system/SystemLayerImplSelect.cpp b/src/system/SystemLayerImplSelect.cpp index 373dcdfa0ddc0f..0a7e783b339d7a 100644 --- a/src/system/SystemLayerImplSelect.cpp +++ b/src/system/SystemLayerImplSelect.cpp @@ -42,7 +42,7 @@ constexpr Clock::Seconds64 kDefaultMinSleepPeriod{ 60 * 60 * 24 * 30 }; // Month CHIP_ERROR LayerImplSelect::Init() { - VerifyOrReturnError(!mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitializing(), CHIP_ERROR_INCORRECT_STATE); RegisterPOSIXErrorFormatter(); @@ -60,13 +60,13 @@ CHIP_ERROR LayerImplSelect::Init() // Create an event to allow an arbitrary thread to wake the thread in the select loop. ReturnErrorOnFailure(mWakeEvent.Open(*this)); - VerifyOrReturnError(mLayerState.Init(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetInitialized(), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } CHIP_ERROR LayerImplSelect::Shutdown() { - VerifyOrReturnError(mLayerState.Shutdown(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mLayerState.SetShuttingDown(), CHIP_ERROR_INCORRECT_STATE); Timer * timer; while ((timer = mTimerList.PopEarliest()) != nullptr) @@ -84,6 +84,8 @@ CHIP_ERROR LayerImplSelect::Shutdown() timer->Release(); } mWakeEvent.Close(*this); + + mLayerState.SetShutdown(); mLayerState.Reset(); // Return to uninitialized state to permit re-initialization. return CHIP_NO_ERROR; } diff --git a/src/system/SystemLayerImplSelect.h b/src/system/SystemLayerImplSelect.h index f7ce40c41ea5ac..d079d8c56b9f43 100644 --- a/src/system/SystemLayerImplSelect.h +++ b/src/system/SystemLayerImplSelect.h @@ -39,8 +39,8 @@ namespace System { class LayerImplSelect : public LayerSocketsLoop { public: - LayerImplSelect() = default; - ~LayerImplSelect() { mLayerState.Destroy(); } + LayerImplSelect() = default; + ~LayerImplSelect() = default; // Layer overrides. CHIP_ERROR Init() override; diff --git a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp index 99869a59f8c7f7..c317be238e49ec 100644 --- a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -117,8 +118,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->outputType)); // AudioOutputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { @@ -255,15 +257,17 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _LabelStruct _LabelStruct * entry = reinterpret_cast<_LabelStruct *>(write ? src : dest); - ByteSpan * labelSpan = &entry->label; // OCTET_STRING + ByteSpan labelSpanStorage(Uint8::from_const_char(entry->label.data()), entry->label.size()); // CHAR_STRING + ByteSpan * labelSpan = &labelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, labelSpan) : ReadByteSpan(src + entryOffset, 18, labelSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 18); - ByteSpan * valueSpan = &entry->value; // OCTET_STRING + entryOffset = static_cast(entryOffset + 18); + ByteSpan valueSpanStorage(Uint8::from_const_char(entry->value.data()), entry->value.size()); // CHAR_STRING + ByteSpan * valueSpan = &valueSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, valueSpan) : ReadByteSpan(src + entryOffset, 18, valueSpan))) { @@ -316,7 +320,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -426,16 +431,19 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->inputType)); // MediaInputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * descriptionSpan = &entry->description; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), + entry->description.size()); // CHAR_STRING + ByteSpan * descriptionSpan = &descriptionSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) @@ -481,8 +489,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { @@ -561,24 +570,28 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, &entryOffset, sizeof(entry->majorNumber)); // INT16U copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->minorNumber)); // INT16U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * callSignSpan = &entry->callSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING + ByteSpan * callSignSpan = &callSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * affiliateCallSignSpan = &entry->affiliateCallSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), + entry->affiliateCallSign.size()); // CHAR_STRING + ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) @@ -609,8 +622,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo // Struct _NavigateTargetTargetInfo _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->identifier)); // INT8U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { diff --git a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp index 6138f8b2e11b2f..fa3881427262d3 100644 --- a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp @@ -588,92 +588,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index e6f38db497e4c6..309ac68578d2a7 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -3198,324 +3198,6 @@ 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (227) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Identify (server) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0035, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0036, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - \ - /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroup */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddGroupResponse */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewGroup */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewGroupResponse */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetGroupMembership */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetGroupMembershipResponse */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveGroup */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveGroupResponse */ \ - { 0x0004, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllGroups */ \ - { 0x0004, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroupIfIdentifying */ \ - \ - /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddScene */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddSceneResponse */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewScene */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewSceneResponse */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveScene */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveSceneResponse */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllScenes */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveAllScenesResponse */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StoreScene */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StoreSceneResponse */ \ - { 0x0005, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RecallScene */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSceneMembership */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSceneMembershipResponse */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0039, 0x00, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StartUp */ \ - { 0x0039, 0x01, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ShutDown */ \ - { 0x0039, 0x02, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Leave */ \ - { 0x0039, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ReachableChanged */ \ - \ - /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LockDoor */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LockDoorResponse */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UnlockDoor */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UnlockDoorResponse */ \ - { 0x0101, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UnlockWithTimeout */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetLogRecord */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetPin */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetPin */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearPin */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllPins */ \ - { 0x0101, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetWeekdaySchedule */ \ - { 0x0101, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetWeekdaySchedule */ \ - { 0x0101, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearWeekdaySchedule */ \ - { 0x0101, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetYeardaySchedule */ \ - { 0x0101, 0x0F, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetYeardaySchedule */ \ - { 0x0101, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearYeardaySchedule */ \ - { 0x0101, 0x11, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetHolidaySchedule */ \ - { 0x0101, 0x12, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetHolidaySchedule */ \ - { 0x0101, 0x13, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearHolidaySchedule */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetUserType */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetUserType */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRfid */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetRfid */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearRfid */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllRfids */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, 0 }, /* GoToLiftValue */ \ - { 0x0102, 0x05, 0 }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, 0 }, /* GoToTiltValue */ \ - { 0x0102, 0x08, 0 }, /* GoToTiltPercentage */ \ - \ - /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlGoToPercent */ \ - { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlStop */ \ - \ - /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetpointRaiseLower */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CurrentWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RelayStatusLog */ \ - { 0x0201, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetWeeklySchedule */ \ - { 0x0201, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ClearWeeklySchedule */ \ - { 0x0201, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetRelayStatusLog */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x40, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveToHue */ \ - { 0x0300, 0x41, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveHue */ \ - { 0x0300, 0x42, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedStepHue */ \ - { 0x0300, 0x43, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveToHueAndSaturation */ \ - { 0x0300, 0x44, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ColorLoopSet */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ZoneEnrollResponse */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneStatusChangeNotification */ \ - { 0x0500, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneEnrollRequest */ \ - \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannel */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ChangeChannelResponse */ \ - { 0x0504, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannelByNumber */ \ - { 0x0504, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SkipChannel */ \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NavigateTarget */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NavigateTargetResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPlay */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPlayResponse */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPause */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPauseResponse */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStop */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStopResponse */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStartOver */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStartOverResponse */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPrevious */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPreviousResponse */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaNext */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaNextResponse */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaRewind */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaRewindResponse */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaFastForward */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaFastForwardResponse */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipForward */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \ - { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ - { 0x0506, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSeekResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ - { 0x0507, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ShowInputStatus */ \ - { 0x0507, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* HideInputStatus */ \ - { 0x0507, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameInput */ \ - \ - /* Endpoint: 1, Cluster: Low Power (server) */ \ - { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ - \ - /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x050B, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectOutput */ \ - { 0x050B, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameOutput */ \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ - \ - /* Endpoint: 1, Cluster: Account Login (server) */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ - { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ - \ - /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestAddArgumentsResponse */ \ - { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ - { 0x050F, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestAddArguments */ \ - { 0x050F, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestListInt8UReverseResponse */ \ - { 0x050F, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestStructArgumentRequest */ \ - { 0x050F, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNestedStructArgumentRequest */ \ - { 0x050F, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListStructArgumentRequest */ \ - { 0x050F, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListInt8UArgumentRequest */ \ - { 0x050F, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNestedStructListArgumentRequest */ \ - { 0x050F, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListNestedStructListArgumentRequest */ \ - { 0x050F, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListInt8UReverseRequest */ \ - \ - /* Endpoint: 1, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 2, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 6, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index eb3f49d9b71f66..c8fe0aec8c193e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -92,7 +92,7 @@ typedef struct _AudioOutputInfo { uint8_t index; uint8_t outputType; - chip::ByteSpan name; + chip::CharSpan name; } AudioOutputInfo; // Struct for BasicCommissioningInfoType @@ -149,21 +149,6 @@ typedef struct _DeviceType uint16_t revision; } DeviceType; -// Struct for DiscoverAttributesInfoRecord -typedef struct _DiscoverAttributesInfoRecord -{ - chip::AttributeId attributeId; - uint8_t attributeType; -} DiscoverAttributesInfoRecord; - -// Struct for ExtendedDiscoverAttributesInfoRecord -typedef struct _ExtendedDiscoverAttributesInfoRecord -{ - chip::AttributeId attributeId; - uint8_t attributeType; - uint8_t attributeAccessControl; -} ExtendedDiscoverAttributesInfoRecord; - // Struct for FabricDescriptor typedef struct _FabricDescriptor { @@ -172,7 +157,7 @@ typedef struct _FabricDescriptor uint16_t VendorId; chip::FabricId FabricId; chip::NodeId NodeId; - chip::ByteSpan Label; + chip::CharSpan Label; } FabricDescriptor; // Struct for GroupKey @@ -203,8 +188,8 @@ typedef struct _IasAceZoneStatusResult // Struct for LabelStruct typedef struct _LabelStruct { - chip::ByteSpan label; - chip::ByteSpan value; + chip::CharSpan label; + chip::CharSpan value; } LabelStruct; // Struct for MediaInputInfo @@ -212,8 +197,8 @@ typedef struct _MediaInputInfo { uint8_t index; uint8_t inputType; - chip::ByteSpan name; - chip::ByteSpan description; + chip::CharSpan name; + chip::CharSpan description; } MediaInputInfo; // Struct for MediaPlaybackPosition @@ -234,7 +219,7 @@ typedef struct _NOCStruct typedef struct _NavigateTargetTargetInfo { uint8_t identifier; - chip::ByteSpan name; + chip::CharSpan name; } NavigateTargetTargetInfo; // Struct for NeighborTable @@ -259,7 +244,7 @@ typedef struct _NeighborTable // Struct for NetworkInterfaceType typedef struct _NetworkInterfaceType { - chip::ByteSpan Name; + chip::CharSpan Name; bool FabricConnected; bool OffPremiseServicesReachableIPv4; bool OffPremiseServicesReachableIPv6; @@ -378,7 +363,7 @@ typedef struct _ThreadInterfaceScanResult typedef struct _ThreadMetrics { uint64_t Id; - chip::ByteSpan Name; + chip::CharSpan Name; uint32_t StackFreeCurrent; uint32_t StackFreeMinimum; uint32_t StackSize; @@ -400,9 +385,9 @@ typedef struct _TvChannelInfo { uint16_t majorNumber; uint16_t minorNumber; - chip::ByteSpan name; - chip::ByteSpan callSign; - chip::ByteSpan affiliateCallSign; + chip::CharSpan name; + chip::CharSpan callSign; + chip::CharSpan affiliateCallSign; } TvChannelInfo; // Struct for TvChannelLineupInfo diff --git a/zzz_generated/app-common/app-common/zap-generated/att-storage.h b/zzz_generated/app-common/app-common/zap-generated/att-storage.h index bd817b76cb7b89..203303ada3641f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/att-storage.h +++ b/zzz_generated/app-common/app-common/zap-generated/att-storage.h @@ -55,16 +55,3 @@ #define CLUSTER_MASK_SERVER (0x40) // Cluster is a client #define CLUSTER_MASK_CLIENT (0x80) - -// Command masks modify meanings of commands -// -// Is sending of this client command supported -#define COMMAND_MASK_OUTGOING_CLIENT (0x01) -// Is sending of this server command supported -#define COMMAND_MASK_OUTGOING_SERVER (0x02) -// Is receiving of this client command supported -#define COMMAND_MASK_INCOMING_CLIENT (0x04) -// Is receiving of this server command supported -#define COMMAND_MASK_INCOMING_SERVER (0x08) -// Is this command manufacturer specific? -#define COMMAND_MASK_MANUFACTURER_SPECIFIC (0x10) diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 3da6c70990da7d..5906cf4051eaa7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -12867,7 +12867,7 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback( * @brief Operational Credentials Cluster NOCResponse Command callback (from server) */ bool emberAfOperationalCredentialsClusterNOCResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText); + uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText); /** * @brief Operational Credentials Cluster UpdateFabricLabel Command callback (from client) */ @@ -14194,78 +14194,6 @@ bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::Cluste */ bool emberAfDefaultResponseCallback(chip::ClusterId clusterId, chip::CommandId commandId, EmberAfStatus status); -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool emberAfDiscoverAttributesResponseCallback(chip::ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, uint16_t bufLen, - bool extended); - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool emberAfDiscoverCommandsGeneratedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - chip::CommandId * commandIds, uint16_t commandIdCount); - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool emberAfDiscoverCommandsReceivedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - chip::CommandId * commandIds, uint16_t commandIdCount); - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd); - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 7c7e9f7a6ca059..59f273371bb149 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -6719,7 +6719,7 @@ enum class Fields struct Type { public: - chip::ByteSpan name; + chip::CharSpan name; bool fabricConnected; bool offPremiseServicesReachableIPv4; bool offPremiseServicesReachableIPv6; @@ -6835,7 +6835,7 @@ struct Type { public: uint64_t id; - chip::ByteSpan name; + chip::CharSpan name; uint32_t stackFreeCurrent; uint32_t stackFreeMinimum; uint32_t stackSize; @@ -8526,7 +8526,7 @@ struct Type uint16_t vendorId; chip::FabricId fabricId; chip::NodeId nodeId; - chip::ByteSpan label; + chip::CharSpan label; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -8820,7 +8820,7 @@ struct Type uint8_t statusCode; uint8_t fabricIndex; - chip::ByteSpan debugText; + chip::CharSpan debugText; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8833,7 +8833,7 @@ struct DecodableType uint8_t statusCode; uint8_t fabricIndex; - chip::ByteSpan debugText; + chip::CharSpan debugText; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace NOCResponse @@ -9007,8 +9007,8 @@ enum class Fields struct Type { public: - chip::ByteSpan label; - chip::ByteSpan value; + chip::CharSpan label; + chip::CharSpan value; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -18301,9 +18301,9 @@ struct Type public: uint16_t majorNumber; uint16_t minorNumber; - chip::ByteSpan name; - chip::ByteSpan callSign; - chip::ByteSpan affiliateCallSign; + chip::CharSpan name; + chip::CharSpan callSign; + chip::CharSpan affiliateCallSign; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -18519,7 +18519,7 @@ struct Type { public: uint8_t identifier; - chip::ByteSpan name; + chip::CharSpan name; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -19382,8 +19382,8 @@ struct Type public: uint8_t index; MediaInputType inputType; - chip::ByteSpan name; - chip::ByteSpan description; + chip::CharSpan name; + chip::CharSpan description; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20093,7 +20093,7 @@ struct Type public: uint8_t index; AudioOutputType outputType; - chip::ByteSpan name; + chip::CharSpan name; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index d5a22e34e5aacd..864b40024e5f16 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -28,17 +28,9 @@ #define ZCL_WRITE_ATTRIBUTES_RESPONSE_COMMAND_ID (0x04) #define ZCL_WRITE_ATTRIBUTES_NO_RESPONSE_COMMAND_ID (0x05) #define ZCL_DEFAULT_RESPONSE_COMMAND_ID (0x0B) -#define ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID (0x0C) -#define ZCL_DISCOVER_ATTRIBUTES_RESPONSE_COMMAND_ID (0x0D) #define ZCL_READ_ATTRIBUTES_STRUCTURED_COMMAND_ID (0x0E) #define ZCL_WRITE_ATTRIBUTES_STRUCTURED_COMMAND_ID (0x0F) #define ZCL_WRITE_ATTRIBUTES_STRUCTURED_RESPONSE_COMMAND_ID (0x10) -#define ZCL_DISCOVER_COMMANDS_RECEIVED_COMMAND_ID (0x11) -#define ZCL_DISCOVER_COMMANDS_RECEIVED_RESPONSE_COMMAND_ID (0x12) -#define ZCL_DISCOVER_COMMANDS_GENERATED_COMMAND_ID (0x13) -#define ZCL_DISCOVER_COMMANDS_GENERATED_RESPONSE_COMMAND_ID (0x14) -#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15) -#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16) // Commands for cluster: Identify #define ZCL_IDENTIFY_COMMAND_ID (0x00) diff --git a/zzz_generated/bridge-app/zap-generated/attribute-size.cpp b/zzz_generated/bridge-app/zap-generated/attribute-size.cpp index cb8da08a1c8ce8..07b040a2406610 100644 --- a/zzz_generated/bridge-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/bridge-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -155,15 +156,17 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _LabelStruct _LabelStruct * entry = reinterpret_cast<_LabelStruct *>(write ? src : dest); - ByteSpan * labelSpan = &entry->label; // OCTET_STRING + ByteSpan labelSpanStorage(Uint8::from_const_char(entry->label.data()), entry->label.size()); // CHAR_STRING + ByteSpan * labelSpan = &labelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, labelSpan) : ReadByteSpan(src + entryOffset, 18, labelSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 18); - ByteSpan * valueSpan = &entry->value; // OCTET_STRING + entryOffset = static_cast(entryOffset + 18); + ByteSpan valueSpanStorage(Uint8::from_const_char(entry->value.data()), entry->value.size()); // CHAR_STRING + ByteSpan * valueSpan = &valueSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, valueSpan) : ReadByteSpan(src + entryOffset, 18, valueSpan))) { @@ -216,7 +219,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -280,8 +284,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/bridge-app/zap-generated/callback-stub.cpp b/zzz_generated/bridge-app/zap-generated/callback-stub.cpp index faf01b72b33e18..d0cbed1e5af0ce 100644 --- a/zzz_generated/bridge-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/bridge-app/zap-generated/callback-stub.cpp @@ -276,92 +276,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index e405946e9a3069..2fdd09d615e2bd 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -1277,98 +1277,6 @@ 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (56) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 8b06b7708258e4..3c89b0b6325385 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -219,7 +219,7 @@ static void OnAudioOutputAudioOutputListListAttributeResponse( ChipLogProgress(chipTool, "AudioOutputInfo[%" PRIu16 "]:", i); ChipLogProgress(chipTool, " index: %" PRIu8 "", entry.index); ChipLogProgress(chipTool, " outputType: %" PRIu8 "", entry.outputType); - ChipLogProgress(Zcl, " name: %zu", entry.name.size()); + ChipLogProgress(Zcl, " name: %.*s", static_cast(entry.name.size()), entry.name.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -464,8 +464,8 @@ static void OnFixedLabelLabelListListAttributeResponse( #endif // CHIP_PROGRESS_LOGGING ++i; ChipLogProgress(chipTool, "LabelStruct[%" PRIu16 "]:", i); - ChipLogProgress(Zcl, " label: %zu", entry.label.size()); - ChipLogProgress(Zcl, " value: %zu", entry.value.size()); + ChipLogProgress(Zcl, " label: %.*s", static_cast(entry.label.size()), entry.label.data()); + ChipLogProgress(Zcl, " value: %.*s", static_cast(entry.value.size()), entry.value.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -539,7 +539,7 @@ static void OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse( #endif // CHIP_PROGRESS_LOGGING ++i; ChipLogProgress(chipTool, "NetworkInterfaceType[%" PRIu16 "]:", i); - ChipLogProgress(Zcl, " Name: %zu", entry.name.size()); + ChipLogProgress(Zcl, " Name: %.*s", static_cast(entry.name.size()), entry.name.data()); ChipLogProgress(chipTool, " fabricConnected: %d", entry.fabricConnected); ChipLogProgress(chipTool, " offPremiseServicesReachableIPv4: %d", entry.offPremiseServicesReachableIPv4); ChipLogProgress(chipTool, " offPremiseServicesReachableIPv6: %d", entry.offPremiseServicesReachableIPv6); @@ -660,8 +660,8 @@ static void OnMediaInputMediaInputListListAttributeResponse( ChipLogProgress(chipTool, "MediaInputInfo[%" PRIu16 "]:", i); ChipLogProgress(chipTool, " index: %" PRIu8 "", entry.index); ChipLogProgress(chipTool, " inputType: %" PRIu8 "", entry.inputType); - ChipLogProgress(Zcl, " name: %zu", entry.name.size()); - ChipLogProgress(Zcl, " description: %zu", entry.description.size()); + ChipLogProgress(Zcl, " name: %.*s", static_cast(entry.name.size()), entry.name.data()); + ChipLogProgress(Zcl, " description: %.*s", static_cast(entry.description.size()), entry.description.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -703,7 +703,7 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse( ChipLogProgress(chipTool, " vendorId: %" PRIu16 "", entry.vendorId); ChipLogProgress(chipTool, " fabricId: %" PRIu64 "", entry.fabricId); ChipLogProgress(chipTool, " nodeId: %" PRIu64 "", entry.nodeId); - ChipLogProgress(Zcl, " Label: %zu", entry.label.size()); + ChipLogProgress(Zcl, " Label: %.*s", static_cast(entry.label.size()), entry.label.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -775,9 +775,10 @@ static void OnTvChannelTvChannelListListAttributeResponse( ChipLogProgress(chipTool, "TvChannelInfo[%" PRIu16 "]:", i); ChipLogProgress(chipTool, " majorNumber: %" PRIu16 "", entry.majorNumber); ChipLogProgress(chipTool, " minorNumber: %" PRIu16 "", entry.minorNumber); - ChipLogProgress(Zcl, " name: %zu", entry.name.size()); - ChipLogProgress(Zcl, " callSign: %zu", entry.callSign.size()); - ChipLogProgress(Zcl, " affiliateCallSign: %zu", entry.affiliateCallSign.size()); + ChipLogProgress(Zcl, " name: %.*s", static_cast(entry.name.size()), entry.name.data()); + ChipLogProgress(Zcl, " callSign: %.*s", static_cast(entry.callSign.size()), entry.callSign.data()); + ChipLogProgress(Zcl, " affiliateCallSign: %.*s", static_cast(entry.affiliateCallSign.size()), + entry.affiliateCallSign.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -815,7 +816,7 @@ static void OnTargetNavigatorTargetNavigatorListListAttributeResponse( ++i; ChipLogProgress(chipTool, "NavigateTargetTargetInfo[%" PRIu16 "]:", i); ChipLogProgress(chipTool, " identifier: %" PRIu8 "", entry.identifier); - ChipLogProgress(Zcl, " name: %zu", entry.name.size()); + ChipLogProgress(Zcl, " name: %.*s", static_cast(entry.name.size()), entry.name.data()); } command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -1812,7 +1813,7 @@ static void OnOperationalCredentialsNOCResponseSuccess( ChipLogProgress(Zcl, "Received NOCResponse:"); ChipLogProgress(Zcl, " StatusCode: %" PRIu8 "", data.statusCode); ChipLogProgress(Zcl, " FabricIndex: %" PRIu8 "", data.fabricIndex); - ChipLogProgress(Zcl, " DebugText: %zu", data.debugText.size()); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(data.debugText.size()), data.debugText.data()); ModelCommand * command = static_cast(context); command->SetCommandExitStatus(CHIP_NO_ERROR); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f22f764afc7ac8..d65dbedd03c33c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -16568,6 +16568,60 @@ class TestDelayCommands : public TestCommand CHIP_ERROR TestWait100ms_0() { return WaitForMs(100); } }; +class TestLogCommands : public TestCommand +{ +public: + TestLogCommands() : TestCommand("TestLogCommands"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Log a simple message\n"); + err = TestLogASimpleMessage_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + // + // Tests methods + // + + CHIP_ERROR TestLogASimpleMessage_0() { return Log("This is a simple message"); } +}; + class TestDescriptorCluster : public TestCommand { public: @@ -17216,6 +17270,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index e5fdaae0d8817e..49b3288103e4cb 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -136,84 +136,6 @@ namespace { app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) @@ -1734,12 +1656,12 @@ bool emberAfOperationalCredentialsClusterCertificateChainResponseCallback(Endpoi } bool emberAfOperationalCredentialsClusterNOCResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText) + uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) { ChipLogProgress(Zcl, "NOCResponse:"); ChipLogProgress(Zcl, " StatusCode: %" PRIu8 "", StatusCode); ChipLogProgress(Zcl, " FabricIndex: %" PRIu8 "", FabricIndex); - ChipLogProgress(Zcl, " DebugText: %zu", DebugText.size()); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterNOCResponseCallback"); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index dcee30dc309c7c..c9536f6e8cadc4 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -123,7 +123,7 @@ typedef void (*OperationalCredentialsClusterAttestationResponseCallback)(void * chip::ByteSpan Signature); typedef void (*OperationalCredentialsClusterCertificateChainResponseCallback)(void * context, chip::ByteSpan Certificate); typedef void (*OperationalCredentialsClusterNOCResponseCallback)(void * context, uint8_t StatusCode, uint8_t FabricIndex, - chip::ByteSpan DebugText); + chip::CharSpan DebugText); typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan NOCSRElements, chip::ByteSpan AttestationSignature); typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index 11068bf28fe14c..0ef28c73c599c3 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -4233,7 +4233,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa expectArgumentCount = 3; uint8_t StatusCode; uint8_t FabricIndex; - chip::ByteSpan DebugText; + chip::CharSpan DebugText; bool argExists[3]; memset(argExists, 0, sizeof argExists); diff --git a/zzz_generated/controller-clusters/zap-generated/attribute-size.cpp b/zzz_generated/controller-clusters/zap-generated/attribute-size.cpp index d06e4b2c339a7e..6d177c34b97ac7 100644 --- a/zzz_generated/controller-clusters/zap-generated/attribute-size.cpp +++ b/zzz_generated/controller-clusters/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index e48527abc56135..bc31e9b4debf78 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -580,92 +580,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 6d5823a29b5220..ccac0aeb52a47e 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -453,349 +453,6 @@ 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (246) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 1, Cluster: Identify (client) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - { 0x0003, 0x40, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* TriggerEffect */ \ - \ - /* Endpoint: 1, Cluster: Groups (client) */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroup */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddGroupResponse */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewGroup */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewGroupResponse */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetGroupMembership */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetGroupMembershipResponse */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveGroup */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveGroupResponse */ \ - { 0x0004, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllGroups */ \ - { 0x0004, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroupIfIdentifying */ \ - \ - /* Endpoint: 1, Cluster: Scenes (client) */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddScene */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddSceneResponse */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewScene */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewSceneResponse */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveScene */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveSceneResponse */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllScenes */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveAllScenesResponse */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StoreScene */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StoreSceneResponse */ \ - { 0x0005, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RecallScene */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSceneMembership */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSceneMembershipResponse */ \ - \ - /* Endpoint: 1, Cluster: On/Off (client) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - { 0x0006, 0x40, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* OffWithEffect */ \ - { 0x0006, 0x41, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* OnWithRecallGlobalScene */ \ - { 0x0006, 0x42, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* OnWithTimedOff */ \ - \ - /* Endpoint: 1, Cluster: Level Control (client) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 1, Cluster: Basic (client) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 1, Cluster: OTA Software Update Provider (client) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 1, Cluster: OTA Software Update Requestor (client) */ \ - { 0x002A, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* AnnounceOtaProvider */ \ - \ - /* Endpoint: 1, Cluster: General Commissioning (client) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 1, Cluster: Network Commissioning (client) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 1, Cluster: Diagnostic Logs (client) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 1, Cluster: Software Diagnostics (client) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 1, Cluster: Thread Network Diagnostics (client) */ \ - { 0x0035, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ResetCounts */ \ - \ - /* Endpoint: 1, Cluster: WiFi Network Diagnostics (client) */ \ - { 0x0036, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ResetCounts */ \ - \ - /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (client) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (client) */ \ - { 0x0039, 0x00, 0 }, /* StartUp */ \ - { 0x0039, 0x01, 0 }, /* ShutDown */ \ - { 0x0039, 0x02, 0 }, /* Leave */ \ - { 0x0039, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ReachableChanged */ \ - \ - /* Endpoint: 1, Cluster: AdministratorCommissioning (client) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: Door Lock (client) */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LockDoor */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LockDoorResponse */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UnlockDoor */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UnlockDoorResponse */ \ - { 0x0101, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UnlockWithTimeout */ \ - { 0x0101, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UnlockWithTimeoutResponse */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetLogRecord */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetLogRecordResponse */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetPin */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetPinResponse */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetPin */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetPinResponse */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearPin */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearPinResponse */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearAllPins */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearAllPinsResponse */ \ - { 0x0101, 0x09, 0 }, /* SetUserStatusResponse */ \ - { 0x0101, 0x0A, 0 }, /* GetUserStatusResponse */ \ - { 0x0101, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetWeekdaySchedule */ \ - { 0x0101, 0x0B, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetWeekdayScheduleResponse */ \ - { 0x0101, 0x0C, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetWeekdaySchedule */ \ - { 0x0101, 0x0C, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetWeekdayScheduleResponse */ \ - { 0x0101, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearWeekdaySchedule */ \ - { 0x0101, 0x0D, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearWeekdayScheduleResponse */ \ - { 0x0101, 0x0E, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetYeardaySchedule */ \ - { 0x0101, 0x0E, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetYeardayScheduleResponse */ \ - { 0x0101, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetYeardaySchedule */ \ - { 0x0101, 0x0F, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetYeardayScheduleResponse */ \ - { 0x0101, 0x10, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearYeardaySchedule */ \ - { 0x0101, 0x10, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearYeardayScheduleResponse */ \ - { 0x0101, 0x11, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetHolidaySchedule */ \ - { 0x0101, 0x11, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetHolidayScheduleResponse */ \ - { 0x0101, 0x12, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetHolidaySchedule */ \ - { 0x0101, 0x12, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetHolidayScheduleResponse */ \ - { 0x0101, 0x13, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearHolidaySchedule */ \ - { 0x0101, 0x13, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearHolidayScheduleResponse */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetUserType */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetUserTypeResponse */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetUserType */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetUserTypeResponse */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRfid */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRfidResponse */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetRfid */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GetRfidResponse */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearRfid */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearRfidResponse */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearAllRfids */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ClearAllRfidsResponse */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (client) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GoToLiftValue */ \ - { 0x0102, 0x05, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GoToTiltValue */ \ - { 0x0102, 0x08, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* GoToTiltPercentage */ \ - \ - /* Endpoint: 1, Cluster: Barrier Control (client) */ \ - { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlGoToPercent */ \ - { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlStop */ \ - \ - /* Endpoint: 1, Cluster: Thermostat (client) */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetpointRaiseLower */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CurrentWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RelayStatusLog */ \ - { 0x0201, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetWeeklySchedule */ \ - { 0x0201, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ClearWeeklySchedule */ \ - { 0x0201, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetRelayStatusLog */ \ - \ - /* Endpoint: 1, Cluster: Color Control (client) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x40, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* EnhancedMoveToHue */ \ - { 0x0300, 0x41, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* EnhancedMoveHue */ \ - { 0x0300, 0x42, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* EnhancedStepHue */ \ - { 0x0300, 0x43, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* EnhancedMoveToHueAndSaturation */ \ - { 0x0300, 0x44, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* ColorLoopSet */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 1, Cluster: TV Channel (client) */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannel */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ChangeChannelResponse */ \ - { 0x0504, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannelByNumber */ \ - { 0x0504, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SkipChannel */ \ - \ - /* Endpoint: 1, Cluster: Target Navigator (client) */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NavigateTarget */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NavigateTargetResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Playback (client) */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPlay */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPlayResponse */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPause */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPauseResponse */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStop */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStopResponse */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStartOver */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStartOverResponse */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPrevious */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPreviousResponse */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaNext */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaNextResponse */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaRewind */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaRewindResponse */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaFastForward */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaFastForwardResponse */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipForward */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \ - { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ - { 0x0506, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSeekResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Input (client) */ \ - { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ - { 0x0507, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ShowInputStatus */ \ - { 0x0507, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* HideInputStatus */ \ - { 0x0507, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameInput */ \ - \ - /* Endpoint: 1, Cluster: Low Power (client) */ \ - { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ - \ - /* Endpoint: 1, Cluster: Keypad Input (client) */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ - \ - /* Endpoint: 1, Cluster: Content Launcher (client) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 1, Cluster: Audio Output (client) */ \ - { 0x050B, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectOutput */ \ - { 0x050B, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameOutput */ \ - \ - /* Endpoint: 1, Cluster: Application Launcher (client) */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ - \ - /* Endpoint: 1, Cluster: Application Basic (client) */ \ - { 0x050D, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeStatus */ \ - \ - /* Endpoint: 1, Cluster: Account Login (client) */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ - { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ - \ - /* Endpoint: 1, Cluster: Test Cluster (client) */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestAddArgumentsResponse */ \ - { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ - { 0x050F, 0x03, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* TestUnknownCommand */ \ - { 0x050F, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestAddArguments */ \ - { 0x050F, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestListInt8UReverseResponse */ \ - { 0x050F, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestStructArgumentRequest */ \ - { 0x050F, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNestedStructArgumentRequest */ \ - { 0x050F, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListStructArgumentRequest */ \ - { 0x050F, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListInt8UArgumentRequest */ \ - { 0x050F, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNestedStructListArgumentRequest */ \ - { 0x050F, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListNestedStructListArgumentRequest */ \ - { 0x050F, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestListInt8UReverseRequest */ \ - \ - /* Endpoint: 1, Cluster: Binding (client) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 44, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/lighting-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/lighting-app/zap-generated/CHIPClientCallbacks.cpp index 67b3b16d07be32..ca2e48fa13e4d1 100644 --- a/zzz_generated/lighting-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/lighting-app/zap-generated/CHIPClientCallbacks.cpp @@ -135,81 +135,3 @@ namespace { // template. Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); - -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} diff --git a/zzz_generated/lighting-app/zap-generated/attribute-size.cpp b/zzz_generated/lighting-app/zap-generated/attribute-size.cpp index 70dededa2c9285..ff942e42785082 100644 --- a/zzz_generated/lighting-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/lighting-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/lighting-app/zap-generated/callback-stub.cpp b/zzz_generated/lighting-app/zap-generated/callback-stub.cpp index 9b04ff8407d10e..2eb19ab720afe9 100644 --- a/zzz_generated/lighting-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/lighting-app/zap-generated/callback-stub.cpp @@ -292,92 +292,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 0f211601dcd8da..74f96c0ced2181 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -1378,133 +1378,6 @@ 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (83) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0035, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0036, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - { 0x0006, 0x40, 0 }, /* OffWithEffect */ \ - { 0x0006, 0x41, 0 }, /* OnWithRecallGlobalScene */ \ - { 0x0006, 0x42, 0 }, /* OnWithTimedOff */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x40, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveToHue */ \ - { 0x0300, 0x41, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveHue */ \ - { 0x0300, 0x42, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedStepHue */ \ - { 0x0300, 0x43, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnhancedMoveToHueAndSaturation */ \ - { 0x0300, 0x44, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ColorLoopSet */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 2, Cluster: On/Off (client) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/lock-app/zap-generated/attribute-size.cpp b/zzz_generated/lock-app/zap-generated/attribute-size.cpp index 70dededa2c9285..ff942e42785082 100644 --- a/zzz_generated/lock-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/lock-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/lock-app/zap-generated/callback-stub.cpp b/zzz_generated/lock-app/zap-generated/callback-stub.cpp index b6f2b8f7505bae..faa0069c5bc03e 100644 --- a/zzz_generated/lock-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/lock-app/zap-generated/callback-stub.cpp @@ -260,92 +260,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 0e1dcb36dd2395..f32c33a562116f 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -1207,88 +1207,6 @@ 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (48) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/ota-provider-app/zap-generated/attribute-size.cpp b/zzz_generated/ota-provider-app/zap-generated/attribute-size.cpp index 5ca8d86188ccd9..11bb303cbdd145 100644 --- a/zzz_generated/ota-provider-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/ota-provider-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -134,8 +135,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/ota-provider-app/zap-generated/callback-stub.cpp b/zzz_generated/ota-provider-app/zap-generated/callback-stub.cpp index 76d7720b08e1fc..98a0edafe20b82 100644 --- a/zzz_generated/ota-provider-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/ota-provider-app/zap-generated/callback-stub.cpp @@ -188,92 +188,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index a663216c7a17c9..70788ae36da4dd 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -299,69 +299,6 @@ 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (39) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/ota-requestor-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/ota-requestor-app/zap-generated/CHIPClientCallbacks.cpp index a6fb2e90690855..fc2adfa21d544d 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/CHIPClientCallbacks.cpp @@ -136,84 +136,6 @@ namespace { app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t action, uint32_t delayedActionTime) { diff --git a/zzz_generated/ota-requestor-app/zap-generated/attribute-size.cpp b/zzz_generated/ota-requestor-app/zap-generated/attribute-size.cpp index 3e9a1b1e722595..0f634bf1cb446f 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -134,8 +135,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp b/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp index 76d7720b08e1fc..98a0edafe20b82 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp @@ -188,92 +188,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index f7011078d10038..71e568acc62720 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -250,71 +250,6 @@ 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (41) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/pump-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/pump-app/zap-generated/CHIPClientCallbacks.cpp index 67b3b16d07be32..ca2e48fa13e4d1 100644 --- a/zzz_generated/pump-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/pump-app/zap-generated/CHIPClientCallbacks.cpp @@ -135,81 +135,3 @@ namespace { // template. Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); - -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} diff --git a/zzz_generated/pump-app/zap-generated/attribute-size.cpp b/zzz_generated/pump-app/zap-generated/attribute-size.cpp index 70dededa2c9285..ff942e42785082 100644 --- a/zzz_generated/pump-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/pump-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/pump-app/zap-generated/callback-stub.cpp b/zzz_generated/pump-app/zap-generated/callback-stub.cpp index 3f575fb0a55718..ffd563535f6ba3 100644 --- a/zzz_generated/pump-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/pump-app/zap-generated/callback-stub.cpp @@ -300,92 +300,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index cf117b949362f5..8f4d1b5cabbb98 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -1287,100 +1287,6 @@ 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (58) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0035, 0x00, 0 }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 11, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/pump-controller-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/pump-controller-app/zap-generated/CHIPClientCallbacks.cpp index 67b3b16d07be32..ca2e48fa13e4d1 100644 --- a/zzz_generated/pump-controller-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/CHIPClientCallbacks.cpp @@ -135,81 +135,3 @@ namespace { // template. Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); - -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} diff --git a/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp b/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp index 70dededa2c9285..ff942e42785082 100644 --- a/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/pump-controller-app/zap-generated/callback-stub.cpp b/zzz_generated/pump-controller-app/zap-generated/callback-stub.cpp index 3f575fb0a55718..ffd563535f6ba3 100644 --- a/zzz_generated/pump-controller-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/callback-stub.cpp @@ -300,92 +300,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index 8872b6ba419177..820c3e4ffbd089 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -1230,100 +1230,6 @@ 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (58) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Level Control (client) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0035, 0x00, 0 }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: On/Off (client) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 11, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/temperature-measurement-app/zap-generated/attribute-size.cpp b/zzz_generated/temperature-measurement-app/zap-generated/attribute-size.cpp index d8608d708e20bf..1e6d7ead69a2e9 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/temperature-measurement-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/temperature-measurement-app/zap-generated/callback-stub.cpp b/zzz_generated/temperature-measurement-app/zap-generated/callback-stub.cpp index efa5bcbe075be2..38628c025a61c5 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/temperature-measurement-app/zap-generated/callback-stub.cpp @@ -252,92 +252,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index 553bd91f1af761..9fdf6dc39fb805 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -770,79 +770,6 @@ 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (41) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/thermostat/zap-generated/attribute-size.cpp b/zzz_generated/thermostat/zap-generated/attribute-size.cpp index a9d4d0654a2fe9..49f67d49b1a79f 100644 --- a/zzz_generated/thermostat/zap-generated/attribute-size.cpp +++ b/zzz_generated/thermostat/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -117,8 +118,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->outputType)); // AudioOutputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { @@ -255,15 +257,17 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _LabelStruct _LabelStruct * entry = reinterpret_cast<_LabelStruct *>(write ? src : dest); - ByteSpan * labelSpan = &entry->label; // OCTET_STRING + ByteSpan labelSpanStorage(Uint8::from_const_char(entry->label.data()), entry->label.size()); // CHAR_STRING + ByteSpan * labelSpan = &labelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, labelSpan) : ReadByteSpan(src + entryOffset, 18, labelSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 18); - ByteSpan * valueSpan = &entry->value; // OCTET_STRING + entryOffset = static_cast(entryOffset + 18); + ByteSpan valueSpanStorage(Uint8::from_const_char(entry->value.data()), entry->value.size()); // CHAR_STRING + ByteSpan * valueSpan = &valueSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, valueSpan) : ReadByteSpan(src + entryOffset, 18, valueSpan))) { @@ -316,7 +320,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -426,16 +431,19 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->inputType)); // MediaInputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * descriptionSpan = &entry->description; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), + entry->description.size()); // CHAR_STRING + ByteSpan * descriptionSpan = &descriptionSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) @@ -481,8 +489,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { @@ -541,24 +550,28 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, &entryOffset, sizeof(entry->majorNumber)); // INT16U copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->minorNumber)); // INT16U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * callSignSpan = &entry->callSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING + ByteSpan * callSignSpan = &callSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * affiliateCallSignSpan = &entry->affiliateCallSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), + entry->affiliateCallSign.size()); // CHAR_STRING + ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) @@ -589,8 +602,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo // Struct _NavigateTargetTargetInfo _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->identifier)); // INT8U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { diff --git a/zzz_generated/thermostat/zap-generated/callback-stub.cpp b/zzz_generated/thermostat/zap-generated/callback-stub.cpp index 6558de9bcb8fed..0e30d140169f27 100644 --- a/zzz_generated/thermostat/zap-generated/callback-stub.cpp +++ b/zzz_generated/thermostat/zap-generated/callback-stub.cpp @@ -540,92 +540,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index ed1fb3fff0d6c9..b588de3a5dd744 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -2771,296 +2771,6 @@ 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (205) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - \ - /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroup */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddGroupResponse */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewGroup */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewGroupResponse */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetGroupMembership */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetGroupMembershipResponse */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveGroup */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveGroupResponse */ \ - { 0x0004, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllGroups */ \ - { 0x0004, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroupIfIdentifying */ \ - \ - /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddScene */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddSceneResponse */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewScene */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewSceneResponse */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveScene */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveSceneResponse */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllScenes */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveAllScenesResponse */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StoreScene */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StoreSceneResponse */ \ - { 0x0005, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RecallScene */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSceneMembership */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSceneMembershipResponse */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0039, 0x00, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StartUp */ \ - { 0x0039, 0x01, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ShutDown */ \ - { 0x0039, 0x02, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Leave */ \ - { 0x0039, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ReachableChanged */ \ - \ - /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LockDoor */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LockDoorResponse */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UnlockDoor */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UnlockDoorResponse */ \ - { 0x0101, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UnlockWithTimeout */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetLogRecord */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetPin */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetPin */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearPin */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllPins */ \ - { 0x0101, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetWeekdaySchedule */ \ - { 0x0101, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetWeekdaySchedule */ \ - { 0x0101, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearWeekdaySchedule */ \ - { 0x0101, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetYeardaySchedule */ \ - { 0x0101, 0x0F, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetYeardaySchedule */ \ - { 0x0101, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearYeardaySchedule */ \ - { 0x0101, 0x11, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetHolidaySchedule */ \ - { 0x0101, 0x12, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetHolidaySchedule */ \ - { 0x0101, 0x13, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearHolidaySchedule */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetUserType */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetUserType */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRfid */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetRfid */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearRfid */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllRfids */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, 0 }, /* GoToLiftValue */ \ - { 0x0102, 0x05, 0 }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, 0 }, /* GoToTiltValue */ \ - { 0x0102, 0x08, 0 }, /* GoToTiltPercentage */ \ - \ - /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlGoToPercent */ \ - { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlStop */ \ - \ - /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetpointRaiseLower */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CurrentWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RelayStatusLog */ \ - { 0x0201, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetWeeklySchedule */ \ - { 0x0201, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ClearWeeklySchedule */ \ - { 0x0201, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetRelayStatusLog */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ZoneEnrollResponse */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneStatusChangeNotification */ \ - { 0x0500, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneEnrollRequest */ \ - \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannel */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ChangeChannelResponse */ \ - { 0x0504, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannelByNumber */ \ - { 0x0504, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SkipChannel */ \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NavigateTarget */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NavigateTargetResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPlay */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPlayResponse */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPause */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPauseResponse */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStop */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStopResponse */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStartOver */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStartOverResponse */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPrevious */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPreviousResponse */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaNext */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaNextResponse */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaRewind */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaRewindResponse */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaFastForward */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaFastForwardResponse */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipForward */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \ - { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ - \ - /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ - { 0x0507, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ShowInputStatus */ \ - { 0x0507, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* HideInputStatus */ \ - { 0x0507, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameInput */ \ - \ - /* Endpoint: 1, Cluster: Low Power (server) */ \ - { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ - \ - /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x050B, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectOutput */ \ - { 0x050B, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameOutput */ \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ - \ - /* Endpoint: 1, Cluster: Account Login (server) */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ - { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ - \ - /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ - \ - /* Endpoint: 1, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 2, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 3, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp index d8654681be8cba..98a6747514aecb 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp @@ -136,84 +136,6 @@ namespace { app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); -bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, - bool extended) -{ - ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " extended: %d", extended); - - GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); - - // struct discoverAttributesResponseRecord[] - while (messageLen) - { - CHECK_MESSAGE_LENGTH(4); - AttributeId attributeId = Encoding::LittleEndian::Read32(message); // attribId - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(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 = 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); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - -bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); - ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); - ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); - - for (uint16_t i = 0; i < commandIdCount; i++) - { - ChipLogProgress(Zcl, " commandId: " ChipLogFormatMEI, ChipLogValueMEI(*commandIds)); - commandIds++; - } - - GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); - Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - return true; -} - void GeneralCommissioningClusterBasicCommissioningInfoListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) @@ -487,12 +409,12 @@ bool emberAfOperationalCredentialsClusterCertificateChainResponseCallback(Endpoi } bool emberAfOperationalCredentialsClusterNOCResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t StatusCode, uint8_t FabricIndex, chip::ByteSpan DebugText) + uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) { ChipLogProgress(Zcl, "NOCResponse:"); ChipLogProgress(Zcl, " StatusCode: %" PRIu8 "", StatusCode); ChipLogProgress(Zcl, " FabricIndex: %" PRIu8 "", FabricIndex); - ChipLogProgress(Zcl, " DebugText: %zu", DebugText.size()); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterNOCResponseCallback"); diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h index 01dc638f83d08e..8f342fd8e7c87f 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h @@ -63,7 +63,7 @@ typedef void (*OperationalCredentialsClusterAttestationResponseCallback)(void * chip::ByteSpan Signature); typedef void (*OperationalCredentialsClusterCertificateChainResponseCallback)(void * context, chip::ByteSpan Certificate); typedef void (*OperationalCredentialsClusterNOCResponseCallback)(void * context, uint8_t StatusCode, uint8_t FabricIndex, - chip::ByteSpan DebugText); + chip::CharSpan DebugText); typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan NOCSRElements, chip::ByteSpan AttestationSignature); diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index f07552a2c16ad2..a680bf54539f2f 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -2016,7 +2016,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa expectArgumentCount = 3; uint8_t StatusCode; uint8_t FabricIndex; - chip::ByteSpan DebugText; + chip::CharSpan DebugText; bool argExists[3]; memset(argExists, 0, sizeof argExists); diff --git a/zzz_generated/tv-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-app/zap-generated/attribute-size.cpp index 1182463e1b7670..8e034db9cc9d33 100644 --- a/zzz_generated/tv-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/tv-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -117,8 +118,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->outputType)); // AudioOutputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { @@ -279,7 +281,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -389,16 +392,19 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->inputType)); // MediaInputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * descriptionSpan = &entry->description; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), + entry->description.size()); // CHAR_STRING + ByteSpan * descriptionSpan = &descriptionSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) @@ -444,8 +450,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { @@ -504,24 +511,28 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, &entryOffset, sizeof(entry->majorNumber)); // INT16U copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->minorNumber)); // INT16U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * callSignSpan = &entry->callSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING + ByteSpan * callSignSpan = &callSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * affiliateCallSignSpan = &entry->affiliateCallSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), + entry->affiliateCallSign.size()); // CHAR_STRING + ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) @@ -552,8 +563,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo // Struct _NavigateTargetTargetInfo _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->identifier)); // INT8U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { diff --git a/zzz_generated/tv-app/zap-generated/callback-stub.cpp b/zzz_generated/tv-app/zap-generated/callback-stub.cpp index ffe65b4899ae31..dbf51207d69887 100644 --- a/zzz_generated/tv-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/tv-app/zap-generated/callback-stub.cpp @@ -396,92 +396,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 1ff27659da7123..7a54e970b24ac2 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -2121,243 +2121,6 @@ 0, 0, 0, 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (157) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (client) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, \ - ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannel */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ChangeChannelResponse */ \ - { 0x0504, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannelByNumber */ \ - { 0x0504, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SkipChannel */ \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NavigateTarget */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NavigateTargetResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ - { 0x0507, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ShowInputStatus */ \ - { 0x0507, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* HideInputStatus */ \ - { 0x0507, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameInput */ \ - \ - /* Endpoint: 1, Cluster: Low Power (server) */ \ - { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ - \ - /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ - \ - /* Endpoint: 2, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 2, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 2, Cluster: Audio Output (server) */ \ - { 0x050B, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectOutput */ \ - { 0x050B, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameOutput */ \ - \ - /* Endpoint: 3, Cluster: Media Playback (server) */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPlay */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPlayResponse */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPause */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPauseResponse */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStop */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStopResponse */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStartOver */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStartOverResponse */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPrevious */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPreviousResponse */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaNext */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaNextResponse */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaRewind */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaRewindResponse */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaFastForward */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaFastForwardResponse */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipForward */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \ - { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ - \ - /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 3, Cluster: Application Basic (server) */ \ - { 0x050D, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeStatus */ \ - \ - /* Endpoint: 3, Cluster: Account Login (server) */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ - { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ - \ - /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 3, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp index fa60da7b9bd8ca..c2db6bd5582973 100644 --- a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -117,8 +118,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->outputType)); // AudioOutputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { @@ -255,15 +257,17 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _LabelStruct _LabelStruct * entry = reinterpret_cast<_LabelStruct *>(write ? src : dest); - ByteSpan * labelSpan = &entry->label; // OCTET_STRING + ByteSpan labelSpanStorage(Uint8::from_const_char(entry->label.data()), entry->label.size()); // CHAR_STRING + ByteSpan * labelSpan = &labelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, labelSpan) : ReadByteSpan(src + entryOffset, 18, labelSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 18); - ByteSpan * valueSpan = &entry->value; // OCTET_STRING + entryOffset = static_cast(entryOffset + 18); + ByteSpan valueSpanStorage(Uint8::from_const_char(entry->value.data()), entry->value.size()); // CHAR_STRING + ByteSpan * valueSpan = &valueSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 18, valueSpan) : ReadByteSpan(src + entryOffset, 18, valueSpan))) { @@ -316,7 +320,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -426,16 +431,19 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, sizeof(entry->index)); // INT8U copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->inputType)); // MediaInputType + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * descriptionSpan = &entry->description; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), + entry->description.size()); // CHAR_STRING + ByteSpan * descriptionSpan = &descriptionSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) @@ -481,8 +489,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { @@ -514,24 +523,28 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, &entryOffset, sizeof(entry->majorNumber)); // INT16U copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->minorNumber)); // INT16U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * callSignSpan = &entry->callSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING + ByteSpan * callSignSpan = &callSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) { ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); return 0; } - entryOffset = static_cast(entryOffset + 34); - ByteSpan * affiliateCallSignSpan = &entry->affiliateCallSign; // OCTET_STRING + entryOffset = static_cast(entryOffset + 34); + ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), + entry->affiliateCallSign.size()); // CHAR_STRING + ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) @@ -562,8 +575,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo // Struct _NavigateTargetTargetInfo _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan * nameSpan = &entry->name; // OCTET_STRING + &entryOffset, sizeof(entry->identifier)); // INT8U + ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING + ByteSpan * nameSpan = &nameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) { diff --git a/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp b/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp index e1742d248e18d7..1887921054df3d 100644 --- a/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp @@ -532,92 +532,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 5313e5b4bdfa3e..01aadd928077e1 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -2708,293 +2708,6 @@ 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (204) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ - { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ - { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ - { 0x0029, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* QueryImageResponse */ \ - { 0x0029, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ApplyUpdateRequestResponse */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { 0x0032, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RetrieveLogsRequest */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - \ - /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroup */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddGroupResponse */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewGroup */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewGroupResponse */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetGroupMembership */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetGroupMembershipResponse */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveGroup */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveGroupResponse */ \ - { 0x0004, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllGroups */ \ - { 0x0004, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroupIfIdentifying */ \ - \ - /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddScene */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddSceneResponse */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewScene */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewSceneResponse */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveScene */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveSceneResponse */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllScenes */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveAllScenesResponse */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StoreScene */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StoreSceneResponse */ \ - { 0x0005, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RecallScene */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSceneMembership */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSceneMembershipResponse */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0039, 0x00, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StartUp */ \ - { 0x0039, 0x01, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ShutDown */ \ - { 0x0039, 0x02, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Leave */ \ - { 0x0039, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ReachableChanged */ \ - \ - /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LockDoor */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LockDoorResponse */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UnlockDoor */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UnlockDoorResponse */ \ - { 0x0101, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UnlockWithTimeout */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetLogRecord */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetPin */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetPin */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearPin */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllPins */ \ - { 0x0101, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetWeekdaySchedule */ \ - { 0x0101, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetWeekdaySchedule */ \ - { 0x0101, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearWeekdaySchedule */ \ - { 0x0101, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetYeardaySchedule */ \ - { 0x0101, 0x0F, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetYeardaySchedule */ \ - { 0x0101, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearYeardaySchedule */ \ - { 0x0101, 0x11, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetHolidaySchedule */ \ - { 0x0101, 0x12, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetHolidaySchedule */ \ - { 0x0101, 0x13, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearHolidaySchedule */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetUserType */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetUserType */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRfid */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetRfid */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearRfid */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllRfids */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, 0 }, /* GoToLiftValue */ \ - { 0x0102, 0x05, 0 }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, 0 }, /* GoToTiltValue */ \ - { 0x0102, 0x08, 0 }, /* GoToTiltPercentage */ \ - \ - /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlGoToPercent */ \ - { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlStop */ \ - \ - /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetpointRaiseLower */ \ - { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CurrentWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetWeeklySchedule */ \ - { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RelayStatusLog */ \ - { 0x0201, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetWeeklySchedule */ \ - { 0x0201, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ClearWeeklySchedule */ \ - { 0x0201, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetRelayStatusLog */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ZoneEnrollResponse */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneStatusChangeNotification */ \ - { 0x0500, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneEnrollRequest */ \ - \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannel */ \ - { 0x0504, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ChangeChannelResponse */ \ - { 0x0504, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeChannelByNumber */ \ - { 0x0504, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SkipChannel */ \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NavigateTarget */ \ - { 0x0505, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NavigateTargetResponse */ \ - \ - /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPlay */ \ - { 0x0506, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPlayResponse */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPause */ \ - { 0x0506, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPauseResponse */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStop */ \ - { 0x0506, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStopResponse */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaStartOver */ \ - { 0x0506, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaStartOverResponse */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaPrevious */ \ - { 0x0506, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaPreviousResponse */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaNext */ \ - { 0x0506, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaNextResponse */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaRewind */ \ - { 0x0506, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaRewindResponse */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaFastForward */ \ - { 0x0506, 0x07, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaFastForwardResponse */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipForward */ \ - { 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \ - { 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \ - { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ - \ - /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ - { 0x0507, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ShowInputStatus */ \ - { 0x0507, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* HideInputStatus */ \ - { 0x0507, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameInput */ \ - \ - /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ - { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ - { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ - { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x050B, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectOutput */ \ - { 0x050B, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RenameOutput */ \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ - { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ - \ - /* Endpoint: 1, Cluster: Account Login (server) */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ - { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ - { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ - \ - /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ - { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ - { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ - \ - /* Endpoint: 1, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ - \ - /* Endpoint: 2, Cluster: On/Off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { 3, 4098 }, \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \ diff --git a/zzz_generated/window-app/zap-generated/attribute-size.cpp b/zzz_generated/window-app/zap-generated/attribute-size.cpp index 70dededa2c9285..ff942e42785082 100644 --- a/zzz_generated/window-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/window-app/zap-generated/attribute-size.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); // Struct _NetworkInterfaceType _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) { @@ -243,8 +245,9 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING + sizeof(entry->NodeId)); // NODE_ID + ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING + ByteSpan * LabelSpan = &LabelSpanStorage; if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) { diff --git a/zzz_generated/window-app/zap-generated/callback-stub.cpp b/zzz_generated/window-app/zap-generated/callback-stub.cpp index 6d836e5b069e1a..8512f809334a74 100644 --- a/zzz_generated/window-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/window-app/zap-generated/callback-stub.cpp @@ -252,92 +252,6 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, C return false; } -/** @brief Discover Attributes Response - * - * This function is called by the application framework when a Discover - * Attributes Response or Discover Attributes Extended Response command is - * received from an external device. The Discover Attributes Response command - * contains a bool indicating if discovery is complete and a list of zero or - * more attribute identifier/type records. The final argument indicates whether - * the response is in the extended format or not. The application should return - * true if the message was processed or false if it was not. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param discoveryComplete Indicates whether there are more attributes to be - * discovered. true if there are no more attributes to be discovered. Ver.: - * always - * @param buffer Buffer containing the list of attribute identifier/type - * records. Ver.: always - * @param bufLen The length in bytes of the list. Ver.: always - * @param extended Indicates whether the response is in the extended format or - * not. Ver.: always - */ -bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, - uint16_t bufLen, bool extended) -{ - return false; -} - -/** @brief Discover Commands Generated Response - * - * This function is called by the framework when Discover Commands Generated - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Discover Commands Received Response - * - * This function is called by the framework when Discover Commands Received - * Response is received. - * - * @param clusterId The cluster identifier of this response. Ver.: always - * @param manufacturerCode Manufacturer code Ver.: always - * @param discoveryComplete Indicates whether there are more commands to be - * discovered. Ver.: always - * @param commandIds Buffer containing the list of command identifiers. Ver.: - * always - * @param commandIdCount The length of bytes of the list, whish is the same as - * the number of identifiers. Ver.: always - */ -bool __attribute__((weak)) -emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, - CommandId * commandIds, uint16_t commandIdCount) -{ - return false; -} - -/** @brief Pre Command Received - * - * This callback is the second in the Application Framework's message processing - * chain. At this point in the processing of incoming over-the-air messages, the - * application has determined that the incoming message is a ZCL command. It - * parses enough of the message to populate an EmberAfClusterCommand struct. The - * Application Framework defines this struct value in a local scope to the - * command processing but also makes it available through a global pointer - * called emberAfCurrentCommand, in app/framework/util/util.c. When command - * processing is complete, this pointer is cleared. - * - * @param cmd Ver.: always - */ -bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd) -{ - return false; -} - /** @brief Pre Message Send * * This function is called by the framework when it is about to pass a message diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 49b5bbe2300129..fb775ff7bf23be 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -1239,98 +1239,6 @@ 0, 0, 0 \ } -// Array of EmberAfCommandMetadata structs. -#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (58) -#define GENERATED_COMMANDS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ - { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ - { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - { 0x0030, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CommissioningComplete */ \ - { 0x0030, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CommissioningCompleteResponse */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddWiFiNetwork */ \ - { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddWiFiNetworkResponse */ \ - { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateWiFiNetwork */ \ - { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateWiFiNetworkResponse */ \ - { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddThreadNetwork */ \ - { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* AddThreadNetworkResponse */ \ - { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateThreadNetwork */ \ - { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UpdateThreadNetworkResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x003C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenCommissioningWindow */ \ - { 0x003C, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpenBasicCommissioningWindow */ \ - { 0x003C, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RevokeCommissioning */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AttestationRequest */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AttestationResponse */ \ - { 0x003E, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* CertificateChainRequest */ \ - { 0x003E, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* CertificateChainResponse */ \ - { 0x003E, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* OpCSRRequest */ \ - { 0x003E, 0x05, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* OpCSRResponse */ \ - { 0x003E, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddNOC */ \ - { 0x003E, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateNOC */ \ - { 0x003E, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* NOCResponse */ \ - { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ - { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ - { 0x003E, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddTrustedRootCertificate */ \ - { 0x003E, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveTrustedRootCertificate */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToLiftValue */ \ - { 0x0102, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToTiltValue */ \ - { 0x0102, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToTiltPercentage */ \ - \ - /* Endpoint: 2, Cluster: Window Covering (server) */ \ - { 0x0102, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpOrOpen */ \ - { 0x0102, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DownOrClose */ \ - { 0x0102, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopMotion */ \ - { 0x0102, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToLiftValue */ \ - { 0x0102, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToLiftPercentage */ \ - { 0x0102, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToTiltValue */ \ - { 0x0102, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GoToTiltPercentage */ \ - } - -// Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) -#define GENERATED_COMMAND_MANUFACTURER_CODES \ - { \ - { \ - 0x00, 0x00 \ - } \ - } - // This is an array of EmberAfManufacturerCodeEntry structures for clusters. #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0) #define GENERATED_CLUSTER_MANUFACTURER_CODES \