From bdab6c5f40ee1ef2659249d45a336665e4a04b9d Mon Sep 17 00:00:00 2001 From: Yuanyao Zhong <82843247+yyzhong-g@users.noreply.github.com> Date: Thu, 20 Jan 2022 18:59:16 -0500 Subject: [PATCH 01/14] Add tracing instructions in ESP32 README.md (#13722) * Add tracing instructions in ESP32 README.md * Restyled by gn * Restyled by prettier-markdown * Add "tokenized" to wordlist.txt * Change in src/trace/BUILD.gn file for PW_TRACE_BACKEND_SET flag Co-authored-by: Restyled.io --- .github/.wordlist.txt | 1 + config/esp32/components/chip/component.mk | 1 + examples/all-clusters-app/esp32/README.md | 14 ++++++++++++++ src/trace/BUILD.gn | 7 +++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index c811299aae330f..9886a40b4d99a9 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -993,6 +993,7 @@ TLV tmp tngvndl TODO +tokenized toolchain toolchains topologies diff --git a/config/esp32/components/chip/component.mk b/config/esp32/components/chip/component.mk index 6b8714b1db620e..61ab9100fa78e7 100644 --- a/config/esp32/components/chip/component.mk +++ b/config/esp32/components/chip/component.mk @@ -136,6 +136,7 @@ ifeq ($(is_debug),false) endif if [[ "$(CONFIG_ENABLE_PW_RPC)" = "y" ]]; then \ echo "chip_build_pw_rpc_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ + echo "chip_build_pw_trace_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ echo "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"" >> $(OUTPUT_DIR)/args.gn ;\ diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 1f4ca1ca5a630e..cfb88c5606f70d 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -15,6 +15,7 @@ control. - [Flashing app using script](#flashing-app-using-script) - [Note](#note) - [Using the RPC console](#using-the-rpc-console) + - [Device Tracing](#device-tracing) --- @@ -295,3 +296,16 @@ From within the console you can then invoke rpcs: rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + +## Device Tracing + +Device tracing is available to analyze the device performance. To turn on +tracing, build with RPC enabled. See +[Using the RPC console](#using-the-rpc-console). + +Obtain tracing json file. + +``` + $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -d {PORT} -o {OUTPUT_FILE} \ + -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto +``` diff --git a/src/trace/BUILD.gn b/src/trace/BUILD.gn index 546107ad45ce67..209909432dc0bd 100644 --- a/src/trace/BUILD.gn +++ b/src/trace/BUILD.gn @@ -18,11 +18,14 @@ declare_args() { chip_build_pw_trace_lib = false } +config("config") { + defines = [ "PW_TRACE_BACKEND_SET" ] +} + source_set("trace") { sources = [ "trace.h" ] - if (chip_build_pw_trace_lib) { - cflags = [ "-DPW_TRACE_BACKEND_SET=1" ] + public_configs = [ ":config" ] public_deps = [ "${dir_pigweed}/pw_trace" ] } } From 04f39b95919272038dfe185ae0fe858b6c756693 Mon Sep 17 00:00:00 2001 From: Chirag Atal <35214609+chiragatal@users.noreply.github.com> Date: Fri, 21 Jan 2022 05:34:46 +0530 Subject: [PATCH 02/14] Fix compilation errors in scenes-client and groups-client (#13754) --- src/app/clusters/groups-client/groups-client.cpp | 2 +- src/app/clusters/scenes-client/scenes-client.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/groups-client/groups-client.cpp b/src/app/clusters/groups-client/groups-client.cpp index 373561e115dde4..f69fa876dc43e3 100644 --- a/src/app/clusters/groups-client/groups-client.cpp +++ b/src/app/clusters/groups-client/groups-client.cpp @@ -76,7 +76,7 @@ bool emberAfGroupsClusterGetGroupMembershipResponseCallback(app::CommandHandler { emberAfGroupsClusterPrint(" [0x%2x]", emberAfGetInt16u(groupList + (i << 1), 0, 2)); } - emberAfGroupsClusterPrintln(""); + emberAfGroupsClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/clusters/scenes-client/scenes-client.cpp b/src/app/clusters/scenes-client/scenes-client.cpp index 8a59aa0593c4ea..3f15fd9fe0f90b 100644 --- a/src/app/clusters/scenes-client/scenes-client.cpp +++ b/src/app/clusters/scenes-client/scenes-client.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include using namespace chip; @@ -100,7 +100,7 @@ bool emberAfScenesClusterGetSceneMembershipResponseCallback(app::CommandHandler } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } @@ -157,7 +157,7 @@ bool emberAfPluginScenesClientParseViewSceneResponse(const EmberAfClusterCommand } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); return true; } From c24c34b0f94569ba31ffcda5ab76c98160136606 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Fri, 21 Jan 2022 08:15:54 +0800 Subject: [PATCH 03/14] [Ameba] Update dockerfile for 'otar' name change (#13695) --- integrations/docker/images/chip-build-ameba/Dockerfile | 2 +- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/chip-build-ameba/Dockerfile b/integrations/docker/images/chip-build-ameba/Dockerfile index 1a0d97d29e5654..29127ce422c973 100644 --- a/integrations/docker/images/chip-build-ameba/Dockerfile +++ b/integrations/docker/images/chip-build-ameba/Dockerfile @@ -9,7 +9,7 @@ RUN set -x \ && cd ${AMEBA_DIR} \ && git clone --progress -b cmake_build https://github.com/pankore/ambd_sdk_with_chip_non_NDA.git \ && cd ambd_sdk_with_chip_non_NDA \ - && git reset --hard 4491131 \ + && git reset --hard 0eafdc7 \ && git submodule update --depth 1 --init --progress \ && cd project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/toolchain \ && cat asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2.part* > asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2 \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 4a9997ad0d2342..4a43b1aab9af3e 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.48 Version bump reason: [nrf] Bump west version +0.5.49 Version bump reason: [Ameba] Revise 'otar' to 'ota_requestor' From cf1b25478bbcb93164b09f9546865430a3b7d8e7 Mon Sep 17 00:00:00 2001 From: Michael Sandstedt Date: Thu, 20 Jan 2022 19:24:10 -0600 Subject: [PATCH 04/14] add isShortDiscriminator to SetupPayload (#13671) The SetupPayload (Onboarding Payload in spec terminology) should be fully self describing, but isn't because it does not record whether the discriminator is the short or long version. This commit makes the necessary additions to expose that information. This improvement is then used to simplify the code in SetUpCodePairer, which was passing around its own isShort bool. Instead, it now just uses the SetupPayload struct in all interfaces. --- src/controller/SetUpCodePairer.cpp | 31 ++++++++++--------- src/controller/SetUpCodePairer.h | 8 ++--- .../ManualSetupPayloadParser.cpp | 3 +- src/setup_payload/SetupPayload.h | 1 + 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index ddb460051b40b9..16e0e04d14900d 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -44,27 +44,27 @@ CHIP_ERROR SetUpCodePairer::PairDevice(NodeId remoteId, const char * setUpCode) mRemoteId = remoteId; mSetUpPINCode = payload.setUpPINCode; - return Connect(payload.rendezvousInformation, payload.discriminator, !isQRCode); + return Connect(payload); } -CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformation, uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::Connect(SetupPayload & payload) { CHIP_ERROR err = CHIP_NO_ERROR; bool isRunning = false; - bool searchOverAll = rendezvousInformation == RendezvousInformationFlag::kNone; - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kBLE) + bool searchOverAll = payload.rendezvousInformation == RendezvousInformationFlag::kNone; + if (searchOverAll || payload.rendezvousInformation == RendezvousInformationFlag::kBLE) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverBle(discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverBle(payload))) { isRunning = true; } VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); } - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP) + if (searchOverAll || payload.rendezvousInformation == RendezvousInformationFlag::kSoftAP) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(payload))) { isRunning = true; } @@ -73,8 +73,7 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat // We always want to search on network because any node that has already been commissioned will use on-network regardless of the // QR code flag. - if (CHIP_NO_ERROR == - (err = StartDiscoverOverIP(isShort ? static_cast((discriminator >> 8) & 0x0F) : discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverIP(payload))) { isRunning = true; } @@ -83,11 +82,11 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat return isRunning ? CHIP_NO_ERROR : CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverBle(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverBle(SetupPayload & payload) { #if CONFIG_NETWORK_LAYER_BLE VerifyOrReturnError(mBleLayer != nullptr, CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - return mBleLayer->NewBleConnectionByDiscriminator(discriminator, this, OnDiscoveredDeviceOverBleSuccess, + return mBleLayer->NewBleConnectionByDiscriminator(payload.discriminator, this, OnDiscoveredDeviceOverBleSuccess, OnDiscoveredDeviceOverBleError); #else return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; @@ -104,11 +103,13 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverBle() #endif // CONFIG_NETWORK_LAYER_BLE } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(SetupPayload & payload) { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - currentFilter.type = isShort ? Dnssd::DiscoveryFilterType::kShortDiscriminator : Dnssd::DiscoveryFilterType::kLongDiscriminator; - currentFilter.code = discriminator; + currentFilter.type = payload.isShortDiscriminator ? Dnssd::DiscoveryFilterType::kShortDiscriminator + : Dnssd::DiscoveryFilterType::kLongDiscriminator; + currentFilter.code = + payload.isShortDiscriminator ? static_cast((payload.discriminator >> 8) & 0x0F) : payload.discriminator; return mCommissioner->DiscoverCommissionableNodes(currentFilter); #else return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; @@ -123,7 +124,7 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverIP() return CHIP_NO_ERROR; } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverSoftAP(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverSoftAP(SetupPayload & payload) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index 3b72831a331164..0ecd41c96b0597 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -65,12 +65,12 @@ class DLL_EXPORT SetUpCodePairer #endif // CONFIG_NETWORK_LAYER_BLE private: - CHIP_ERROR Connect(RendezvousInformationFlag rendezvousInformation, uint16_t discriminator, bool isShort); - CHIP_ERROR StartDiscoverOverBle(uint16_t discriminator, bool isShort); + CHIP_ERROR Connect(SetupPayload & paload); + CHIP_ERROR StartDiscoverOverBle(SetupPayload & payload); CHIP_ERROR StopConnectOverBle(); - CHIP_ERROR StartDiscoverOverIP(uint16_t discriminator, bool isShort); + CHIP_ERROR StartDiscoverOverIP(SetupPayload & payload); CHIP_ERROR StopConnectOverIP(); - CHIP_ERROR StartDiscoverOverSoftAP(uint16_t discriminator, bool isShort); + CHIP_ERROR StartDiscoverOverSoftAP(SetupPayload & payload); CHIP_ERROR StopConnectOverSoftAP(); void OnDeviceDiscovered(RendezvousParameters & params); diff --git a/src/setup_payload/ManualSetupPayloadParser.cpp b/src/setup_payload/ManualSetupPayloadParser.cpp index 0b59ffb53d2c16..6ef1f35ef636c6 100644 --- a/src/setup_payload/ManualSetupPayloadParser.cpp +++ b/src/setup_payload/ManualSetupPayloadParser.cpp @@ -193,7 +193,8 @@ CHIP_ERROR ManualSetupPayloadParser::populatePayload(SetupPayload & outPayload) static_assert(kSetupPINCodeFieldLengthInBits <= 32, "Won't fit in uint32_t"); outPayload.setUpPINCode = static_cast(setUpPINCode); static_assert(kManualSetupDiscriminatorFieldLengthInBits <= 16, "Won't fit in uint16_t"); - outPayload.discriminator = static_cast(discriminator); + outPayload.discriminator = static_cast(discriminator); + outPayload.isShortDiscriminator = true; return result; } diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index b6e000c2f0e131..298dd54ea12a69 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -119,6 +119,7 @@ struct PayloadContents bool isValidQRCodePayload() const; bool isValidManualCode() const; + bool isShortDiscriminator = false; bool operator==(PayloadContents & input) const; }; From 2f1301b4ab2df358a413cf19fb11e5c2dd66f845 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 20 Jan 2022 22:16:11 -0500 Subject: [PATCH 05/14] Expose array size limit in IDL where size limit seems intentional (#13699) * Expose array size limit in IDL where size limit seems intentional * Only use sizes for strings and place it together with the data type * Remove if_valid_list_size usage * ZAP regen * Fix removal of list sizes - had an extra maxLength remaining, now removed * Add unless check in structure member for string size. Not that no output diff * Add size info for attribute string types as well --- .../all-clusters-app.matter | 112 +++++++++--------- .../bridge-common/bridge-app.matter | 38 +++--- .../door-lock-common/door-lock-app.matter | 44 +++---- .../lighting-common/lighting-app.matter | 50 ++++---- examples/lock-app/lock-common/lock-app.matter | 42 +++---- .../log-source-common/log-source-app.matter | 4 +- .../ota-provider-app.matter | 12 +- .../ota-requestor-app.matter | 24 ++-- .../placeholder/linux/apps/app1/config.matter | 30 ++--- .../placeholder/linux/apps/app2/config.matter | 30 ++--- examples/pump-app/pump-common/pump-app.matter | 36 +++--- .../pump-controller-app.matter | 38 +++--- .../esp32/main/temperature-measurement.matter | 30 ++--- .../thermostat-common/thermostat.matter | 52 ++++---- examples/tv-app/tv-common/tv-app.matter | 80 ++++++------- .../tv-casting-common/tv-casting-app.matter | 104 ++++++++-------- examples/window-app/common/window-app.matter | 50 ++++---- .../partials/idl/structure_member.zapt | 9 +- .../templates/app/MatterIDL.zapt | 13 +- .../data_model/controller-clusters.matter | 112 +++++++++--------- 20 files changed, 461 insertions(+), 449 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 72d0a2fe9bc8c9..4ec59939789acb 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AccessControl = 31 { @@ -43,7 +43,7 @@ server cluster AccessControl = 31 { struct ExtensionEntry { fabric_idx fabricIndex = 0; - OCTET_STRING data = 1; + OCTET_STRING<254> data = 1; } info event AccessControlEntryChanged = 0 { @@ -115,12 +115,12 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - readonly attribute char_string vendorName = 0; + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorId = 1; - readonly attribute char_string applicationName = 2; + readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; readonly attribute ApplicationStatusEnum applicationStatus = 5; - readonly attribute char_string applicationVersion = 6; + readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; readonly global attribute int16u clusterRevision = 65533; } @@ -154,7 +154,7 @@ server cluster AudioOutput = 1291 { struct OutputInfo { INT8U index = 0; OutputTypeEnum outputType = 1; - CHAR_STRING name = 2; + CHAR_STRING<32> name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; @@ -193,24 +193,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -284,7 +284,7 @@ server cluster BridgedActions = 37 { struct ActionStruct { INT16U actionID = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; ActionTypeEnum type = 2; INT16U endpointListID = 3; INT16U supportedCommands = 4; @@ -293,7 +293,7 @@ server cluster BridgedActions = 37 { struct EndpointListStruct { INT16U endpointListID = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; EndpointListTypeEnum type = 2; ENDPOINT_NO endpoints[] = 3; } @@ -313,7 +313,7 @@ server cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; - readonly attribute long_char_string setupUrl = 2; + readonly attribute long_char_string<512> setupUrl = 2; readonly global attribute int16u clusterRevision = 65533; } @@ -334,9 +334,9 @@ server cluster Channel = 1284 { struct ChannelInfo { INT16U majorNumber = 0; INT16U minorNumber = 1; - CHAR_STRING name = 2; - CHAR_STRING callSign = 3; - CHAR_STRING affiliateCallSign = 4; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> callSign = 3; + CHAR_STRING<32> affiliateCallSign = 4; } readonly attribute ChannelInfo channelList[] = 0; @@ -396,7 +396,7 @@ server cluster ColorControl = 768 { readonly attribute int16u currentX = 3; readonly attribute int16u currentY = 4; readonly attribute enum8 driftCompensation = 5; - readonly attribute char_string compensationText = 6; + readonly attribute char_string<254> compensationText = 6; readonly attribute int16u colorTemperature = 7; readonly attribute enum8 colorMode = 8; attribute bitmap8 colorControlOptions = 15; @@ -976,7 +976,7 @@ server cluster DoorLock = 257 { readonly attribute int8u maxPINCodeLength = 23; readonly attribute int8u minPINCodeLength = 24; readonly attribute bitmap8 credentialRulesSupport = 27; - attribute char_string language = 33; + attribute char_string<3> language = 33; attribute int32u autoRelockTime = 35; attribute int8u soundVolume = 36; attribute DlOperatingMode operatingMode = 37; @@ -1233,11 +1233,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -1287,17 +1287,17 @@ server cluster GroupKeyManagement = 63 { INT16U fabricIndex = 0; INT16U groupId = 1; INT16U endpoints[] = 2; - CHAR_STRING groupName = 3; + CHAR_STRING<16> groupName = 3; } struct GroupKeySet { INT16U groupKeySetID = 0; GroupKeySecurityPolicy securityPolicy = 1; - OCTET_STRING epochKey0 = 2; + OCTET_STRING<16> epochKey0 = 2; INT64U epochStartTime0 = 3; - OCTET_STRING epochKey1 = 4; + OCTET_STRING<16> epochKey1 = 4; INT64U epochStartTime1 = 5; - OCTET_STRING epochKey2 = 6; + OCTET_STRING<16> epochKey2 = 6; INT64U epochStartTime2 = 7; } @@ -1687,7 +1687,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -1716,8 +1716,8 @@ server cluster MediaInput = 1287 { struct InputInfo { INT8U index = 0; InputTypeEnum inputType = 1; - CHAR_STRING name = 2; - CHAR_STRING description = 3; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> description = 3; } readonly attribute InputInfo mediaInputList[] = 0; @@ -1753,7 +1753,7 @@ server cluster MediaPlayback = 1286 { server cluster ModeSelect = 80 { struct ModeOptionStruct { - CHAR_STRING label = 0; + CHAR_STRING<32> label = 0; INT8U mode = 1; INT32U semanticTag = 2; } @@ -1762,7 +1762,7 @@ server cluster ModeSelect = 80 { readonly attribute ModeOptionStruct supportedModes[] = 1; attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; - readonly attribute char_string description = 4; + readonly attribute char_string<32> description = 4; readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { @@ -1828,7 +1828,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -2092,11 +2092,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -2182,7 +2182,7 @@ server cluster OperationalCredentials = 62 { server cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; - readonly attribute char_string description = 2; + readonly attribute char_string<60> description = 2; readonly attribute int32u batteryVoltage = 11; readonly attribute int8u batteryPercentRemaining = 12; readonly attribute int32u batteryTimeRemaining = 13; @@ -2412,7 +2412,7 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -2479,7 +2479,7 @@ server cluster TargetNavigator = 1285 { struct TargetInfo { INT8U identifier = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; @@ -2505,7 +2505,7 @@ server cluster TestCluster = 1295 { struct TestListStructOctet { INT64U fabricIndex = 0; - OCTET_STRING operationalCert = 1; + OCTET_STRING<32> operationalCert = 1; } struct NullablesAndOptionalsStruct { @@ -2584,13 +2584,13 @@ server cluster TestCluster = 1295 { attribute enum16 enum16 = 22; attribute single floatSingle = 23; attribute double floatDouble = 24; - attribute octet_string octetString = 25; + attribute octet_string<10> octetString = 25; attribute INT8U listInt8u[] = 26; attribute OCTET_STRING listOctetString[] = 27; attribute TestListStructOctet listStructOctetString[] = 28; - attribute long_octet_string longOctetString = 29; - attribute char_string charString = 30; - attribute long_char_string longCharString = 31; + attribute long_octet_string<1000> longOctetString = 29; + attribute char_string<10> charString = 30; + attribute long_char_string<1000> longCharString = 31; attribute epoch_us epochUs = 32; attribute epoch_s epochS = 33; attribute vendor_id vendorId = 34; @@ -2628,8 +2628,8 @@ server cluster TestCluster = 1295 { attribute enum16 nullableEnum16 = 32790; attribute single nullableFloatSingle = 32791; attribute double nullableFloatDouble = 32792; - attribute octet_string nullableOctetString = 32793; - attribute char_string nullableCharString = 32798; + attribute octet_string<10> nullableOctetString = 32793; + attribute char_string<10> nullableCharString = 32798; attribute SimpleEnum nullableEnumAttr = 32804; attribute SimpleStruct nullableStruct = 32805; attribute int8u nullableRangeRestrictedInt8u = 32806; @@ -2859,10 +2859,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -2917,7 +2917,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -2932,7 +2932,7 @@ server cluster UserLabel = 65 { } server cluster WakeOnLan = 1283 { - readonly attribute char_string wakeOnLanMacAddress = 0; + readonly attribute char_string<32> wakeOnLanMacAddress = 0; readonly global attribute int16u clusterRevision = 65533; } @@ -2980,7 +2980,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index f8504f25addfa8..5ec65851ef1a4f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; } @@ -255,11 +255,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -375,7 +375,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -435,7 +435,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -544,11 +544,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -634,7 +634,7 @@ server cluster OperationalCredentials = 62 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -769,10 +769,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -827,7 +827,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -883,7 +883,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index 2dbd6bc86aa468..6e591f838c5aae 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; } @@ -359,7 +359,7 @@ server cluster DoorLock = 257 { readonly attribute int8u maxPINCodeLength = 23; readonly attribute int8u minPINCodeLength = 24; readonly attribute bitmap8 credentialRulesSupport = 27; - attribute char_string language = 33; + attribute char_string<3> language = 33; attribute int32u autoRelockTime = 35; attribute int8u soundVolume = 36; attribute DlOperatingMode operatingMode = 37; @@ -588,11 +588,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -627,7 +627,7 @@ server cluster GeneralDiagnostics = 51 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -687,7 +687,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -772,11 +772,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -862,12 +862,12 @@ server cluster OperationalCredentials = 62 { server cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; - readonly attribute char_string description = 2; + readonly attribute char_string<60> description = 2; readonly attribute int32u wiredAssessedCurrent = 6; readonly attribute enum8 batteryChargeLevel = 14; readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; - readonly attribute char_string batteryReplacementDescription = 19; + readonly attribute char_string<60> batteryReplacementDescription = 19; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; } @@ -880,7 +880,7 @@ server cluster PowerSourceConfiguration = 46 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -977,10 +977,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -1035,7 +1035,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -1091,7 +1091,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index b2e216e95e5504..76c31b86d02b30 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,24 +58,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; } @@ -504,11 +504,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -669,7 +669,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -729,7 +729,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -1029,11 +1029,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -1119,7 +1119,7 @@ server cluster OperationalCredentials = 62 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -1251,10 +1251,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -1309,7 +1309,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -1367,7 +1367,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index fe6fecc6a9dd26..39b212425bbdcc 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; } @@ -255,11 +255,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -294,7 +294,7 @@ server cluster GeneralDiagnostics = 51 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -354,7 +354,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -468,11 +468,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -558,12 +558,12 @@ server cluster OperationalCredentials = 62 { server cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; - readonly attribute char_string description = 2; + readonly attribute char_string<60> description = 2; readonly attribute int32u wiredAssessedCurrent = 6; readonly attribute enum8 batteryChargeLevel = 14; readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; - readonly attribute char_string batteryReplacementDescription = 19; + readonly attribute char_string<60> batteryReplacementDescription = 19; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; } @@ -576,7 +576,7 @@ server cluster PowerSourceConfiguration = 46 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -673,10 +673,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -731,7 +731,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -787,7 +787,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index e30623a820f786..1280aec975ace0 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -236,11 +236,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 09b4f798d20c84..24c3902d15b0d1 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster FixedLabel = 64 { @@ -70,7 +70,7 @@ server cluster GeneralCommissioning = 48 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -130,7 +130,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -280,11 +280,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index fae07dd1a603d8..c523bf72140131 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster Basic = 40 { @@ -22,16 +22,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -101,7 +101,7 @@ server cluster GeneralCommissioning = 48 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -161,7 +161,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -380,11 +380,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 07f3fde86630e9..017ff384f4d258 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -17,24 +17,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; } @@ -405,7 +405,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -508,11 +508,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 07f3fde86630e9..017ff384f4d258 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -17,24 +17,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; } @@ -405,7 +405,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -508,11 +508,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 058c65c234e391..77cdb21d6c9d85 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -244,11 +244,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -350,7 +350,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -410,7 +410,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -519,11 +519,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -719,7 +719,7 @@ server cluster PumpConfigurationAndControl = 512 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -830,10 +830,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -888,7 +888,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index fcc69efb730f52..799b1a2f3c2f8d 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -264,11 +264,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -370,7 +370,7 @@ client cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -430,7 +430,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -539,11 +539,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -714,7 +714,7 @@ client cluster PumpConfigurationAndControl = 512 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -818,10 +818,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -876,7 +876,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -932,7 +932,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 1943328215ef9a..b006355438a7df 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,16 +58,16 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; + readonly attribute char_string<64> softwareVersionString = 10; readonly global attribute int16u clusterRevision = 65533; } @@ -255,11 +255,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -294,7 +294,7 @@ server cluster GeneralDiagnostics = 51 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -354,7 +354,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -433,11 +433,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -586,7 +586,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 08678f8f9dd7f5..78dae4064c3ebd 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,24 +58,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -286,11 +286,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -340,7 +340,7 @@ server cluster GroupKeyManagement = 63 { INT16U fabricIndex = 0; INT16U groupId = 1; INT16U endpoints[] = 2; - CHAR_STRING groupName = 3; + CHAR_STRING<16> groupName = 3; } readonly attribute GroupKey groupKeyMap[] = 0; @@ -482,7 +482,7 @@ server cluster Identify = 3 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -542,7 +542,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -692,11 +692,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -882,7 +882,7 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -1046,10 +1046,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -1104,7 +1104,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -1160,7 +1160,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 2b896b3e017f27..5c437528c9034e 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AccountLogin = 1294 { @@ -76,13 +76,13 @@ server cluster ApplicationBasic = 1293 { CHAR_STRING applicationId = 1; } - readonly attribute char_string vendorName = 0; + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorId = 1; - readonly attribute char_string applicationName = 2; + readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; attribute ApplicationBasicApplication applicationApp = 4; readonly attribute ApplicationStatusEnum applicationStatus = 5; - readonly attribute char_string applicationVersion = 6; + readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; readonly global attribute int16u clusterRevision = 65533; } @@ -144,7 +144,7 @@ server cluster AudioOutput = 1291 { struct OutputInfo { INT8U index = 0; OutputTypeEnum outputType = 1; - CHAR_STRING name = 2; + CHAR_STRING<32> name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; @@ -180,23 +180,23 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -257,9 +257,9 @@ server cluster Channel = 1284 { struct ChannelInfo { INT16U majorNumber = 0; INT16U minorNumber = 1; - CHAR_STRING name = 2; - CHAR_STRING callSign = 3; - CHAR_STRING affiliateCallSign = 4; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> callSign = 3; + CHAR_STRING<32> affiliateCallSign = 4; } struct LineupInfo { @@ -628,11 +628,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -682,7 +682,7 @@ server cluster GroupKeyManagement = 63 { INT16U fabricIndex = 0; INT16U groupId = 1; INT16U endpoints[] = 2; - CHAR_STRING groupName = 3; + CHAR_STRING<16> groupName = 3; } readonly attribute GroupKey groupKeyMap[] = 0; @@ -877,7 +877,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -906,8 +906,8 @@ server cluster MediaInput = 1287 { struct InputInfo { INT8U index = 0; InputTypeEnum inputType = 1; - CHAR_STRING name = 2; - CHAR_STRING description = 3; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> description = 3; } readonly attribute InputInfo mediaInputList[] = 0; @@ -1045,7 +1045,7 @@ client cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -1164,7 +1164,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -1338,11 +1338,11 @@ client cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -1436,11 +1436,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -1533,7 +1533,7 @@ server cluster RelativeHumidityMeasurement = 1029 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -1560,7 +1560,7 @@ server cluster TargetNavigator = 1285 { struct TargetInfo { INT8U identifier = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; @@ -1659,10 +1659,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -1717,7 +1717,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -1730,7 +1730,7 @@ server cluster UserLabel = 65 { } server cluster WakeOnLan = 1283 { - readonly attribute char_string wakeOnLanMacAddress = 0; + readonly attribute char_string<32> wakeOnLanMacAddress = 0; readonly global attribute int16u clusterRevision = 65533; } @@ -1778,7 +1778,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index ed780da7f8b1a4..8febde8abf171a 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } client cluster AccountLogin = 1294 { @@ -67,12 +67,12 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - readonly attribute char_string vendorName = 0; + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorId = 1; - readonly attribute char_string applicationName = 2; + readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; readonly attribute ApplicationStatusEnum applicationStatus = 5; - readonly attribute char_string applicationVersion = 6; + readonly attribute char_string<32> applicationVersion = 6; readonly global attribute int16u clusterRevision = 65533; } @@ -122,7 +122,7 @@ client cluster AudioOutput = 1291 { struct OutputInfo { INT8U index = 0; OutputTypeEnum outputType = 1; - CHAR_STRING name = 2; + CHAR_STRING<32> name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; @@ -172,24 +172,24 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; @@ -224,19 +224,19 @@ server cluster Binding = 30 { } server cluster BridgedDeviceBasic = 57 { - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute int16u vendorID = 2; - readonly attribute char_string productName = 3; - attribute char_string nodeLabel = 5; + readonly attribute char_string<32> productName = 3; + attribute char_string<32> nodeLabel = 5; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; readonly attribute boolean reachable = 17; readonly global attribute int16u clusterRevision = 65533; @@ -259,9 +259,9 @@ client cluster Channel = 1284 { struct ChannelInfo { INT16U majorNumber = 0; INT16U minorNumber = 1; - CHAR_STRING name = 2; - CHAR_STRING callSign = 3; - CHAR_STRING affiliateCallSign = 4; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> callSign = 3; + CHAR_STRING<32> affiliateCallSign = 4; } struct LineupInfo { @@ -347,7 +347,7 @@ server cluster ColorControl = 768 { readonly attribute int16u currentX = 3; readonly attribute int16u currentY = 4; readonly attribute enum8 driftCompensation = 5; - readonly attribute char_string compensationText = 6; + readonly attribute char_string<254> compensationText = 6; readonly attribute int16u colorTemperature = 7; readonly attribute enum8 colorMode = 8; attribute bitmap8 colorControlOptions = 15; @@ -894,7 +894,7 @@ server cluster DoorLock = 257 { readonly attribute int8u maxPINCodeLength = 23; readonly attribute int8u minPINCodeLength = 24; readonly attribute bitmap8 credentialRulesSupport = 27; - attribute char_string language = 33; + attribute char_string<3> language = 33; attribute int32u autoRelockTime = 35; attribute int8u soundVolume = 36; attribute DlOperatingMode operatingMode = 37; @@ -1133,11 +1133,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -1187,7 +1187,7 @@ server cluster GroupKeyManagement = 63 { INT16U fabricIndex = 0; INT16U groupId = 1; INT16U endpoints[] = 2; - CHAR_STRING groupName = 3; + CHAR_STRING<16> groupName = 3; } readonly attribute GroupKey groupKeyMap[] = 0; @@ -1529,7 +1529,7 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -1552,8 +1552,8 @@ client cluster MediaInput = 1287 { struct InputInfo { INT8U index = 0; InputTypeEnum inputType = 1; - CHAR_STRING name = 2; - CHAR_STRING description = 3; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> description = 3; } readonly attribute InputInfo mediaInputList[] = 0; @@ -1674,7 +1674,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -1860,11 +1860,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -2064,7 +2064,7 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -2127,7 +2127,7 @@ client cluster TargetNavigator = 1285 { struct TargetInfo { INT8U identifier = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; @@ -2158,7 +2158,7 @@ server cluster TestCluster = 1295 { struct TestListStructOctet { INT64U fabricIndex = 0; - OCTET_STRING operationalCert = 1; + OCTET_STRING<32> operationalCert = 1; } info event TestEvent = 1 { @@ -2185,11 +2185,11 @@ server cluster TestCluster = 1295 { attribute int64s int64s = 20; attribute enum8 enum8 = 21; attribute enum16 enum16 = 22; - attribute octet_string octetString = 25; + attribute octet_string<10> octetString = 25; attribute INT8U listInt8u[] = 26; attribute OCTET_STRING listOctetString[] = 27; attribute TestListStructOctet listStructOctetString[] = 28; - attribute long_octet_string longOctetString = 29; + attribute long_octet_string<1000> longOctetString = 29; readonly global attribute int16u clusterRevision = 65533; response struct TestSpecificResponse { @@ -2306,10 +2306,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -2364,7 +2364,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -2377,7 +2377,7 @@ server cluster UserLabel = 65 { } server cluster WakeOnLan = 1283 { - readonly attribute char_string wakeOnLanMacAddress = 0; + readonly attribute char_string<32> wakeOnLanMacAddress = 0; readonly global attribute int16u clusterRevision = 65533; } @@ -2425,7 +2425,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index c7206c376b16e3..e71b4b3daa67f0 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } server cluster AdministratorCommissioning = 60 { @@ -58,21 +58,21 @@ server cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly global attribute int16u clusterRevision = 65533; @@ -232,11 +232,11 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -316,7 +316,7 @@ server cluster Identify = 3 { } server cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -376,7 +376,7 @@ server cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -461,11 +461,11 @@ server cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly attribute NOCStruct NOCs[] = 0; @@ -551,7 +551,7 @@ server cluster OperationalCredentials = 62 { server cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; - readonly attribute char_string description = 2; + readonly attribute char_string<60> description = 2; readonly attribute int32u batteryVoltage = 11; readonly attribute int8u batteryPercentRemaining = 12; readonly attribute int32u batteryTimeRemaining = 13; @@ -565,7 +565,7 @@ server cluster PowerSource = 47 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -662,10 +662,10 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -720,7 +720,7 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute bitmap32 featureMap = 65532; @@ -776,7 +776,7 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; diff --git a/src/app/zap-templates/partials/idl/structure_member.zapt b/src/app/zap-templates/partials/idl/structure_member.zapt index d64eeefbc98d53..142c0ad8abadff 100644 --- a/src/app/zap-templates/partials/idl/structure_member.zapt +++ b/src/app/zap-templates/partials/idl/structure_member.zapt @@ -1,7 +1,14 @@ {{~#if isOptional~}} optional {{/if~}} {{~#if isNullable~}} nullable {{/if~}} -{{type}} {{asLowerCamelCase label~}} +{{type}} + {{~#unless isArray~}} + {{~#if (isString type)~}} + {{~#if maxLength~}} + <{{maxLength}}> + {{~/if~}} + {{~/if}} + {{~/unless}} {{asLowerCamelCase label~}} {{~#if isArray~}} [] diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index efa88f812e1126..e59f9f15e4d630 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -41,10 +41,15 @@ {{~#unless isReportableAttribute~}} nosubscribe {{!marker to place a space even with whitespace removal~}} {{~/unless~}} - {{~!Removes spaces~}} attribute {{type}} {{asLowerCamelCase name~}} - {{~#if isList~}} - [] - {{~/if}} = {{code}}; + {{~!Removes spaces~}} attribute {{type}} + {{~#unless isArray~}} + {{~#if (isString type)~}} + {{~#if maxLength~}} + <{{maxLength}}> + {{~/if~}} + {{~/if~}} + {{/unless}} {{asLowerCamelCase name~}} + {{~#if isList~}} [] {{~/if}} = {{code}}; {{/chip_server_cluster_attributes}} {{#chip_cluster_commands}} {{#if arguments}} diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index dca196240a3623..e479750003ce92 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 0; - CHAR_STRING value = 1; + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; } client cluster AccessControl = 31 { @@ -43,7 +43,7 @@ client cluster AccessControl = 31 { struct ExtensionEntry { fabric_idx fabricIndex = 0; - OCTET_STRING data = 1; + OCTET_STRING<254> data = 1; } info event AccessControlEntryChanged = 0 { @@ -140,13 +140,13 @@ client cluster ApplicationBasic = 1293 { CHAR_STRING applicationId = 1; } - readonly attribute char_string vendorName = 0; + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorId = 1; - readonly attribute char_string applicationName = 2; + readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; attribute ApplicationBasicApplication applicationApp = 4; readonly attribute ApplicationStatusEnum applicationStatus = 5; - readonly attribute char_string applicationVersion = 6; + readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; @@ -204,7 +204,7 @@ client cluster AudioOutput = 1291 { struct OutputInfo { INT8U index = 0; OutputTypeEnum outputType = 1; - CHAR_STRING name = 2; + CHAR_STRING<32> name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; @@ -257,24 +257,24 @@ client cluster Basic = 40 { } readonly attribute int16u interactionModelVersion = 0; - readonly attribute char_string vendorName = 1; + readonly attribute char_string<32> vendorName = 1; readonly attribute vendor_id vendorID = 2; - readonly attribute char_string productName = 3; + readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string nodeLabel = 5; - attribute char_string location = 6; + attribute char_string<32> nodeLabel = 5; + attribute char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string hardwareVersionString = 8; + readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; - readonly attribute char_string softwareVersionString = 10; - readonly attribute char_string manufacturingDate = 11; - readonly attribute char_string partNumber = 12; - readonly attribute long_char_string productURL = 13; - readonly attribute char_string productLabel = 14; - readonly attribute char_string serialNumber = 15; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute char_string uniqueID = 18; + readonly attribute char_string<32> uniqueID = 18; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; @@ -352,7 +352,7 @@ client cluster BridgedActions = 37 { struct ActionStruct { INT16U actionID = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; ActionTypeEnum type = 2; INT16U endpointListID = 3; INT16U supportedCommands = 4; @@ -361,7 +361,7 @@ client cluster BridgedActions = 37 { struct EndpointListStruct { INT16U endpointListID = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; EndpointListTypeEnum type = 2; ENDPOINT_NO endpoints[] = 3; } @@ -381,7 +381,7 @@ client cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; - readonly attribute long_char_string setupUrl = 2; + readonly attribute long_char_string<512> setupUrl = 2; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; @@ -482,9 +482,9 @@ client cluster Channel = 1284 { struct ChannelInfo { INT16U majorNumber = 0; INT16U minorNumber = 1; - CHAR_STRING name = 2; - CHAR_STRING callSign = 3; - CHAR_STRING affiliateCallSign = 4; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> callSign = 3; + CHAR_STRING<32> affiliateCallSign = 4; } readonly attribute ChannelInfo channelList[] = 0; @@ -567,7 +567,7 @@ client cluster ColorControl = 768 { readonly attribute int16u currentX = 3; readonly attribute int16u currentY = 4; readonly attribute enum8 driftCompensation = 5; - readonly attribute char_string compensationText = 6; + readonly attribute char_string<254> compensationText = 6; readonly attribute int16u colorTemperature = 7; readonly attribute enum8 colorMode = 8; attribute bitmap8 colorControlOptions = 15; @@ -1171,7 +1171,7 @@ client cluster DoorLock = 257 { readonly attribute int16u numberOfPINUsersSupported = 18; readonly attribute int8u maxPINCodeLength = 23; readonly attribute int8u minPINCodeLength = 24; - attribute char_string language = 33; + attribute char_string<3> language = 33; attribute int32u autoRelockTime = 35; attribute int8u soundVolume = 36; attribute DlOperatingMode operatingMode = 37; @@ -1429,11 +1429,11 @@ client cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 0; + CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; BOOLEAN offPremiseServicesReachableIPv4 = 2; BOOLEAN offPremiseServicesReachableIPv6 = 3; - OCTET_STRING hardwareAddress = 4; + OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } @@ -1484,17 +1484,17 @@ client cluster GroupKeyManagement = 63 { INT16U fabricIndex = 0; INT16U groupId = 1; INT16U endpoints[] = 2; - CHAR_STRING groupName = 3; + CHAR_STRING<16> groupName = 3; } struct GroupKeySet { INT16U groupKeySetID = 0; GroupKeySecurityPolicy securityPolicy = 1; - OCTET_STRING epochKey0 = 2; + OCTET_STRING<16> epochKey0 = 2; INT64U epochStartTime0 = 3; - OCTET_STRING epochKey1 = 4; + OCTET_STRING<16> epochKey1 = 4; INT64U epochStartTime1 = 5; - OCTET_STRING epochKey2 = 6; + OCTET_STRING<16> epochKey2 = 6; INT64U epochStartTime2 = 7; } @@ -1845,7 +1845,7 @@ client cluster LevelControl = 8 { } client cluster LocalizationConfiguration = 43 { - attribute char_string activeLocale = 1; + attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; } @@ -1875,8 +1875,8 @@ client cluster MediaInput = 1287 { struct InputInfo { INT8U index = 0; InputTypeEnum inputType = 1; - CHAR_STRING name = 2; - CHAR_STRING description = 3; + CHAR_STRING<32> name = 2; + CHAR_STRING<32> description = 3; } readonly attribute InputInfo mediaInputList[] = 0; @@ -1956,7 +1956,7 @@ client cluster MediaPlayback = 1286 { client cluster ModeSelect = 80 { struct ModeOptionStruct { - CHAR_STRING label = 0; + CHAR_STRING<32> label = 0; INT8U mode = 1; INT32U semanticTag = 2; } @@ -1965,7 +1965,7 @@ client cluster ModeSelect = 80 { readonly attribute ModeOptionStruct supportedModes[] = 1; attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; - readonly attribute char_string description = 4; + readonly attribute char_string<32> description = 4; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; @@ -2032,7 +2032,7 @@ client cluster NetworkCommissioning = 49 { readonly attribute int8u connectMaxTimeSeconds = 3; attribute boolean interfaceEnabled = 4; readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute octet_string lastNetworkID = 6; + readonly attribute octet_string<32> lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; @@ -2312,11 +2312,11 @@ client cluster OperationalCredentials = 62 { struct FabricDescriptor { fabric_idx fabricIndex = 0; - OCTET_STRING rootPublicKey = 1; + OCTET_STRING<65> rootPublicKey = 1; INT16U vendorId = 2; FABRIC_ID fabricId = 3; NODE_ID nodeId = 4; - CHAR_STRING label = 5; + CHAR_STRING<32> label = 5; } readonly nosubscribe attribute NOCStruct NOCs[] = 0; @@ -2403,7 +2403,7 @@ client cluster OperationalCredentials = 62 { client cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; - readonly attribute char_string description = 2; + readonly attribute char_string<60> description = 2; readonly attribute int32u batteryVoltage = 11; readonly attribute int8u batteryPercentRemaining = 12; readonly attribute int32u batteryTimeRemaining = 13; @@ -2639,7 +2639,7 @@ client cluster Scenes = 5 { client cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; - CHAR_STRING name = 1; + CHAR_STRING<8> name = 1; INT32U stackFreeCurrent = 2; INT32U stackFreeMinimum = 3; INT32U stackSize = 4; @@ -2708,7 +2708,7 @@ client cluster TargetNavigator = 1285 { struct TargetInfo { INT8U identifier = 0; - CHAR_STRING name = 1; + CHAR_STRING<32> name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; @@ -2748,7 +2748,7 @@ client cluster TestCluster = 1295 { struct TestListStructOctet { INT64U fabricIndex = 0; - OCTET_STRING operationalCert = 1; + OCTET_STRING<32> operationalCert = 1; } struct NullablesAndOptionalsStruct { @@ -2827,13 +2827,13 @@ client cluster TestCluster = 1295 { attribute enum16 enum16 = 22; attribute single floatSingle = 23; attribute double floatDouble = 24; - attribute octet_string octetString = 25; + attribute octet_string<10> octetString = 25; attribute INT8U listInt8u[] = 26; attribute OCTET_STRING listOctetString[] = 27; attribute TestListStructOctet listStructOctetString[] = 28; - attribute long_octet_string longOctetString = 29; - attribute char_string charString = 30; - attribute long_char_string longCharString = 31; + attribute long_octet_string<1000> longOctetString = 29; + attribute char_string<10> charString = 30; + attribute long_char_string<1000> longCharString = 31; attribute epoch_us epochUs = 32; attribute epoch_s epochS = 33; attribute vendor_id vendorId = 34; @@ -2872,8 +2872,8 @@ client cluster TestCluster = 1295 { attribute enum16 nullableEnum16 = 32790; attribute single nullableFloatSingle = 32791; attribute double nullableFloatDouble = 32792; - attribute octet_string nullableOctetString = 32793; - attribute char_string nullableCharString = 32798; + attribute octet_string<10> nullableOctetString = 32793; + attribute char_string<10> nullableCharString = 32798; attribute SimpleEnum nullableEnumAttr = 32804; attribute SimpleStruct nullableStruct = 32805; attribute int8u nullableRangeRestrictedInt8u = 32806; @@ -3150,10 +3150,10 @@ client cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u channel = 0; readonly attribute enum8 routingRole = 1; - readonly attribute octet_string networkName = 2; + readonly attribute octet_string<16> networkName = 2; readonly attribute int16u panId = 3; readonly attribute int64u extendedPanId = 4; - readonly attribute octet_string meshLocalPrefix = 5; + readonly attribute octet_string<17> meshLocalPrefix = 5; readonly attribute int64u overrunCount = 6; readonly attribute NeighborTable neighborTableList[] = 7; readonly attribute RouteTable routeTableList[] = 8; @@ -3208,7 +3208,7 @@ client cluster ThreadNetworkDiagnostics = 53 { readonly attribute int64u pendingTimestamp = 57; readonly attribute int32u delay = 58; readonly attribute SecurityPolicy securityPolicy[] = 59; - readonly attribute octet_string channelMask = 60; + readonly attribute octet_string<4> channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; readonly global attribute attrib_id attributeList[] = 65531; @@ -3224,7 +3224,7 @@ client cluster UserLabel = 65 { } client cluster WakeOnLan = 1283 { - readonly attribute char_string wakeOnLanMacAddress = 0; + readonly attribute char_string<32> wakeOnLanMacAddress = 0; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; } @@ -3273,7 +3273,7 @@ client cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - readonly attribute octet_string bssid = 0; + readonly attribute octet_string<6> bssid = 0; readonly attribute enum8 securityType = 1; readonly attribute enum8 wiFiVersion = 2; readonly attribute int16u channelNumber = 3; From 7e09d153c9a6178d37ab10ee975835a9ec77c484 Mon Sep 17 00:00:00 2001 From: Sergei Lissianoi <54454955+selissia@users.noreply.github.com> Date: Thu, 20 Jan 2022 22:34:14 -0500 Subject: [PATCH 06/14] [OTA] Update matter-devices.xml for OTA devices, update README for the OTA Requestor (#13718) * Correct the info for the OTA devices * Add clean-up steps and example for the OTA reference apps on Linux * Add steps for buildind the bootable image * Restyled by prettier-markdown * Fix typos * Restyled by prettier-markdown * Add gbl file extension * Add extra step description * Restyled by prettier-markdown Co-authored-by: Restyled.io --- .github/.wordlist.txt | 1 + examples/ota-requestor-app/efr32/README.md | 31 ++++++++++---- examples/ota-requestor-app/linux/README.md | 41 ++++++++++++++++--- .../zcl/data-model/chip/matter-devices.xml | 7 ++-- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 9886a40b4d99a9..decf90b2a8cbc7 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -416,6 +416,7 @@ fsl fstab fsync fullclean +gbl gcloud GDB GeneralCommissioning diff --git a/examples/ota-requestor-app/efr32/README.md b/examples/ota-requestor-app/efr32/README.md index b36f7606d37f81..17ff79afe3a1b2 100644 --- a/examples/ota-requestor-app/efr32/README.md +++ b/examples/ota-requestor-app/efr32/README.md @@ -1,4 +1,4 @@ -#CHIP EFR32 OTA Requestor Example +# CHIP EFR32 OTA Requestor Example An example showing the use of the Matter OTA Requestor functionality on the Silicon Labs EFR32 MG12. @@ -9,7 +9,7 @@ Silicon Labs EFR32 MG12. The EFR32 OTA Requestor example provides a baseline demonstration the Matter OTA Requestor functionality built with the Silicon Labs gecko SDK. It can be -controlled by a Chip controller over Openthread network.. +controlled by a Chip controller over OpenThread network. @@ -48,6 +48,8 @@ examples/lighting-app/efr32/README.md $ cd ~/connectedhomeip $ rm -rf ./out/ + + ## Flashing the Application - On the command line: @@ -61,11 +63,13 @@ examples/lighting-app/efr32/README.md ## Viewing Logging Output -See examples/lighting-app/efr32/README.md +See `examples/lighting-app/efr32/README.md` + + ## Running the OTA Download scenario -- Bring up the Open Thread Border Router as discussed in +- Bring up the OpenThread Border Router as discussed in examples/lighting-app/efr32/README.md and get its operational dataset. - On a Linux or Darwin platform build the chip-tool and the ota-provider-app @@ -74,10 +78,19 @@ See examples/lighting-app/efr32/README.md scripts/examples/gn_build_example.sh examples/chip-tool out/ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false -- In a terminal start the provider app passing to it the path to the image - file that the Requestor is supposed to download (for example /tmp/ota.out): +- Build or download the Gecko Bootloader binary. Bootloader should be built + with the Gecko SDK version 3.2.1 or earlier, type "external SPI" configured + with a single slot of at least 1000 KB. Using the commander tool upload the + bootloader to the device running the requestor application. + +- Create a bootable image file: + + commander gbl create chip-efr32-ota-requestor-example.gbl --app chip-efr32-ota-requestor-example.s37 + +- In a terminal start the provider app passing to it the path to the bootable + image file created in the previous step: - ./out/debug/chip-ota-provider-app -f /tmp/ota.out + ./out/debug/chip-ota-provider-app -f chip-efr32-ota-requestor-example.gbl - In a separate terminal run the chip-tool commands to provision the Provider: @@ -91,10 +104,12 @@ See examples/lighting-app/efr32/README.md ./out/chip-tool pairing ble-thread 2 hex: 73141520 3840 -where operationalDataset is obtained from the Open Thread Border Router. +where operationalDataset is obtained from the OpenThread Border Router. - Once the commissioning process completes enter: ./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 - The Requestor will connect to the Provider and start the image download. + Once the image is downloaded the Requestor will reboot into the downloaded + image. diff --git a/examples/ota-requestor-app/linux/README.md b/examples/ota-requestor-app/linux/README.md index fed5e9462b264f..a00a608dda2ca9 100644 --- a/examples/ota-requestor-app/linux/README.md +++ b/examples/ota-requestor-app/linux/README.md @@ -57,6 +57,42 @@ In terminal 2: - `${REQUESTOR_LONG_DISCRIMINATOR}` is the long discriminator of the ota-requestor-app specified in terminal 3 above +``` +./chip-tool otasoftwareupdaterequestor announce-ota-provider ${PROVIDER_NODE_ID} 0 0 0 ${REQUESTOR_NODE_ID} 0 +``` + +- `${PROVIDER_NODE_ID}` is the node ID of the ota-provider-app assigned to it + during the pairing step above +- `${REQUESTOR_NODE_ID}` is the node ID of the ota-requestor-app assigned to + it during the pairing step above + +## Note + +When the Provider, Requestor and chip-tool are run on the same Linux node the +user must issue `rm -r /tmp/chip_*` before starting the Provider and +`rm /tmp/chip_kvs` before starting the Requestor. These commands reset the +shared Key Value Store to a consistent state. + +## Example + +Building: + +``` +scripts/examples/gn_build_example.sh examples/chip-tool out/ chip_config_network_layer_ble=false && scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false && scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false +``` + +Running (in separate terminals as described above): + +``` +rm -r /tmp/chip_* +./out/debug/chip-ota-provider-app -f /tmp/ota.txt +./out/chip-tool pairing onnetwork 1 20202021 +rm /tmp/chip_kvs +./out/debug/chip-ota-requestor-app -u 5560 -d 42 +./out/chip-tool pairing onnetwork-long 2 20202021 42 +./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 +``` + ## Current Features / Limitations ### Features @@ -68,10 +104,5 @@ In terminal 2: ### Limitations -- Needs chip-tool to commission the OTA Provider device first because the Node - ID and IP Address of the OTA Provider must be supplied to this reference - application -- Does not verify QueryImageResponse message contents - Stores the downloaded file in the directory this reference app is launched from -- Does not support AnnounceOTAProvider command or OTA Requestor attributes diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index cbffc3de0cc5cc..80b9e817da4f4e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -106,9 +106,9 @@ limitations under the License. - MA-otarequester + MA-otarequestor CHIP - Matter OTA Requester + Matter OTA Requestor 0x0103 0x0012 @@ -129,7 +129,7 @@ limitations under the License. BINDING - + @@ -156,6 +156,7 @@ limitations under the License. BINDING + From dd209ce270725a3e1be181494e0fe34eeebbae3e Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 21 Jan 2022 09:46:34 +0530 Subject: [PATCH 07/14] [ESP32] CLI option to set delayed action time in OTA Provider app and restart OTA Requestor once ApplyUpdate is successful (#13620) * [ESP32] CLI option to set delayedActionTime in OTA Provider app Also, modify Linux OTA Provider help for delayedActionTime cli option * [ESP32] Schedule the restart once OTA image apply is successful Also, Apply suggestion from #13484 in lighting-app * Review comments * Fix a small typo * Apply suggestions from code review Co-authored-by: Carol Yang Co-authored-by: Carol Yang --- .github/.wordlist.txt | 1 + examples/lighting-app/esp32/README.md | 11 +-- examples/lighting-app/esp32/main/main.cpp | 4 +- examples/ota-provider-app/esp32/README.md | 9 ++ .../esp32/main/CMakeLists.txt | 1 + .../esp32/main/OTAProviderCommands.cpp | 87 +++++++++++++++++++ .../esp32/main/include/OTAProviderCommands.h | 51 +++++++++++ examples/ota-provider-app/esp32/main/main.cpp | 36 +++----- .../ota-provider-app/esp32/sdkconfig.defaults | 3 + examples/ota-provider-app/linux/main.cpp | 3 +- examples/ota-requestor-app/esp32/README.md | 5 +- src/platform/ESP32/OTAImageProcessorImpl.cpp | 11 +++ 12 files changed, 185 insertions(+), 37 deletions(-) create mode 100644 examples/ota-provider-app/esp32/main/OTAProviderCommands.cpp create mode 100644 examples/ota-provider-app/esp32/main/include/OTAProviderCommands.h diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index decf90b2a8cbc7..ecb117a47dd600 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -726,6 +726,7 @@ OTA OTADownloader OTAImageProcessorDriver OTAImageProcessorInterface +OTAProvider OTAProviderIpAddress OTAProviderNodeId OTAProviderSerialPort diff --git a/examples/lighting-app/esp32/README.md b/examples/lighting-app/esp32/README.md index 534e6ec3df0c16..51ca945b63140d 100644 --- a/examples/lighting-app/esp32/README.md +++ b/examples/lighting-app/esp32/README.md @@ -142,10 +142,10 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c hello-world.bin can be obtained from compiling the hello-world ESP-IDF example. -- Provision the Linux OTA Provider using chip-tool +- Commission the Linux OTA Provider using chip-tool ``` -./out/debug/chip-tool pairing onnetwork 12345 20202021 +./out/debug/chip-tool pairing onnetwork 12346 20202021 ``` ## Query for an OTA Image @@ -154,10 +154,11 @@ After commissioning is successful, press Enter in requestor device console and type below query. ``` ->matter ota query 1 12345 0 +>matter ota query 1 12346 0 ``` ## Apply update -Once transfer is complete, reboot the device manually to boot from upgraded OTA -image. +Once the transfer is complete, OTA requestor sends ApplyUpdateRequest command to +OTA provider for applying the image. Device will restart on successful +application of OTA image. diff --git a/examples/lighting-app/esp32/main/main.cpp b/examples/lighting-app/esp32/main/main.cpp index b26a2fa6afd2e6..c3114e04c2b363 100644 --- a/examples/lighting-app/esp32/main/main.cpp +++ b/examples/lighting-app/esp32/main/main.cpp @@ -57,12 +57,10 @@ static void InitOTARequestor(void) { #if CONFIG_ENABLE_OTA_REQUESTOR SetRequestorInstance(&gRequestorCore); - gRequestorCore.SetServerInstance(&Server::GetInstance()); - gRequestorCore.SetOtaRequestorDriver(&gRequestorUser); + gRequestorCore.Init(&Server::GetInstance(), &gRequestorUser, &gDownloader); gImageProcessor.SetOTADownloader(&gDownloader); gDownloader.SetImageProcessorDelegate(&gImageProcessor); gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - gRequestorCore.SetBDXDownloader(&gDownloader); #endif } diff --git a/examples/ota-provider-app/esp32/README.md b/examples/ota-provider-app/esp32/README.md index c849db6afd95d6..af830a81c95c45 100644 --- a/examples/ota-provider-app/esp32/README.md +++ b/examples/ota-provider-app/esp32/README.md @@ -41,6 +41,15 @@ idf.py -p flash ./out/debug/chip-tool pairing ble-wifi 12345 20202021 3841 ``` +## Set delayed action time (Optional) + +- Set delayed action time in the Query Image Response and Apply Update + Response, default is zero. + +``` +> matter OTAProvider delay +``` + --- Once OTA provider is commissioned then head over to diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index 2d673860ea9668..bba24522ae33ad 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -48,6 +48,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" EXCLUDE_SRCS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp" PRIV_REQUIRES chip QRCode bt console spiffs) diff --git a/examples/ota-provider-app/esp32/main/OTAProviderCommands.cpp b/examples/ota-provider-app/esp32/main/OTAProviderCommands.cpp new file mode 100644 index 00000000000000..58bf1ee1320f16 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/OTAProviderCommands.cpp @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +namespace chip { +namespace Shell { +namespace { + +OTAProviderExample * exampleOTAProvider = nullptr; +Shell::Engine sSubShell; + +CHIP_ERROR DelayedActionTimeHandler(int argc, char ** argv) +{ + VerifyOrReturnError(argc == 1, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(exampleOTAProvider != nullptr, CHIP_ERROR_INCORRECT_STATE); + + const uint32_t delay = strtoul(argv[0], nullptr, 10); + exampleOTAProvider->SetDelayedActionTimeSec(delay); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAProviderHandler(int argc, char ** argv) +{ + if (argc == 0) + { + sSubShell.ForEachCommand(PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; + } + + CHIP_ERROR error = sSubShell.ExecCommand(argc, argv); + + if (error != CHIP_NO_ERROR) + { + streamer_printf(streamer_get(), "Error: %" CHIP_ERROR_FORMAT "\r\n", error.Format()); + } + + return error; +} +} // namespace + +void OTAProviderCommands::Register() +{ + // These commands can be moved to src/lib/shell/commands/Ota.cpp along with the other OTA commands. + // But as of now only Linux and ESP32 platforms supports OTA provider + + // Register subcommands of the `OTAProvider` commands. + static const shell_command_t subCommands[] = { + { &DelayedActionTimeHandler, "delay", + "Set delayed action time for QueryImageResponse and ApplyUpdateResponse\n" + "Usage: OTAProvider delay " }, + }; + + sSubShell.RegisterCommands(subCommands, ArraySize(subCommands)); + + // Register the root `OTA Provider` command in the top-level shell. + static const shell_command_t otaProviderCommand = { &OTAProviderHandler, "OTAProvider", "OTA Provider commands" }; + + Engine::Root().RegisterCommands(&otaProviderCommand, 1); +} + +// Set Example OTA provider +void OTAProviderCommands::SetExampleOTAProvider(OTAProviderExample * otaProvider) +{ + exampleOTAProvider = otaProvider; +} + +} // namespace Shell +} // namespace chip diff --git a/examples/ota-provider-app/esp32/main/include/OTAProviderCommands.h b/examples/ota-provider-app/esp32/main/include/OTAProviderCommands.h new file mode 100644 index 00000000000000..25eaa0cea6262e --- /dev/null +++ b/examples/ota-provider-app/esp32/main/include/OTAProviderCommands.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +namespace chip { +namespace Shell { + +class OTAProviderCommands +{ +public: + // delete the copy constructor + OTAProviderCommands(const OTAProviderCommands &) = delete; + // delete the move constructor + OTAProviderCommands(OTAProviderCommands &&) = delete; + // delete the assignment operator + OTAProviderCommands & operator=(const OTAProviderCommands &) = delete; + + static OTAProviderCommands & GetInstance() + { + static OTAProviderCommands instance; + return instance; + } + + // Register the OTA provider commands + void Register(); + + // Set Example OTA provider + void SetExampleOTAProvider(OTAProviderExample * otaProvider); + +private: + OTAProviderCommands() {} +}; + +} // namespace Shell +} // namespace chip diff --git a/examples/ota-provider-app/esp32/main/main.cpp b/examples/ota-provider-app/esp32/main/main.cpp index bd64837a3eb710..7c5ea0aa337e93 100644 --- a/examples/ota-provider-app/esp32/main/main.cpp +++ b/examples/ota-provider-app/esp32/main/main.cpp @@ -17,36 +17,25 @@ #include "CHIPDeviceManager.h" #include "DeviceCallbacks.h" -#include "esp_heap_caps_init.h" #include "esp_log.h" -#include "esp_netif.h" #include "esp_spi_flash.h" #include "esp_spiffs.h" -#include "esp_system.h" -#include "esp_wifi.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" #include "nvs_flash.h" -#include #include -#include - -#include -#include -#include -#include - #include #include - #include +#include +#include #include #include #include +#include using chip::Callback::Callback; using namespace ::chip; +using namespace ::chip::Shell; using namespace ::chip::System; using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; @@ -130,17 +119,6 @@ extern "C" void app_main() { ESP_LOGI(TAG, "OTA Provider!"); - /* Print chip information */ - esp_chip_info_t chip_info; - esp_chip_info(&chip_info); - ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores, - (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : ""); - - ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision); - - ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), - (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); - // Initialize the ESP NVS layer. esp_err_t err = nvs_flash_init(); if (err != ESP_OK) @@ -216,4 +194,10 @@ extern "C" void app_main() } chip::app::Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, &otaProvider); + + // Launch a chip shell and register OTA Provider Commands + chip::LaunchShell(); + OTAProviderCommands & otaProviderCommands = OTAProviderCommands::GetInstance(); + otaProviderCommands.SetExampleOTAProvider(&otaProvider); + otaProviderCommands.Register(); } diff --git a/examples/ota-provider-app/esp32/sdkconfig.defaults b/examples/ota-provider-app/esp32/sdkconfig.defaults index aaae13fbb5c092..89258be810acd8 100644 --- a/examples/ota-provider-app/esp32/sdkconfig.defaults +++ b/examples/ota-provider-app/esp32/sdkconfig.defaults @@ -55,3 +55,6 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB" # discriminator CONFIG_USE_TEST_SETUP_DISCRIMINATOR=0xF01 + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y diff --git a/examples/ota-provider-app/linux/main.cpp b/examples/ota-provider-app/linux/main.cpp index 9242ab780e41ce..733d40f35b1283 100644 --- a/examples/ota-provider-app/linux/main.cpp +++ b/examples/ota-provider-app/linux/main.cpp @@ -124,7 +124,8 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " -q/--QueryImageBehavior \n" " Status value in the Query Image Response\n" " -d/--DelayedActionTimeSec