diff --git a/config/ameba/chip.cmake b/config/ameba/chip.cmake index 8de905ae3a9a95..d221ab57352f94 100644 --- a/config/ameba/chip.cmake +++ b/config/ameba/chip.cmake @@ -107,7 +107,7 @@ string(APPEND CHIP_GN_ARGS "ameba_cc = \"arm-none-eabi-gcc\"\n") string(APPEND CHIP_GN_ARGS "ameba_cxx = \"arm-none-eabi-c++\"\n") string(APPEND CHIP_GN_ARGS "ameba_cpu = \"ameba\"\n") string(APPEND CHIP_GN_ARGS "chip_inet_config_enable_ipv4 = false\n") -string(APPEND CHIP_GN_ARGS "chip_use_transitional_commissionable_data_provider = false\n") +string(APPEND CHIP_GN_ARGS "chip_use_transitional_commissionable_data_provider = true\n") # Enable persistent storage audit if (matter_enable_persistentstorage_audit) 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 44a9d73de933bf..7d5c990db66e81 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 @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -127,16 +132,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -560,6 +565,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -568,12 +579,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -1167,6 +1172,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -1305,15 +1325,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -1325,6 +1336,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1623,6 +1643,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1641,21 +1676,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1964,12 +1984,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1979,6 +1993,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -2067,16 +2087,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -2135,6 +2155,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2146,6 +2171,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2176,17 +2206,17 @@ server cluster ModeSelect = 80 { kDeponoff = 0x1; } + struct SemanticTagStruct { + vendor_id mfgCode = 0; + enum16 value = 1; + } + struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; SemanticTagStruct semanticTags[] = 2; } - struct SemanticTagStruct { - vendor_id mfgCode = 0; - enum16 value = 1; - } - readonly attribute char_string<32> description = 0; readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; @@ -3670,6 +3700,13 @@ server cluster Channel = 1284 { optional char_string affiliateCallSign = 4; } + struct LineupInfoStruct { + char_string operatorName = 0; + optional char_string lineupName = 1; + optional char_string postalCode = 2; + LineupInfoTypeEnum lineupInfoType = 3; + } + readonly attribute ChannelInfoStruct channelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -3737,6 +3774,11 @@ server cluster MediaPlayback = 1286 { kVariableSpeed = 0x2; } + struct PlaybackPositionStruct { + epoch_us updatedAt = 0; + nullable int64u position = 1; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute nullable epoch_us startTime = 1; readonly attribute nullable int64u duration = 2; @@ -3976,8 +4018,15 @@ server cluster ContentLauncher = 1290 { kHls = 0x2; } - struct ContentSearchStruct { - ParameterStruct parameterList[] = 0; + struct DimensionStruct { + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct ParameterStruct { @@ -3986,9 +4035,14 @@ server cluster ContentLauncher = 1290 { optional AdditionalInfoStruct externalIDList[] = 2; } - struct AdditionalInfoStruct { - char_string name = 0; - char_string value = 1; + struct ContentSearchStruct { + ParameterStruct parameterList[] = 0; + } + + struct StyleInformationStruct { + optional char_string imageURL = 0; + optional char_string color = 1; + optional DimensionStruct size = 2; } struct BrandingInformationStruct { @@ -4000,18 +4054,6 @@ server cluster ContentLauncher = 1290 { optional StyleInformationStruct waterMark = 5; } - struct StyleInformationStruct { - optional char_string imageURL = 0; - optional char_string color = 1; - optional DimensionStruct size = 2; - } - - struct DimensionStruct { - double width = 0; - double height = 1; - MetricTypeEnum metric = 2; - } - readonly attribute CHAR_STRING acceptHeader[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -4070,6 +4112,11 @@ server cluster ApplicationLauncher = 1292 { char_string applicationID = 1; } + struct ApplicationEPStruct { + ApplicationStruct application = 0; + optional endpoint_no endpoint = 1; + } + readonly attribute INT16U catalogList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -4088,6 +4135,11 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; + } + readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; @@ -4210,26 +4262,6 @@ server cluster UnitTesting = 4294048773 { kValueC = 0x4; } - struct TestListStructOctet { - int64u member1 = 0; - octet_string<32> member2 = 1; - } - - struct NullablesAndOptionalsStruct { - nullable int16u nullableInt = 0; - optional int16u optionalInt = 1; - optional nullable int16u nullableOptionalInt = 2; - nullable char_string nullableString = 3; - optional char_string optionalString = 4; - optional nullable char_string nullableOptionalString = 5; - nullable SimpleStruct nullableStruct = 6; - optional SimpleStruct optionalStruct = 7; - optional nullable SimpleStruct nullableOptionalStruct = 8; - nullable SimpleEnum nullableList[] = 9; - optional SimpleEnum optionalList[] = 10; - optional nullable SimpleEnum nullableOptionalList[] = 11; - } - struct SimpleStruct { int8u a = 0; boolean b = 1; @@ -4252,6 +4284,21 @@ server cluster UnitTesting = 4294048773 { fabric_idx fabricIndex = 254; } + struct NullablesAndOptionalsStruct { + nullable int16u nullableInt = 0; + optional int16u optionalInt = 1; + optional nullable int16u nullableOptionalInt = 2; + nullable char_string nullableString = 3; + optional char_string optionalString = 4; + optional nullable char_string nullableOptionalString = 5; + nullable SimpleStruct nullableStruct = 6; + optional SimpleStruct optionalStruct = 7; + optional nullable SimpleStruct nullableOptionalStruct = 8; + nullable SimpleEnum nullableList[] = 9; + optional SimpleEnum optionalList[] = 10; + optional nullable SimpleEnum nullableOptionalList[] = 11; + } + struct NestedStruct { int8u a = 0; boolean b = 1; @@ -4268,6 +4315,15 @@ server cluster UnitTesting = 4294048773 { int8u g[] = 6; } + struct DoubleNestedStructList { + NestedStructList a[] = 0; + } + + struct TestListStructOctet { + int64u member1 = 0; + octet_string<32> member2 = 1; + } + info event TestEvent = 1 { INT8U arg1 = 1; SimpleEnum arg2 = 2; diff --git a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp index 4c1b55fbddb9fc..d0db78341501a5 100644 --- a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp @@ -28,11 +28,15 @@ #include "CHIPDeviceManager.h" #include #include +#include +#include +#include #include #include #include using namespace ::chip; +using namespace ::chip::Credentials; namespace chip { @@ -40,6 +44,8 @@ namespace DeviceManager { using namespace ::chip::DeviceLayer; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) { CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); @@ -61,6 +67,19 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); + err = mFactoryDataProvider.Init(); + if (err == CHIP_NO_ERROR) + { + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + } + else + { + ChipLogProgress(DeviceLayer, "Using example DAC provider"); + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + } + if (CONFIG_NETWORK_LAYER_BLE) { ConnectivityMgr().SetBLEAdvertisingEnabled(true); diff --git a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp index 3f1d88621bdbfb..b31d2629af14aa 100644 --- a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ case DeviceEventType::kCommissioningComplete: ChipLogProgress(DeviceLayer, "Commissioning Complete"); + chip::DeviceLayer::Internal::AmebaUtils::SetCurrentProvisionedNetwork(); break; } } @@ -142,8 +144,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event chip::app::DnssdServer::Instance().StartServer(); #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Init OTA requestor only when we have gotten IPv6 address - if (OTAInitializer::Instance().CheckInit()) + if (!OTAInitializer::Instance().CheckInit()) { + ChipLogProgress(DeviceLayer, "Initializing OTA"); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); } diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index c0e918e2082a86..c8b2e9a4333e14 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -31,11 +31,8 @@ #include #include #include -#include -#include #include #include -#include #include #include #include @@ -51,7 +48,6 @@ #endif using namespace ::chip; -using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; using namespace ::chip::DeviceLayer; using namespace ::chip::System; @@ -122,7 +118,6 @@ Identify gIdentify1 = { static DeviceCallbacks EchoCallbacks; chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; -chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; static void InitServer(intptr_t context) { @@ -158,10 +153,6 @@ extern "C" void ChipTest(void) initPref(); - mFactoryDataProvider.Init(); - SetCommissionableDataProvider(&mFactoryDataProvider); - SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); - CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); err = deviceMgr.Init(&EchoCallbacks); @@ -170,10 +161,6 @@ extern "C" void ChipTest(void) ChipLogError(DeviceLayer, "DeviceManagerInit() - ERROR!\r\n"); } - // Set DeviceInstanceInfoProvider after CHIPDeviceManager init - // CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first - SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0); statusLED1.Init(STATUS_LED_GPIO_NUM); diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 686a046c6fb25e..059bdeae17cece 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -1,16 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - struct ApplicationStruct { int16u catalogVendorID = 0; char_string applicationID = 1; } +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -126,16 +126,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -437,6 +437,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -445,10 +451,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -1026,6 +1031,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -1161,15 +1181,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -1181,6 +1192,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1397,6 +1417,14 @@ server cluster SoftwareDiagnostics = 52 { kWaterMarks = 0x1; } + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + info event SoftwareFault = 0 { INT64U id = 0; optional CHAR_STRING name = 1; @@ -1459,6 +1487,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1477,21 +1520,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1736,12 +1764,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1751,6 +1773,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1839,16 +1867,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1907,6 +1935,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1918,6 +1951,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1948,17 +1986,17 @@ server cluster ModeSelect = 80 { kDeponoff = 0x1; } + struct SemanticTagStruct { + vendor_id mfgCode = 0; + enum16 value = 1; + } + struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; SemanticTagStruct semanticTags[] = 2; } - struct SemanticTagStruct { - vendor_id mfgCode = 0; - enum16 value = 1; - } - readonly attribute char_string<32> description = 0; readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; @@ -2975,6 +3013,21 @@ server cluster Channel = 1284 { kLineupInfo = 0x2; } + struct ChannelInfoStruct { + int16u majorNumber = 0; + int16u minorNumber = 1; + optional char_string name = 2; + optional char_string callSign = 3; + optional char_string affiliateCallSign = 4; + } + + struct LineupInfoStruct { + char_string operatorName = 0; + optional char_string lineupName = 1; + optional char_string postalCode = 2; + LineupInfoTypeEnum lineupInfoType = 3; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3052,6 +3105,11 @@ server cluster MediaPlayback = 1286 { kVariableSpeed = 0x2; } + struct PlaybackPositionStruct { + epoch_us updatedAt = 0; + nullable int64u position = 1; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -3289,8 +3347,15 @@ server cluster ContentLauncher = 1290 { kHls = 0x2; } - struct ContentSearchStruct { - ParameterStruct parameterList[] = 0; + struct DimensionStruct { + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct ParameterStruct { @@ -3299,9 +3364,14 @@ server cluster ContentLauncher = 1290 { optional AdditionalInfoStruct externalIDList[] = 2; } - struct AdditionalInfoStruct { - char_string name = 0; - char_string value = 1; + struct ContentSearchStruct { + ParameterStruct parameterList[] = 0; + } + + struct StyleInformationStruct { + optional char_string imageURL = 0; + optional char_string color = 1; + optional DimensionStruct size = 2; } struct BrandingInformationStruct { @@ -3313,18 +3383,6 @@ server cluster ContentLauncher = 1290 { optional StyleInformationStruct waterMark = 5; } - struct StyleInformationStruct { - optional char_string imageURL = 0; - optional char_string color = 1; - optional DimensionStruct size = 2; - } - - struct DimensionStruct { - double width = 0; - double height = 1; - MetricTypeEnum metric = 2; - } - readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3382,6 +3440,16 @@ server cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; + } + + struct ApplicationEPStruct { + ApplicationStruct application = 0; + optional endpoint_no endpoint = 1; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3421,6 +3489,11 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; + } + readonly attribute char_string<32> applicationName = 2; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; @@ -3504,26 +3577,6 @@ server cluster UnitTesting = 4294048773 { kValueC = 0x4; } - struct TestListStructOctet { - int64u member1 = 0; - octet_string<32> member2 = 1; - } - - struct NullablesAndOptionalsStruct { - nullable int16u nullableInt = 0; - optional int16u optionalInt = 1; - optional nullable int16u nullableOptionalInt = 2; - nullable char_string nullableString = 3; - optional char_string optionalString = 4; - optional nullable char_string nullableOptionalString = 5; - nullable SimpleStruct nullableStruct = 6; - optional SimpleStruct optionalStruct = 7; - optional nullable SimpleStruct nullableOptionalStruct = 8; - nullable SimpleEnum nullableList[] = 9; - optional SimpleEnum optionalList[] = 10; - optional nullable SimpleEnum nullableOptionalList[] = 11; - } - struct SimpleStruct { int8u a = 0; boolean b = 1; @@ -3546,6 +3599,21 @@ server cluster UnitTesting = 4294048773 { fabric_idx fabricIndex = 254; } + struct NullablesAndOptionalsStruct { + nullable int16u nullableInt = 0; + optional int16u optionalInt = 1; + optional nullable int16u nullableOptionalInt = 2; + nullable char_string nullableString = 3; + optional char_string optionalString = 4; + optional nullable char_string nullableOptionalString = 5; + nullable SimpleStruct nullableStruct = 6; + optional SimpleStruct optionalStruct = 7; + optional nullable SimpleStruct nullableOptionalStruct = 8; + nullable SimpleEnum nullableList[] = 9; + optional SimpleEnum optionalList[] = 10; + optional nullable SimpleEnum nullableOptionalList[] = 11; + } + struct NestedStruct { int8u a = 0; boolean b = 1; @@ -3562,6 +3630,15 @@ server cluster UnitTesting = 4294048773 { int8u g[] = 6; } + struct DoubleNestedStructList { + NestedStructList a[] = 0; + } + + struct TestListStructOctet { + int64u member1 = 0; + octet_string<32> member2 = 1; + } + info event TestEvent = 1 { INT8U arg1 = 1; SimpleEnum arg2 = 2; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index c5f6f776539515..daba86d8bc6f4d 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -335,6 +345,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -343,12 +359,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -711,15 +721,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -731,6 +732,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1027,6 +1037,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1045,21 +1070,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1364,12 +1374,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1379,6 +1383,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1467,16 +1477,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 53052304d1a966..0123dcc0301281 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -318,6 +328,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -326,12 +342,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -367,6 +377,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -895,6 +910,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -913,21 +943,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1233,12 +1248,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1248,6 +1257,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1336,16 +1351,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 434105121f53d5..91b0651858b406 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -317,6 +327,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -325,12 +341,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -675,15 +685,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -695,6 +696,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1006,12 +1016,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1021,6 +1025,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1109,16 +1119,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 8f8fd0286ebec2..498da4410bed50 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -169,6 +179,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -177,12 +193,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -218,6 +228,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -567,15 +582,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -587,6 +593,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -948,12 +963,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -963,6 +972,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1051,16 +1066,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 73d480c465be44..d55d5d4ce828bd 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -318,6 +328,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -326,12 +342,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -367,6 +377,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -716,15 +731,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -736,6 +742,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1097,12 +1112,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1112,6 +1121,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1200,16 +1215,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 73050c9a59691d..22dcc0bda58b39 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -169,6 +179,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -177,12 +193,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -218,6 +228,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -567,15 +582,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -587,6 +593,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -948,12 +963,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -963,6 +972,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1051,16 +1066,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 83595c1660e6aa..f2032ab4d31d43 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -318,6 +328,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -326,12 +342,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -367,6 +377,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -716,15 +731,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -736,6 +742,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1097,12 +1112,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1112,6 +1121,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1200,16 +1215,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 7bdc7450089270..4368aa72bdd833 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -156,6 +166,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -164,12 +180,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -565,15 +575,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -585,6 +586,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -948,12 +958,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -963,6 +967,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1051,16 +1061,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 5cde9f81f7d0a9..24758353832c93 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -240,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -248,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -289,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -638,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -658,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1019,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1034,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1122,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 4a768a2adeeb62..e1fc1b04c861bf 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -311,6 +321,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -319,12 +335,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -360,6 +370,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -709,15 +724,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -729,6 +735,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1090,12 +1105,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1105,6 +1114,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1193,16 +1208,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 7d6c35a93445dc..df557981fbdbc7 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -240,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -248,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -289,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -638,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -658,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1019,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1034,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1122,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 6f82766c8263b7..e60751a893b628 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -240,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -248,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -289,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -638,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -658,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1019,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1034,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1122,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 9e0c273daeed39..3f67b78294ded4 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -240,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -248,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -289,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -638,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -658,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1019,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1034,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1122,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 7d4091dbc5233c..877a4c644963f9 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -318,6 +328,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -326,12 +342,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -367,6 +377,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -716,15 +731,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -736,6 +742,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1097,12 +1112,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1112,6 +1121,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1200,16 +1215,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index f863037c5acdbc..5e4c5884675454 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -281,6 +291,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -289,12 +305,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -330,6 +340,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -679,15 +694,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -699,6 +705,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1060,12 +1075,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1075,6 +1084,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1163,16 +1178,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 5e1449ed515c7a..0ebc72edbb5e36 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -217,6 +227,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -225,12 +241,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -266,6 +276,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -615,15 +630,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -635,6 +641,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -996,12 +1011,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1011,6 +1020,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1099,16 +1114,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index a7bb095406daa0..039cd18e0d056f 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -245,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -253,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -294,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -643,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -663,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1024,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1039,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1127,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1195,6 +1205,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1206,6 +1221,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index cdb7c6eb295b28..4e9566c593ea0e 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -312,6 +322,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -320,12 +336,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -361,6 +371,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -710,15 +725,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -730,6 +736,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1091,12 +1106,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1106,6 +1115,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1194,16 +1209,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 61bc4f676d7257..938c70b6e55d79 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -240,6 +250,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -248,12 +264,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -289,6 +299,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -638,15 +653,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -658,6 +664,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1019,12 +1034,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1034,6 +1043,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1122,16 +1137,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index ed59c723066774..bd7919c6893af6 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -169,6 +179,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -177,12 +193,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -218,6 +228,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -567,15 +582,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -587,6 +593,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -948,12 +963,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -963,6 +972,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1051,16 +1066,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1193,6 +1208,12 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + struct ThermostatScheduleTransition { + int16u transitionTime = 0; + nullable int16s heatSetpoint = 1; + nullable int16s coolSetpoint = 2; + } + readonly attribute nullable int16s localTemperature = 0; readonly attribute nullable int16s outdoorTemperature = 1; readonly attribute bitmap8 occupancy = 2; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index b67a2215cefda9..6ff843421b7718 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -169,6 +179,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -177,12 +193,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -218,6 +228,11 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -567,15 +582,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -587,6 +593,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -948,12 +963,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -963,6 +972,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1051,16 +1066,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index fc9e1e63a7d31f..85f1c56e2d8266 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -75,6 +75,7 @@ static_library("chip-tool-utils") { "commands/pairing/OpenCommissioningWindowCommand.cpp", "commands/pairing/OpenCommissioningWindowCommand.h", "commands/pairing/PairingCommand.cpp", + "commands/pairing/ToTLVCert.cpp", "commands/payload/AdditionalDataParseCommand.cpp", "commands/payload/SetupPayloadGenerateCommand.cpp", "commands/payload/SetupPayloadParseCommand.cpp", diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 498c61f6123912..d64db23eb072b2 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -333,6 +333,22 @@ CHIP_ERROR CHIPCommand::GetIdentityNodeId(std::string identity, chip::NodeId * n return CHIP_NO_ERROR; } +CHIP_ERROR CHIPCommand::GetIdentityRootCertificate(std::string identity, chip::ByteSpan & span) +{ + if (identity == kIdentityNull) + { + return CHIP_ERROR_NOT_FOUND; + } + + chip::NodeId nodeId; + VerifyOrDie(GetIdentityNodeId(identity, &nodeId) == CHIP_NO_ERROR); + CommissionerIdentity lookupKey{ identity, nodeId }; + auto item = mCommissioners.find(lookupKey); + + span = chip::ByteSpan(item->first.mRCAC, item->first.mRCACLen); + return CHIP_NO_ERROR; +} + chip::FabricId CHIPCommand::CurrentCommissionerId() { chip::FabricId id; @@ -388,21 +404,13 @@ void CHIPCommand::ShutdownCommissioner(const CommissionerIdentity & key) mCommissioners[key].get()->Shutdown(); } -CHIP_ERROR CHIPCommand::InitializeCommissioner(const CommissionerIdentity & identity, chip::FabricId fabricId) +CHIP_ERROR CHIPCommand::InitializeCommissioner(CommissionerIdentity & identity, chip::FabricId fabricId) { - chip::Platform::ScopedMemoryBuffer noc; - chip::Platform::ScopedMemoryBuffer icac; - chip::Platform::ScopedMemoryBuffer rcac; - std::unique_ptr commissioner = std::make_unique(); chip::Controller::SetupParams commissionerParams; ReturnLogErrorOnFailure(mCredIssuerCmds->SetupDeviceAttestation(commissionerParams, sTrustStore)); - VerifyOrReturnError(noc.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); - VerifyOrReturnError(icac.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); - VerifyOrReturnError(rcac.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); - chip::Crypto::P256Keypair ephemeralKey; if (fabricId != chip::kUndefinedFabricId) @@ -420,15 +428,20 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(const CommissionerIdentity & iden ReturnLogErrorOnFailure(mCredIssuerCmds->InitializeCredentialsIssuer(mCommissionerStorage)); - chip::MutableByteSpan nocSpan(noc.Get(), chip::Controller::kMaxCHIPDERCertLength); - chip::MutableByteSpan icacSpan(icac.Get(), chip::Controller::kMaxCHIPDERCertLength); - chip::MutableByteSpan rcacSpan(rcac.Get(), chip::Controller::kMaxCHIPDERCertLength); + chip::MutableByteSpan nocSpan(identity.mNOC); + chip::MutableByteSpan icacSpan(identity.mICAC); + chip::MutableByteSpan rcacSpan(identity.mRCAC); ReturnLogErrorOnFailure(ephemeralKey.Initialize(chip::Crypto::ECPKeyTarget::ECDSA)); ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain(identity.mLocalNodeId, fabricId, mCommissionerStorage.GetCommissionerCATs(), ephemeralKey, rcacSpan, icacSpan, nocSpan)); + + identity.mRCACLen = rcacSpan.size(); + identity.mICACLen = icacSpan.size(); + identity.mNOCLen = nocSpan.size(); + commissionerParams.operationalKeypair = &ephemeralKey; commissionerParams.controllerRCAC = rcacSpan; commissionerParams.controllerICAC = icacSpan; diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 265275416474f3..3f16ff95c4cd36 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -155,6 +155,7 @@ class CHIPCommand : public Command std::string GetIdentity(); CHIP_ERROR GetIdentityNodeId(std::string identity, chip::NodeId * nodeId); + CHIP_ERROR GetIdentityRootCertificate(std::string identity, chip::ByteSpan & span); void SetIdentity(const char * name); // This method returns the commissioner instance to be used for running the command. @@ -179,12 +180,19 @@ class CHIPCommand : public Command } std::string mName; chip::NodeId mLocalNodeId; + uint8_t mRCAC[chip::Controller::kMaxCHIPDERCertLength] = {}; + uint8_t mICAC[chip::Controller::kMaxCHIPDERCertLength] = {}; + uint8_t mNOC[chip::Controller::kMaxCHIPDERCertLength] = {}; + + size_t mRCACLen; + size_t mICACLen; + size_t mNOCLen; }; // InitializeCommissioner uses various members, so can't be static. This is // obviously a little odd, since the commissioners are then shared across // multiple commands in interactive mode... - CHIP_ERROR InitializeCommissioner(const CommissionerIdentity & identity, chip::FabricId fabricId); + CHIP_ERROR InitializeCommissioner(CommissionerIdentity & identity, chip::FabricId fabricId); void ShutdownCommissioner(const CommissionerIdentity & key); chip::FabricId CurrentCommissionerId(); diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp index 821370d43b5c3c..45cd4461dae7ab 100644 --- a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp @@ -30,6 +30,10 @@ constexpr const char * kErrorIdKey = "error"; constexpr const char * kClusterErrorIdKey = "clusterError"; constexpr const char * kValueKey = "value"; constexpr const char * kNodeIdKey = "nodeId"; +constexpr const char * kNOCKey = "NOC"; +constexpr const char * kICACKey = "ICAC"; +constexpr const char * kRCACKey = "RCAC"; +constexpr const char * kIPKKey = "IPK"; namespace { RemoteDataModelLoggerDelegate * gDelegate; @@ -53,6 +57,7 @@ CHIP_ERROR LogError(Json::Value & value, const chip::app::StatusIB & status) auto valueStr = chip::JsonToString(value); return gDelegate->LogJSON(valueStr.c_str()); } + } // namespace namespace RemoteDataModelLogger { @@ -165,6 +170,33 @@ CHIP_ERROR LogGetCommissionerNodeId(chip::NodeId value) return gDelegate->LogJSON(valueStr.c_str()); } +CHIP_ERROR LogGetCommissionerRootCertificate(const char * value) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value rootValue; + rootValue[kValueKey] = Json::Value(); + rootValue[kValueKey][kRCACKey] = value; + + auto valueStr = chip::JsonToString(rootValue); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogIssueNOCChain(const char * noc, const char * icac, const char * rcac, const char * ipk) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value rootValue; + rootValue[kValueKey] = Json::Value(); + rootValue[kValueKey][kNOCKey] = noc; + rootValue[kValueKey][kICACKey] = icac; + rootValue[kValueKey][kRCACKey] = rcac; + rootValue[kValueKey][kIPKKey] = ipk; + + auto valueStr = chip::JsonToString(rootValue); + return gDelegate->LogJSON(valueStr.c_str()); +} + CHIP_ERROR LogDiscoveredNodeData(const chip::Dnssd::DiscoveredNodeData & nodeData) { VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.h b/examples/chip-tool/commands/common/RemoteDataModelLogger.h index 8289a69e22eff5..7c93a50aa1f191 100644 --- a/examples/chip-tool/commands/common/RemoteDataModelLogger.h +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.h @@ -22,6 +22,7 @@ #include #include #include +#include #include class RemoteDataModelLoggerDelegate @@ -40,6 +41,8 @@ CHIP_ERROR LogEventAsJSON(const chip::app::EventHeader & header, chip::TLV::TLVR CHIP_ERROR LogErrorAsJSON(const chip::app::EventHeader & header, const chip::app::StatusIB & status); CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error); CHIP_ERROR LogGetCommissionerNodeId(chip::NodeId value); +CHIP_ERROR LogGetCommissionerRootCertificate(const char * value); +CHIP_ERROR LogIssueNOCChain(const char * noc, const char * icac, const char * rcac, const char * ipk); CHIP_ERROR LogDiscoveredNodeData(const chip::Dnssd::DiscoveredNodeData & nodeData); void SetDelegate(RemoteDataModelLoggerDelegate * delegate); }; // namespace RemoteDataModelLogger diff --git a/examples/chip-tool/commands/pairing/Commands.h b/examples/chip-tool/commands/pairing/Commands.h index a1f11855f93d26..4f4f445d929a8c 100644 --- a/examples/chip-tool/commands/pairing/Commands.h +++ b/examples/chip-tool/commands/pairing/Commands.h @@ -21,6 +21,8 @@ #include "commands/common/Commands.h" #include "commands/pairing/CloseSessionCommand.h" #include "commands/pairing/GetCommissionerNodeIdCommand.h" +#include "commands/pairing/GetCommissionerRootCertificateCommand.h" +#include "commands/pairing/IssueNOCChainCommand.h" #include "commands/pairing/OpenCommissioningWindowCommand.h" #include "commands/pairing/PairingCommand.h" @@ -241,6 +243,8 @@ void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * cre make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h b/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h new file mode 100644 index 00000000000000..7a350a9ca16bb8 --- /dev/null +++ b/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "../common/CHIPCommand.h" + +#include "ToTLVCert.h" + +class GetCommissionerRootCertificateCommand : public CHIPCommand +{ +public: + GetCommissionerRootCertificateCommand(CredentialIssuerCommands * credIssuerCommands) : + CHIPCommand("get-commissioner-root-certificate", credIssuerCommands, + "Returns a base64-encoded RCAC prefixed with: 'base64:'") + {} + + /////////// CHIPCommand Interface ///////// + CHIP_ERROR RunCommand() override + { + chip::ByteSpan span; + ReturnErrorOnFailure(GetIdentityRootCertificate(GetIdentity(), span)); + + std::string rcac; + ReturnErrorOnFailure(ToTLVCert(span, rcac)); + ChipLogProgress(chipTool, "RCAC: %s", rcac.c_str()); + + ReturnErrorOnFailure(RemoteDataModelLogger::LogGetCommissionerRootCertificate(rcac.c_str())); + + SetCommandExitStatus(CHIP_NO_ERROR); + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); } +}; diff --git a/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h b/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h new file mode 100644 index 00000000000000..a4de2dadfc0664 --- /dev/null +++ b/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "../common/CHIPCommand.h" + +#include "ToTLVCert.h" + +class IssueNOCChainCommand : public CHIPCommand +{ +public: + IssueNOCChainCommand(CredentialIssuerCommands * credIssuerCommands) : + CHIPCommand("issue-noc-chain", credIssuerCommands, + "Returns a base64-encoded NOC, ICAC, RCAC, and IPK prefixed with: 'base64:'"), + mDeviceNOCChainCallback(OnDeviceNOCChainGeneration, this) + { + AddArgument("elements", &mNOCSRElements, "NOCSRElements encoded in hexadecimal"); + AddArgument("node-id", 0, UINT64_MAX, &mNodeId, "The target node id"); + } + + /////////// CHIPCommand Interface ///////// + CHIP_ERROR RunCommand() override + { + auto & commissioner = CurrentCommissioner(); + ReturnErrorOnFailure(commissioner.IssueNOCChain(mNOCSRElements, mNodeId, &mDeviceNOCChainCallback)); + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); } + + static void OnDeviceNOCChainGeneration(void * context, CHIP_ERROR status, const chip::ByteSpan & noc, + const chip::ByteSpan & icac, const chip::ByteSpan & rcac, + chip::Optional ipk, + chip::Optional adminSubject) + { + auto command = static_cast(context); + + auto err = status; + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); + + std::string nocStr; + err = ToTLVCert(noc, nocStr); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); + ChipLogProgress(chipTool, "NOC: %s", nocStr.c_str()); + + std::string icacStr; + err = ToTLVCert(icac, icacStr); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); + ChipLogProgress(chipTool, "ICAC: %s", icacStr.c_str()); + + std::string rcacStr; + err = ToTLVCert(rcac, rcacStr); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); + ChipLogProgress(chipTool, "RCAC: %s", rcacStr.c_str()); + + auto ipkValue = ipk.ValueOr(chip::Crypto::IdentityProtectionKeySpan()); + std::string ipkStr; + err = ToBase64(ipkValue, ipkStr); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); + ChipLogProgress(chipTool, "IPK: %s", ipkStr.c_str()); + + err = RemoteDataModelLogger::LogIssueNOCChain(nocStr.c_str(), icacStr.c_str(), rcacStr.c_str(), ipkStr.c_str()); + command->SetCommandExitStatus(err); + } + +private: + chip::Callback::Callback mDeviceNOCChainCallback; + chip::ByteSpan mNOCSRElements; + chip::NodeId mNodeId; +}; diff --git a/examples/chip-tool/commands/pairing/ToTLVCert.cpp b/examples/chip-tool/commands/pairing/ToTLVCert.cpp new file mode 100644 index 00000000000000..f17769df64efac --- /dev/null +++ b/examples/chip-tool/commands/pairing/ToTLVCert.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "ToTLVCert.h" + +#include +#include + +constexpr const char kBase64Header[] = "base64:"; +constexpr size_t kBase64HeaderLen = ArraySize(kBase64Header) - 1; + +CHIP_ERROR ToBase64(const chip::ByteSpan & input, std::string & outputAsPrefixedBase64) +{ + chip::Platform::ScopedMemoryBuffer base64String; + base64String.Alloc(kBase64HeaderLen + BASE64_ENCODED_LEN(input.size()) + 1); + VerifyOrReturnError(base64String.Get() != nullptr, CHIP_ERROR_NO_MEMORY); + + auto encodedLen = chip::Base64Encode(input.data(), static_cast(input.size()), base64String.Get() + kBase64HeaderLen); + if (encodedLen) + { + memcpy(base64String.Get(), kBase64Header, kBase64HeaderLen); + encodedLen = static_cast(encodedLen + kBase64HeaderLen); + } + base64String.Get()[encodedLen] = '\0'; + outputAsPrefixedBase64 = std::string(base64String.Get(), encodedLen); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR ToTLVCert(const chip::ByteSpan & derEncodedCertificate, std::string & tlvCertAsPrefixedBase64) +{ + uint8_t chipCertBuffer[chip::Credentials::kMaxCHIPCertLength]; + chip::MutableByteSpan chipCertBytes(chipCertBuffer); + ReturnErrorOnFailure(chip::Credentials::ConvertX509CertToChipCert(derEncodedCertificate, chipCertBytes)); + ReturnErrorOnFailure(ToBase64(chipCertBytes, tlvCertAsPrefixedBase64)); + return CHIP_NO_ERROR; +} diff --git a/examples/chip-tool/commands/pairing/ToTLVCert.h b/examples/chip-tool/commands/pairing/ToTLVCert.h new file mode 100644 index 00000000000000..bcac763f429f8b --- /dev/null +++ b/examples/chip-tool/commands/pairing/ToTLVCert.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include + +CHIP_ERROR ToBase64(const chip::ByteSpan & input, std::string & outputAsPrefixedBase64); +CHIP_ERROR ToTLVCert(const chip::ByteSpan & derEncodedCertificate, std::string & tlvCertAsPrefixedBase64); diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index ffba568adb644b..0dbca4a359a2e9 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -32,7 +32,18 @@ 'GetCommissionerNodeId': { 'has_destination': False, 'has_endpoint': False, - } + }, + 'GetCommissionerRootCertificate': { + 'has_destination': False, + 'has_endpoint': False, + }, + 'IssueNocChain': { + 'arguments': { + 'nodeId': 'node-id', + }, + 'has_destination': False, + 'has_endpoint': False, + }, } }, diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 73053363859bfb..f2a6f825f3d187 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -161,6 +166,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -169,12 +180,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -570,15 +575,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -590,6 +586,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -888,6 +893,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -906,21 +926,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1176,12 +1181,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1191,6 +1190,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1279,16 +1284,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1347,6 +1352,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1358,6 +1368,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter index 6413f0f34d914b..d553e9435e7aeb 100644 --- a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter +++ b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -335,6 +345,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -343,12 +359,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -711,15 +721,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -731,6 +732,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1027,6 +1037,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1045,21 +1070,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1364,12 +1374,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1379,6 +1383,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1467,16 +1477,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp b/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp index 4c1b55fbddb9fc..d0db78341501a5 100644 --- a/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp @@ -28,11 +28,15 @@ #include "CHIPDeviceManager.h" #include #include +#include +#include +#include #include #include #include using namespace ::chip; +using namespace ::chip::Credentials; namespace chip { @@ -40,6 +44,8 @@ namespace DeviceManager { using namespace ::chip::DeviceLayer; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) { CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); @@ -61,6 +67,19 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); + err = mFactoryDataProvider.Init(); + if (err == CHIP_NO_ERROR) + { + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + } + else + { + ChipLogProgress(DeviceLayer, "Using example DAC provider"); + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + } + if (CONFIG_NETWORK_LAYER_BLE) { ConnectivityMgr().SetBLEAdvertisingEnabled(true); diff --git a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp index cc855031952eda..b5fbaf1ece36c4 100644 --- a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ case DeviceEventType::kCommissioningComplete: ChipLogProgress(DeviceLayer, "Commissioning Complete"); + chip::DeviceLayer::Internal::AmebaUtils::SetCurrentProvisionedNetwork(); break; } } @@ -142,8 +144,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event chip::app::DnssdServer::Instance().StartServer(); #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Init OTA requestor only when we have gotten IPv6 address - if (OTAInitializer::Instance().CheckInit()) + if (!OTAInitializer::Instance().CheckInit()) { + ChipLogProgress(DeviceLayer, "Initializing OTA"); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); } diff --git a/examples/light-switch-app/ameba/main/chipinterface.cpp b/examples/light-switch-app/ameba/main/chipinterface.cpp index 85e4c401514d99..7bc5c3efae4416 100644 --- a/examples/light-switch-app/ameba/main/chipinterface.cpp +++ b/examples/light-switch-app/ameba/main/chipinterface.cpp @@ -31,11 +31,8 @@ #include #include #include -#include -#include #include #include -#include #include #include #include @@ -51,7 +48,6 @@ #endif using namespace ::chip; -using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; using namespace ::chip::DeviceLayer; using namespace ::chip::System; @@ -97,7 +93,6 @@ Identify gIdentify1 = { static DeviceCallbacks EchoCallbacks; chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; -chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; static void InitServer(intptr_t context) { @@ -132,10 +127,6 @@ extern "C" void ChipTest(void) initPref(); - mFactoryDataProvider.Init(); - SetCommissionableDataProvider(&mFactoryDataProvider); - SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); - CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); err = deviceMgr.Init(&EchoCallbacks); @@ -148,10 +139,6 @@ extern "C" void ChipTest(void) ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n"); } - // Set DeviceInstanceInfoProvider after CHIPDeviceManager init - // CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first - SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0); statusLED1.Init(STATUS_LED_GPIO_NUM); diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 2a8f9eeb4749f2..cba838c3007d9b 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -469,6 +474,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -477,12 +488,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -878,15 +883,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -898,6 +894,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1196,6 +1201,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1214,21 +1234,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1536,12 +1541,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1551,6 +1550,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1639,16 +1644,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1707,6 +1712,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1718,6 +1728,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp index 98c148f505ed31..01931850922b4c 100644 --- a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp @@ -26,6 +26,9 @@ #include "CHIPDeviceManager.h" #include +#include +#include +#include #include #include #include @@ -41,6 +44,7 @@ #include using namespace ::chip; +using namespace ::chip::Credentials; namespace chip { @@ -48,6 +52,8 @@ namespace DeviceManager { using namespace ::chip::DeviceLayer; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) { CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); @@ -68,6 +74,19 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); + err = mFactoryDataProvider.Init(); + if (err == CHIP_NO_ERROR) + { + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + } + else + { + ChipLogProgress(DeviceLayer, "Using example DAC provider"); + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + } + if (CONFIG_NETWORK_LAYER_BLE) { ConnectivityMgr().SetBLEAdvertisingEnabled(true); diff --git a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp index d6fd23d9521451..abc6472d2c72b9 100644 --- a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ case DeviceEventType::kCommissioningComplete: ChipLogProgress(DeviceLayer, "Commissioning Complete"); + chip::DeviceLayer::Internal::AmebaUtils::SetCurrentProvisionedNetwork(); break; } } @@ -122,8 +124,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event chip::app::DnssdServer::Instance().StartServer(); #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Init OTA requestor only when we have gotten IPv6 address - if (OTAInitializer::Instance().CheckInit()) + if (!OTAInitializer::Instance().CheckInit()) { + ChipLogProgress(DeviceLayer, "Initializing OTA"); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); } diff --git a/examples/lighting-app/ameba/main/chipinterface.cpp b/examples/lighting-app/ameba/main/chipinterface.cpp index f46fe7ad320557..e9ef017c97861a 100644 --- a/examples/lighting-app/ameba/main/chipinterface.cpp +++ b/examples/lighting-app/ameba/main/chipinterface.cpp @@ -25,8 +25,6 @@ #include #include "chip_porting.h" -#include -#include #include #include @@ -36,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -49,7 +46,6 @@ #endif using namespace ::chip; -using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; using namespace ::chip::DeviceLayer; using namespace ::chip::System; @@ -81,7 +77,6 @@ void NetWorkCommissioningInstInit() static DeviceCallbacks EchoCallbacks; chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; -chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; void OnIdentifyStart(Identify *) { @@ -148,10 +143,6 @@ extern "C" void ChipTest(void) initPref(); - mFactoryDataProvider.Init(); - SetCommissionableDataProvider(&mFactoryDataProvider); - SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); - CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); err = deviceMgr.Init(&EchoCallbacks); @@ -164,10 +155,6 @@ extern "C" void ChipTest(void) ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n"); } - // Set DeviceInstanceInfoProvider after CHIPDeviceManager init - // CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first - SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0); statusLED1.Init(STATUS_LED_GPIO_NUM); diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index e88b303e7d3c52..b900049325d2cf 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1058,6 +1063,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1076,21 +1096,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1169,8 +1174,6 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - - command ResetCounts(): DefaultSuccess = 0; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. @@ -1286,12 +1289,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1301,6 +1298,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1389,16 +1392,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1457,6 +1460,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1468,6 +1476,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1557,6 +1570,24 @@ server cluster ColorControl = 768 { readonly attribute enum8 colorMode = 8; attribute bitmap8 options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; + readonly attribute int16u primary1X = 17; + readonly attribute int16u primary1Y = 18; + readonly attribute nullable int8u primary1Intensity = 19; + readonly attribute int16u primary2X = 21; + readonly attribute int16u primary2Y = 22; + readonly attribute nullable int8u primary2Intensity = 23; + readonly attribute int16u primary3X = 25; + readonly attribute int16u primary3Y = 26; + readonly attribute nullable int8u primary3Intensity = 27; + readonly attribute int16u primary4X = 32; + readonly attribute int16u primary4Y = 33; + readonly attribute nullable int8u primary4Intensity = 34; + readonly attribute int16u primary5X = 36; + readonly attribute int16u primary5Y = 37; + readonly attribute nullable int8u primary5Intensity = 38; + readonly attribute int16u primary6X = 40; + readonly attribute int16u primary6Y = 41; + readonly attribute nullable int8u primary6Intensity = 42; readonly attribute int16u enhancedCurrentHue = 16384; readonly attribute enum8 enhancedColorMode = 16385; readonly attribute int8u colorLoopActive = 16386; @@ -2033,7 +2064,7 @@ endpoint 0 { } } endpoint 1 { - device type dimmablelight = 257, version 1; + device type extendedcolorlight = 269, version 1; server cluster Identify { ram attribute identifyTime default = 0x0000; @@ -2096,6 +2127,24 @@ endpoint 1 { ram attribute colorMode default = 0x01; ram attribute options default = 0x00; ram attribute numberOfPrimaries; + ram attribute primary1X; + ram attribute primary1Y; + ram attribute primary1Intensity; + ram attribute primary2X; + ram attribute primary2Y; + ram attribute primary2Intensity; + ram attribute primary3X; + ram attribute primary3Y; + ram attribute primary3Intensity; + ram attribute primary4X; + ram attribute primary4Y; + ram attribute primary4Intensity; + ram attribute primary5X; + ram attribute primary5Y; + ram attribute primary5Intensity; + ram attribute primary6X; + ram attribute primary6Y; + ram attribute primary6Intensity; ram attribute enhancedCurrentHue default = 0x0000; ram attribute enhancedColorMode default = 0x01; ram attribute colorLoopActive default = 0x00; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 84e31ba4ae3212..3678fd16460206 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -1,5 +1,5 @@ { - "featureLevel": 92, + "featureLevel": 95, "creator": "zap", "keyValuePairs": [ { @@ -3045,7 +3045,7 @@ "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 0 } ], @@ -5438,7 +5438,7 @@ ] }, { - "name": "MA-dimmablelight", + "name": "MA-extendedcolorlight", "deviceTypeName": "MA-dimmablelight", "deviceTypeCode": 257, "deviceTypeProfileId": 259, @@ -7471,7 +7471,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7487,7 +7487,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7503,7 +7503,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7519,7 +7519,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7535,7 +7535,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7551,7 +7551,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7567,7 +7567,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7583,7 +7583,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7599,7 +7599,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7615,7 +7615,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7631,7 +7631,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7647,7 +7647,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7663,7 +7663,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7679,7 +7679,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7695,7 +7695,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7711,7 +7711,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7727,7 +7727,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7743,7 +7743,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -8333,13 +8333,14 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-dimmablelight", + "endpointTypeName": "MA-extendedcolorlight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 257 + "deviceIdentifier": 269 } - ] -} \ No newline at end of file + ], + "log": [] +} diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index b200f7dfdafb7b..7cc2012ef8c2c4 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -996,7 +1001,6 @@ server cluster SoftwareDiagnostics = 52 { optional OCTET_STRING faultRecording = 2; } - readonly attribute ThreadMetricsStruct threadMetrics[] = 0; readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; @@ -1194,12 +1198,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1209,6 +1207,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1297,16 +1301,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1365,6 +1369,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1376,6 +1385,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1465,6 +1479,24 @@ server cluster ColorControl = 768 { readonly attribute enum8 colorMode = 8; attribute bitmap8 options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; + readonly attribute int16u primary1X = 17; + readonly attribute int16u primary1Y = 18; + readonly attribute nullable int8u primary1Intensity = 19; + readonly attribute int16u primary2X = 21; + readonly attribute int16u primary2Y = 22; + readonly attribute nullable int8u primary2Intensity = 23; + readonly attribute int16u primary3X = 25; + readonly attribute int16u primary3Y = 26; + readonly attribute nullable int8u primary3Intensity = 27; + readonly attribute int16u primary4X = 32; + readonly attribute int16u primary4Y = 33; + readonly attribute nullable int8u primary4Intensity = 34; + readonly attribute int16u primary5X = 36; + readonly attribute int16u primary5Y = 37; + readonly attribute nullable int8u primary5Intensity = 38; + readonly attribute int16u primary6X = 40; + readonly attribute int16u primary6Y = 41; + readonly attribute nullable int8u primary6Intensity = 42; readonly attribute int16u enhancedCurrentHue = 16384; readonly attribute enum8 enhancedColorMode = 16385; readonly attribute int8u colorLoopActive = 16386; @@ -1817,7 +1849,6 @@ endpoint 0 { } server cluster SoftwareDiagnostics { - callback attribute threadMetrics; callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; @@ -1894,7 +1925,7 @@ endpoint 0 { } } endpoint 1 { - device type dimmablelight = 257, version 1; + device type extendedcolorlight = 269, version 1; server cluster Identify { ram attribute identifyTime default = 0x0000; @@ -1957,6 +1988,24 @@ endpoint 1 { ram attribute colorMode default = 0x01; ram attribute options default = 0x00; ram attribute numberOfPrimaries; + ram attribute primary1X; + ram attribute primary1Y; + ram attribute primary1Intensity; + ram attribute primary2X; + ram attribute primary2Y; + ram attribute primary2Intensity; + ram attribute primary3X; + ram attribute primary3Y; + ram attribute primary3Intensity; + ram attribute primary4X; + ram attribute primary4Y; + ram attribute primary4Intensity; + ram attribute primary5X; + ram attribute primary5Y; + ram attribute primary5Intensity; + ram attribute primary6X; + ram attribute primary6Y; + ram attribute primary6Intensity; ram attribute enhancedCurrentHue default = 0x0000; ram attribute enhancedColorMode default = 0x01; ram attribute colorLoopActive default = 0x00; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index fc2348e2cee121..cb6676170a79b3 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -1,5 +1,5 @@ { - "featureLevel": 94, + "featureLevel": 95, "creator": "zap", "keyValuePairs": [ { @@ -1795,22 +1795,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "AttributeList", "code": 65531, @@ -2956,7 +2940,7 @@ "mfgCode": null, "side": "server", "type": "array", - "included": 1, + "included": 0, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -4386,22 +4370,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 1, - "bounded": 1, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "FeatureMap", "code": 65532, @@ -5470,7 +5438,7 @@ ] }, { - "name": "MA-dimmablelight", + "name": "MA-extendedcolorlight", "deviceTypeName": "MA-dimmablelight", "deviceTypeCode": 257, "deviceTypeProfileId": 259, @@ -7503,7 +7471,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7519,7 +7487,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7535,7 +7503,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7551,7 +7519,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7567,7 +7535,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7583,7 +7551,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7599,7 +7567,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7615,7 +7583,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7631,7 +7599,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7647,7 +7615,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7663,7 +7631,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7679,7 +7647,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7695,7 +7663,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7711,7 +7679,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7727,7 +7695,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7743,7 +7711,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7759,7 +7727,7 @@ "mfgCode": null, "side": "server", "type": "int16u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -7775,7 +7743,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -8365,14 +8333,14 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-dimmablelight", + "endpointTypeName": "MA-extendedcolorlight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 257 + "deviceIdentifier": 269 } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 2bd058a4bbb3ef..1bf9cb4b9dc21b 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1058,6 +1063,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1076,21 +1096,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1398,12 +1403,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1413,6 +1412,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1501,16 +1506,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1569,6 +1574,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1580,6 +1590,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index c6cec036d5a918..1b6e340cb799b3 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -319,6 +329,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -327,10 +343,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -663,15 +678,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -683,6 +689,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -931,6 +946,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -949,21 +979,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1099,12 +1114,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1114,6 +1123,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1202,16 +1217,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 62adc8a1bf32bb..3b70d0b639086f 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -327,6 +332,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -335,10 +346,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -679,15 +689,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -699,6 +700,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -997,6 +1007,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1015,21 +1040,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1170,12 +1180,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1185,6 +1189,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1273,16 +1283,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1341,6 +1351,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1352,6 +1367,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter index 00276ee75109d9..17ae50fd9aeab1 100644 --- a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1144,12 +1149,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1159,6 +1158,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1247,16 +1252,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1315,6 +1320,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1326,6 +1336,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter index 0123d3575ea6a1..fa3b3fd6a2b9ca 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1058,6 +1063,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1076,21 +1096,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1234,12 +1239,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1249,6 +1248,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1337,16 +1342,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1405,6 +1410,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1416,6 +1426,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter index 00276ee75109d9..17ae50fd9aeab1 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -331,6 +336,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -339,12 +350,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -740,15 +745,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -760,6 +756,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1144,12 +1149,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1159,6 +1158,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1247,16 +1252,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1315,6 +1320,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1326,6 +1336,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 39c139440ef55b..81abd19965fe32 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -138,6 +143,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -146,12 +157,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -636,6 +641,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -776,15 +796,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -796,6 +807,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1094,6 +1114,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1112,21 +1147,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1382,12 +1402,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1397,6 +1411,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1485,16 +1505,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1553,6 +1573,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1564,6 +1589,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 208c5949aac493..b09e5a23a74e92 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -91,6 +101,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -99,10 +115,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -286,15 +301,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -306,6 +312,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -554,6 +569,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -572,21 +602,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -722,12 +737,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -737,6 +746,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -825,16 +840,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index e5372de5d04322..2d46c41f4051a2 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -161,6 +166,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -169,10 +180,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -513,15 +523,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -533,6 +534,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -831,6 +841,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -849,21 +874,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1004,12 +1014,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1019,6 +1023,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1107,16 +1117,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1175,6 +1185,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1186,6 +1201,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; 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 b25eac61ace558..2ba2b4be9cf231 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 @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated @@ -26,6 +36,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -34,12 +50,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -176,13 +186,9 @@ server cluster NetworkCommissioning = 49 { kWpa3Personal = 0x10; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; + struct NetworkInfo { + octet_string<32> networkID = 0; + boolean connected = 1; } struct ThreadInterfaceScanResult { @@ -196,6 +202,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -380,6 +395,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; 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 3edbdc3a313251..1482f14797d7e0 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 @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -123,6 +128,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -131,12 +142,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -454,15 +459,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -474,6 +470,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -714,12 +719,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -729,6 +728,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -817,16 +822,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -885,6 +890,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -896,6 +906,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp b/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp index 4c1b55fbddb9fc..d0db78341501a5 100644 --- a/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp @@ -28,11 +28,15 @@ #include "CHIPDeviceManager.h" #include #include +#include +#include +#include #include #include #include using namespace ::chip; +using namespace ::chip::Credentials; namespace chip { @@ -40,6 +44,8 @@ namespace DeviceManager { using namespace ::chip::DeviceLayer; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) { CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); @@ -61,6 +67,19 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); + err = mFactoryDataProvider.Init(); + if (err == CHIP_NO_ERROR) + { + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + } + else + { + ChipLogProgress(DeviceLayer, "Using example DAC provider"); + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + } + if (CONFIG_NETWORK_LAYER_BLE) { ConnectivityMgr().SetBLEAdvertisingEnabled(true); diff --git a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp index baa7910e3030bf..67cb1ac8b9d747 100644 --- a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ case DeviceEventType::kCommissioningComplete: ChipLogProgress(DeviceLayer, "Commissioning Complete"); + chip::DeviceLayer::Internal::AmebaUtils::SetCurrentProvisionedNetwork(); break; } } @@ -142,8 +144,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event chip::app::DnssdServer::Instance().StartServer(); #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Init OTA requestor only when we have gotten IPv6 address - if (OTAInitializer::Instance().CheckInit()) + if (!OTAInitializer::Instance().CheckInit()) { + ChipLogProgress(DeviceLayer, "Initializing OTA"); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); } diff --git a/examples/ota-requestor-app/ameba/main/chipinterface.cpp b/examples/ota-requestor-app/ameba/main/chipinterface.cpp index 2dd76a6dba308b..ee8e80086fbca4 100644 --- a/examples/ota-requestor-app/ameba/main/chipinterface.cpp +++ b/examples/ota-requestor-app/ameba/main/chipinterface.cpp @@ -25,12 +25,9 @@ #include #include #include -#include -#include #include #include -#include #include #include #include @@ -51,7 +48,6 @@ using namespace chip::Messaging; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; using namespace ::chip; -using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; using namespace ::chip::DeviceLayer; @@ -74,7 +70,6 @@ void NetWorkCommissioningInstInit() static DeviceCallbacks EchoCallbacks; chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; -chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; static void InitServer(intptr_t context) { @@ -95,10 +90,6 @@ extern "C" void ChipTest(void) initPref(); - mFactoryDataProvider.Init(); - SetCommissionableDataProvider(&mFactoryDataProvider); - SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); - CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); err = deviceMgr.Init(&EchoCallbacks); if (err != CHIP_NO_ERROR) @@ -110,9 +101,5 @@ extern "C" void ChipTest(void) ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n"); } - // Set DeviceInstanceInfoProvider after CHIPDeviceManager init - // CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first - SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 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 6f625401694ecb..b806568768bd64 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 @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -223,6 +228,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -231,12 +242,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -632,15 +637,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -652,6 +648,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -892,12 +897,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -907,6 +906,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -995,16 +1000,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1063,6 +1068,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1074,6 +1084,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 4c382a43a7f48a..1ed428f54b89a9 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -127,16 +132,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -507,6 +512,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -515,10 +526,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -998,6 +1008,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -1228,15 +1253,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -1248,6 +1264,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1873,6 +1898,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -1973,6 +2004,11 @@ client cluster FixedLabel = 64 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1984,6 +2020,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2052,17 +2093,17 @@ server cluster ModeSelect = 80 { kDeponoff = 0x1; } + struct SemanticTagStruct { + vendor_id mfgCode = 0; + enum16 value = 1; + } + struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; SemanticTagStruct semanticTags[] = 2; } - struct SemanticTagStruct { - vendor_id mfgCode = 0; - enum16 value = 1; - } - readonly attribute char_string<32> description = 0; readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; @@ -3185,8 +3226,15 @@ server cluster ContentLauncher = 1290 { kHls = 0x2; } - struct ContentSearchStruct { - ParameterStruct parameterList[] = 0; + struct DimensionStruct { + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct ParameterStruct { @@ -3195,9 +3243,14 @@ server cluster ContentLauncher = 1290 { optional AdditionalInfoStruct externalIDList[] = 2; } - struct AdditionalInfoStruct { - char_string name = 0; - char_string value = 1; + struct ContentSearchStruct { + ParameterStruct parameterList[] = 0; + } + + struct StyleInformationStruct { + optional char_string imageURL = 0; + optional char_string color = 1; + optional DimensionStruct size = 2; } struct BrandingInformationStruct { @@ -3209,18 +3262,6 @@ server cluster ContentLauncher = 1290 { optional StyleInformationStruct waterMark = 5; } - struct StyleInformationStruct { - optional char_string imageURL = 0; - optional char_string color = 1; - optional DimensionStruct size = 2; - } - - struct DimensionStruct { - double width = 0; - double height = 1; - MetricTypeEnum metric = 2; - } - readonly attribute CHAR_STRING acceptHeader[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 2aa3e240a7ab50..cb867628e21df7 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -127,16 +132,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -507,6 +512,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -515,10 +526,9 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; } fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { @@ -959,6 +969,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -1189,15 +1214,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -1209,6 +1225,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1834,6 +1859,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -1934,6 +1965,11 @@ client cluster FixedLabel = 64 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1945,6 +1981,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2013,17 +2054,17 @@ server cluster ModeSelect = 80 { kDeponoff = 0x1; } + struct SemanticTagStruct { + vendor_id mfgCode = 0; + enum16 value = 1; + } + struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; SemanticTagStruct semanticTags[] = 2; } - struct SemanticTagStruct { - vendor_id mfgCode = 0; - enum16 value = 1; - } - readonly attribute char_string<32> description = 0; readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; @@ -3146,8 +3187,15 @@ server cluster ContentLauncher = 1290 { kHls = 0x2; } - struct ContentSearchStruct { - ParameterStruct parameterList[] = 0; + struct DimensionStruct { + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct ParameterStruct { @@ -3156,9 +3204,14 @@ server cluster ContentLauncher = 1290 { optional AdditionalInfoStruct externalIDList[] = 2; } - struct AdditionalInfoStruct { - char_string name = 0; - char_string value = 1; + struct ContentSearchStruct { + ParameterStruct parameterList[] = 0; + } + + struct StyleInformationStruct { + optional char_string imageURL = 0; + optional char_string color = 1; + optional DimensionStruct size = 2; } struct BrandingInformationStruct { @@ -3170,18 +3223,6 @@ server cluster ContentLauncher = 1290 { optional StyleInformationStruct waterMark = 5; } - struct StyleInformationStruct { - optional char_string imageURL = 0; - optional char_string color = 1; - optional DimensionStruct size = 2; - } - - struct DimensionStruct { - double width = 0; - double height = 1; - MetricTypeEnum metric = 2; - } - readonly attribute CHAR_STRING acceptHeader[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml index eb53723a9f8255..b7cf58abd724bc 100644 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml +++ b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml @@ -29,7 +29,7 @@ len = 0 type = 3 name = "media" device = 0 -address0 = 0x1A2000 +address0 = 0x1A1000 size0 = 0x47000 address1 = 0 size1 = 0 @@ -40,7 +40,7 @@ len = 0 type = 4 name = "PSM" device = 0 -address0 = 0x1E9000 +address0 = 0x1E8000 size0 = 0x4000 address1 = 0 size1 = 0 @@ -51,7 +51,7 @@ len = 0 type = 5 name = "KEY" device = 0 -address0 = 0x1F1000 +address0 = 0x1F0000 size0 = 0x2000 address1 = 0 size1 = 0 @@ -62,7 +62,7 @@ len = 0 type = 6 name = "DATA" device = 0 -address0 = 0x1F3000 +address0 = 0x1F2000 size0 = 0x5000 address1 = 0 size1 = 0 @@ -74,16 +74,29 @@ len = 0 type = 7 name = "factory" device = 0 -address0 = 0x1F8000 +address0 = 0x1F7000 size0 = 0x7000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 len = 0 + +[[pt_entry]] +type = 8 +name = "MFD" +device = 0 +address0 = 0x1FE000 +size0 = 0x1000 +address1 = 0 +size1 = 0 +# compressed image must set len,normal image can left it to 0 +len = 0 + + #if user want to put RF calibration data on flash, uncomment following pt entry #[[pt_entry]] -#type = 8 +#type = 9 #name = "rf_para" #device = 0 #address0 = 0x1FF000 diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml index ceb90cc3cb27a2..8fcdd55f3b53c8 100644 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml +++ b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml @@ -41,7 +41,7 @@ type = 4 name = "PSM" device = 0 address0 = 0x3C3000 -size0 = 0x4000 +size0 = 0x8000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 @@ -51,7 +51,7 @@ len = 0 type = 5 name = "KEY" device = 0 -address0 = 0x3F6000 +address0 = 0x3F0000 size0 = 0x2000 address1 = 0 size1 = 0 @@ -62,7 +62,7 @@ len = 0 type = 6 name = "DATA" device = 0 -address0 = 0x3F8000 +address0 = 0x3F2000 size0 = 0x5000 address1 = 0 size1 = 0 @@ -74,19 +74,30 @@ len = 0 type = 7 name = "factory" device = 0 -address0 = 0x3FD000 +address0 = 0x3F7000 size0 = 0x7000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 len = 0 +[[pt_entry]] +type = 8 +name = "MFD" +device = 0 +address0 = 0x3FE000 +size0 = 0x1000 +address1 = 0 +size1 = 0 +# compressed image must set len,normal image can left it to 0 +len = 0 + #if user want to put RF calibration data on flash, uncomment following pt entry #[[pt_entry]] -#type = 8 +#type = 9 #name = "rf_para" #device = 0 -#address0 = 0x1FF000 +#address0 = 0x3FF000 #size0 = 0x1000 #address1 = 0 #size1 = 0 diff --git a/examples/platform/bouffalolab/bl702/flash_config/partition_cfg_2M.toml b/examples/platform/bouffalolab/bl702/flash_config/partition_cfg_2M.toml index f6a22deaf30a27..71aacc8cf753b2 100644 --- a/examples/platform/bouffalolab/bl702/flash_config/partition_cfg_2M.toml +++ b/examples/platform/bouffalolab/bl702/flash_config/partition_cfg_2M.toml @@ -8,9 +8,9 @@ type = 0 name = "FW" device = 0 address0 = 0x3000 -size0 = 0x12b000 -address1 = 0x12e000 -size1 = 0xC9000 +size0 = 0x134000 +address1 = 0x137000 +size1 = 0xBB000 # compressed image must set len,normal image can left it to 0 len = 0 activeindex = 0 @@ -20,8 +20,8 @@ age = 0 type = 1 name = "mfg" device = 0 -address0 = 0x12A000 -size0 = 0xC9000 +address0 = 0x137000 +size0 = 0xBB000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 @@ -33,8 +33,8 @@ age = 0 type = 2 name = "PSM" device = 0 -address0 = 0x1F7000 -size0 = 0x4000 +address0 = 0x1F2000 +size0 = 0x8000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 @@ -46,7 +46,7 @@ age = 0 type = 3 name = "media" device = 0 -address0 = 0x1FB000 +address0 = 0x1FA000 size0 = 0x4000 address1 = 0 size1 = 0 @@ -57,6 +57,19 @@ age = 0 [[pt_entry]] type = 4 +name = "MFD" +device = 0 +address0 = 0x1FE000 +size0 = 0x1000 +address1 = 0 +size1 = 0 +# compressed image must set len,normal image can left it to 0 +len = 0 +activeindex = 0 +age = 0 + +[[pt_entry]] +type = 5 name = "factory" device = 0 address0 = 0x1FF000 @@ -67,4 +80,3 @@ size1 = 0 len = 0 activeindex = 0 age = 0 - diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index e45f1165bfa75f..68f06b0fe512c3 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -247,6 +257,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -255,12 +271,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -602,15 +612,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -622,6 +623,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -836,6 +846,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -854,21 +879,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -966,12 +976,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -981,6 +985,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1069,16 +1079,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } 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 e41f06c1e2dc3f..ec9f7cbefecf59 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 @@ -1,6 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -172,6 +182,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -180,12 +196,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -527,15 +537,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -547,6 +548,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -761,6 +771,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -779,21 +804,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -891,12 +901,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -906,6 +910,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -994,16 +1004,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index b1c1f0ddd45e61..f8bd756cfc8cdd 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -50,6 +55,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -58,12 +69,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -334,15 +339,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -354,6 +350,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -570,6 +575,14 @@ server cluster SoftwareDiagnostics = 52 { kWaterMarks = 0x1; } + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + info event SoftwareFault = 0 { INT64U id = 0; optional CHAR_STRING name = 1; @@ -756,12 +769,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -771,6 +778,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -859,16 +872,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -927,6 +940,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -938,6 +956,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 77c0f2c0449bae..bba43c1a883bca 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -175,16 +180,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -345,6 +350,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -353,12 +364,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -778,15 +783,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -798,6 +794,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1094,6 +1099,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1112,21 +1132,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1378,12 +1383,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1393,6 +1392,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1481,16 +1486,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1549,6 +1554,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1560,6 +1570,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 1e41a51bb46186..38684c4cb92787 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1,16 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - struct ApplicationStruct { int16u catalogVendorID = 0; char_string applicationID = 1; } +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : ENUM8 { @@ -245,6 +245,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -253,12 +259,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -812,15 +812,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -832,6 +823,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1128,6 +1128,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1146,21 +1161,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1536,12 +1536,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1551,6 +1545,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1639,16 +1639,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1707,6 +1707,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1718,6 +1723,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2148,8 +2158,15 @@ server cluster ContentLauncher = 1290 { kHls = 0x2; } - struct ContentSearchStruct { - ParameterStruct parameterList[] = 0; + struct DimensionStruct { + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct ParameterStruct { @@ -2158,9 +2175,14 @@ server cluster ContentLauncher = 1290 { optional AdditionalInfoStruct externalIDList[] = 2; } - struct AdditionalInfoStruct { - char_string name = 0; - char_string value = 1; + struct ContentSearchStruct { + ParameterStruct parameterList[] = 0; + } + + struct StyleInformationStruct { + optional char_string imageURL = 0; + optional char_string color = 1; + optional DimensionStruct size = 2; } struct BrandingInformationStruct { @@ -2172,18 +2194,6 @@ server cluster ContentLauncher = 1290 { optional StyleInformationStruct waterMark = 5; } - struct StyleInformationStruct { - optional char_string imageURL = 0; - optional char_string color = 1; - optional DimensionStruct size = 2; - } - - struct DimensionStruct { - double width = 0; - double height = 1; - MetricTypeEnum metric = 2; - } - readonly attribute CHAR_STRING acceptHeader[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -2269,6 +2279,11 @@ server cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; + } + struct ApplicationEPStruct { ApplicationStruct application = 0; optional endpoint_no endpoint = 1; @@ -2315,6 +2330,11 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; + } + readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; 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 17f0d76851cc67..a9a59ac12418c6 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 @@ -6,6 +6,11 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { @@ -397,6 +402,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -405,12 +416,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -681,15 +686,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -701,6 +697,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1083,12 +1088,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1098,6 +1097,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1186,16 +1191,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 8042ca188ae888..0ed782bffccebb 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1,6 +1,11 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; @@ -127,16 +132,16 @@ server cluster Scenes = 5 { kSceneNames = 0x1; } - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - struct AttributeValuePair { optional attrib_id attributeID = 0; int8u attributeValue[] = 1; } + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + readonly attribute int8u sceneCount = 0; readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; @@ -278,6 +283,12 @@ server cluster AccessControl = 31 { kRemoved = 2; } + struct Target { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + fabric_scoped struct AccessControlEntryStruct { fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; @@ -286,12 +297,6 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - fabric_scoped struct AccessControlExtensionStruct { fabric_sensitive octet_string<128> data = 1; fabric_idx fabricIndex = 254; @@ -788,6 +793,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + info event WiredFaultChange = 0 { WiredFaultEnum current[] = 0; WiredFaultEnum previous[] = 1; @@ -929,15 +949,6 @@ server cluster NetworkCommissioning = 49 { boolean connected = 1; } - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - struct ThreadInterfaceScanResult { int16u panId = 0; int64u extendedPanId = 1; @@ -949,6 +960,15 @@ server cluster NetworkCommissioning = 49 { int8u lqi = 7; } + struct WiFiInterfaceScanResult { + WiFiSecurity security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBand wiFiBand = 4; + int8s rssi = 5; + } + readonly attribute access(read: administer) int8u maxNetworks = 0; readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; @@ -1210,6 +1230,21 @@ server cluster ThreadNetworkDiagnostics = 53 { boolean isChild = 13; } + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + struct RouteTable { int64u extAddress = 0; int16u rloc16 = 1; @@ -1228,21 +1263,6 @@ server cluster ThreadNetworkDiagnostics = 53 { int16u flags = 1; } - struct OperationalDatasetComponents { - boolean activeTimestampPresent = 0; - boolean pendingTimestampPresent = 1; - boolean masterKeyPresent = 2; - boolean networkNamePresent = 3; - boolean extendedPanIdPresent = 4; - boolean meshLocalPrefixPresent = 5; - boolean delayPresent = 6; - boolean panIdPresent = 7; - boolean channelPresent = 8; - boolean pskcPresent = 9; - boolean securityPolicyPresent = 10; - boolean channelMaskPresent = 11; - } - info event ConnectionStatus = 0 { ConnectionStatusEnum connectionStatus = 0; } @@ -1494,12 +1514,6 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - fabric_scoped struct FabricDescriptorStruct { octet_string<65> rootPublicKey = 1; vendor_id vendorID = 2; @@ -1509,6 +1523,12 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptorStruct fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; @@ -1597,16 +1617,16 @@ server cluster GroupKeyManagement = 63 { kCacheAndSync = 1; } - fabric_scoped struct GroupKeyMapStruct { + fabric_scoped struct GroupInfoMapStruct { group_id groupId = 1; - int16u groupKeySetID = 2; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; fabric_idx fabricIndex = 254; } - fabric_scoped struct GroupInfoMapStruct { + fabric_scoped struct GroupKeyMapStruct { group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; + int16u groupKeySetID = 2; fabric_idx fabricIndex = 254; } @@ -1665,6 +1685,11 @@ server cluster GroupKeyManagement = 63 { /** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only labels. */ server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1676,6 +1701,11 @@ server cluster FixedLabel = 64 { /** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/window-app/silabs/SiWx917/include/AppConfig.h b/examples/window-app/silabs/SiWx917/include/AppConfig.h index 661819aea7648b..7a3f809ac217c5 100644 --- a/examples/window-app/silabs/SiWx917/include/AppConfig.h +++ b/examples/window-app/silabs/SiWx917/include/AppConfig.h @@ -35,7 +35,7 @@ extern "C" { #define LIFT_OPEN_LIMIT 0 #define LIFT_CLOSED_LIMIT (LCD_COVER_SIZE - 1) #define LIFT_DELTA 1000 // 10% -#define TILT_OPEN_LIMIT 1 +#define TILT_OPEN_LIMIT 0 #define TILT_CLOSED_LIMIT (LCD_COVER_SIZE / 10 - 1) #define TILT_DELTA 1000 // 10% diff --git a/examples/window-app/silabs/efr32/include/AppConfig.h b/examples/window-app/silabs/efr32/include/AppConfig.h index 661819aea7648b..7a3f809ac217c5 100644 --- a/examples/window-app/silabs/efr32/include/AppConfig.h +++ b/examples/window-app/silabs/efr32/include/AppConfig.h @@ -35,7 +35,7 @@ extern "C" { #define LIFT_OPEN_LIMIT 0 #define LIFT_CLOSED_LIMIT (LCD_COVER_SIZE - 1) #define LIFT_DELTA 1000 // 10% -#define TILT_OPEN_LIMIT 1 +#define TILT_OPEN_LIMIT 0 #define TILT_CLOSED_LIMIT (LCD_COVER_SIZE / 10 - 1) #define TILT_DELTA 1000 // 10% diff --git a/scripts/flashing/bouffalolab_firmware_utils.py b/scripts/flashing/bouffalolab_firmware_utils.py index c968c90f2f839c..2e7596892da94a 100644 --- a/scripts/flashing/bouffalolab_firmware_utils.py +++ b/scripts/flashing/bouffalolab_firmware_utils.py @@ -86,6 +86,29 @@ 'type': pathlib.Path } }, + 'pk': { + 'help': 'public key to sign and encrypt firmware. Available for OTA image building.', + 'default': None, + 'argparse': { + 'metavar': 'path', + 'type': pathlib.Path + } + }, + 'sk': { + 'help': 'private key to sign and encrypt firmware. Available for OTA image building.', + 'default': None, + 'argparse': { + 'metavar': 'path', + 'type': pathlib.Path + } + }, + 'boot2': { + 'help': 'boot2 image.', + 'default': None, + 'argparse': { + 'metavar': 'path', + } + } }, } @@ -98,16 +121,20 @@ def __init__(self, **options): super().__init__(platform=None, module=__name__, **options) self.define_options(BOUFFALO_OPTIONS) - def get_boot_image(self, config_path): + def get_boot_image(self, config_path, boot2_image): boot_image_guess = None for root, dirs, files in os.walk(config_path, topdown=False): for name in files: - if name == "boot2_isp_release.bin": - return os.path.join(root, name) - elif not boot_image_guess and name.find("release") >= 0: - boot_image_guess = os.path.join(root, name) + print("get_boot_image", root, boot2_image) + if boot2_image: + return os.path.join(root, boot2_image) + else: + if name == "boot2_isp_release.bin": + return os.path.join(root, name) + elif not boot_image_guess and name.find("release") >= 0: + boot_image_guess = os.path.join(root, name) return boot_image_guess @@ -147,10 +174,17 @@ def actions(self): chip_name = None chip_config_path = None - boot_image = None + boot2_image = None dts_path = None xtal_value = None + is_for_ota_image_building = False + is_for_programming = False + has_private_key = False + has_public_key = False + + boot2_image = None + command_args = {} for (key, value) in dict(vars(self.option)).items(): @@ -164,6 +198,9 @@ def actions(self): if key == "application": key = "firmware" work_dir = os.path.dirname(os.path.join(os.getcwd(), str(value))) + elif key == "boot2": + boot2_image = value + continue elif key in options_keys: pass else: @@ -183,11 +220,32 @@ def actions(self): xtal_value = value elif key == "dts": dts_path = value + elif "port" == key: + if value: + is_for_programming = True + elif "build" == key: + if value: + is_for_ota_image_building = True + elif "pk" == key: + if value: + has_public_key = True + elif "sk" == key: + if value: + has_private_key = True arguments.append(arg) print(key, value) + if is_for_ota_image_building and is_for_programming: + print("ota imge build can't work with image programming") + return self + + if is_for_ota_image_building: + if (has_private_key is not has_public_key) and (has_private_key or has_public_key): + print("For ota image signature, key pair must be used together") + return self + print(dts_path, xtal_value) if not dts_path and xtal_value: chip_config_path = os.path.join(tool_path, "chips", chip_name, "device_tree") @@ -195,14 +253,20 @@ def actions(self): arguments.append("--dts") arguments.append(dts_path) - if self.option.erase: - arguments.append("--erase") - - if chip_name == "bl602": - chip_config_path = os.path.join(tool_path, "chips", chip_name, "builtin_imgs") - boot_image = self.get_boot_image(chip_config_path) - arguments.append("--boot2") - arguments.append(boot_image) + if boot2_image: + chip_config_path = os.path.join(tool_path, "chips", chip_name, "builtin_imgs") + boot2_image = self.get_boot_image(chip_config_path, boot2_image) + arguments.append("--boot2") + arguments.append(boot2_image) + else: + if self.option.erase: + arguments.append("--erase") + + if chip_name == "bl602": + chip_config_path = os.path.join(tool_path, "chips", chip_name, "builtin_imgs") + boot2_image = self.get_boot_image(chip_config_path, boot2_image) + arguments.append("--boot2") + arguments.append(boot2_image) os.chdir(work_dir) arguments[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', arguments[0]) diff --git a/scripts/py_matter_yamltests/matter_yamltests/fixes.py b/scripts/py_matter_yamltests/matter_yamltests/fixes.py index 0223c2e1a486f1..5ddfd97e9c1e6f 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/fixes.py +++ b/scripts/py_matter_yamltests/matter_yamltests/fixes.py @@ -85,7 +85,11 @@ def convert_yaml_octet_string_to_bytes(s: str) -> bytes: if s.startswith('hex:'): return binascii.unhexlify(s[4:]) - # Step 2: convert non-hex-prefixed to bytes + # Step 2: handle explicit "base64:" prefix + if s.startswith('base64:'): + return binascii.a2b_base64(s[7:]) + + # Step 3: convert non-hex-prefixed to bytes # TODO(#23669): This does not properly support utf8 octet strings. We mimic # javascript codegen behavior. Behavior of javascript is: # * Octet string character >= u+0200 errors out. diff --git a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/commissioner_commands.py b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/commissioner_commands.py index 08e22da1bb62b6..d3cc92b7aa10b9 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/commissioner_commands.py +++ b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/commissioner_commands.py @@ -37,6 +37,26 @@ + + + + + + + + + + + + + + + + + + + + ''' diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 7692ac08e8074f..9ddbc0ef8f2d21 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -133,7 +133,9 @@ def _GetInDevelopmentTests() -> Set[str]: Currently this is empty and returns an empty set, but this is kept around in case there are tests that are a work in progress. """ - return set() + return { + "Test_AddNewFabricFromExistingFabric.yaml", # chip-repl does not support GetCommissionerRootCertificate and IssueNocChain command + } def _AllYamlTests(): diff --git a/scripts/tests/yaml/chiptool.py b/scripts/tests/yaml/chiptool.py index 9218832ea8c0f5..c5d6724b1459cd 100755 --- a/scripts/tests/yaml/chiptool.py +++ b/scripts/tests/yaml/chiptool.py @@ -29,12 +29,19 @@ @click.pass_context -def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str): - parser_builder_config = ctx.invoke(runner_base, test_name=test_name, pics=pics) +def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, pics: str, commands: list[str]): + kwargs = {'test_name': test_name, 'pics': pics} + + index = 0 + while len(commands) - index > 1: + kwargs[commands[index].replace('--', '')] = commands[index+1] + index += 2 + ctx.invoke(runner_base, **kwargs) del ctx.params['commands'] del ctx.params['pics'] - return ctx.forward(chiptool, parser_builder_config) + + return ctx.forward(chiptool) def send_raw_command(command: str, server_path: str, server_arguments: str): @@ -88,7 +95,7 @@ def chiptool_py(ctx, commands: list[str], server_path: str, server_name: str, se success = False if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(commands[1], server_path, server_arguments, pics) + success = send_yaml_command(commands[1], server_path, server_arguments, pics, commands[2:]) else: if server_path is None and server_name: paths_finder = PathsFinder() diff --git a/src/app/OperationalSessionSetup.cpp b/src/app/OperationalSessionSetup.cpp index f0cbece56cffae..92c53d9b5329e2 100644 --- a/src/app/OperationalSessionSetup.cpp +++ b/src/app/OperationalSessionSetup.cpp @@ -262,7 +262,7 @@ void OperationalSessionSetup::EnqueueConnectionCallbacks(Callback::CallbackmCall(cb->mContext, *exchangeMgr, optionalSessionHandle.Value()); } } +} + +void OperationalSessionSetup::DequeueConnectionCallbacks(CHIP_ERROR error) +{ + DequeueConnectionCallbacksWithoutReleasing(error); VerifyOrDie(mReleaseDelegate != nullptr); mReleaseDelegate->ReleaseSession(this); } @@ -429,6 +434,8 @@ OperationalSessionSetup::~OperationalSessionSetup() #if CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES CancelSessionSetupReattempt(); #endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES + + DequeueConnectionCallbacksWithoutReleasing(CHIP_ERROR_CANCELLED); } CHIP_ERROR OperationalSessionSetup::LookupPeerAddress() diff --git a/src/app/OperationalSessionSetup.h b/src/app/OperationalSessionSetup.h index e7522d5d62e978..5dbdff6ebb2f9c 100644 --- a/src/app/OperationalSessionSetup.h +++ b/src/app/OperationalSessionSetup.h @@ -322,6 +322,12 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate, */ void DequeueConnectionCallbacks(CHIP_ERROR error); + /* + * Like DequeueConnectionCallbacks but does not release ourselves. For use + * from our destructor. + */ + void DequeueConnectionCallbacksWithoutReleasing(CHIP_ERROR error); + /** * Triggers a DNSSD lookup to find a usable peer address. */ diff --git a/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp b/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp index 03f2581a0e443f..489e6788be77f9 100644 --- a/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp +++ b/src/app/clusters/scenes/ExtensionFieldSetsImpl.cpp @@ -121,7 +121,7 @@ CHIP_ERROR ExtensionFieldSetsImpl::InsertFieldSet(const ExtensionFieldSet & fiel CHIP_ERROR ExtensionFieldSetsImpl::GetFieldSetAtPosition(ExtensionFieldSet & fieldSet, uint8_t position) const { - VerifyOrReturnError(position < mFieldSetsCount, CHIP_ERROR_BUFFER_TOO_SMALL); + VerifyOrReturnError(position < mFieldSetsCount, CHIP_ERROR_INVALID_ARGUMENT); fieldSet = mFieldSets[position]; diff --git a/src/app/clusters/scenes/SceneTable.h b/src/app/clusters/scenes/SceneTable.h index bdb1f261cd9067..4352158db1f217 100644 --- a/src/app/clusters/scenes/SceneTable.h +++ b/src/app/clusters/scenes/SceneTable.h @@ -1,301 +1,310 @@ -/* - * - * 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 -#include -#include -#include -#include -#include -#include - -namespace chip { -namespace scenes { - -// Storage index for scenes in nvm -typedef uint8_t SceneIndex; - -typedef uint32_t TransitionTimeMs; -typedef uint32_t SceneTransitionTime; - -constexpr GroupId kGlobalGroupSceneId = 0x0000; -constexpr SceneIndex kUndefinedSceneIndex = 0xff; -constexpr SceneId kUndefinedSceneId = 0xff; -static constexpr uint8_t kMaxScenesPerFabric = CHIP_CONFIG_SCENES_MAX_PER_FABRIC; - -static constexpr size_t kIteratorsMax = CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS; -static constexpr size_t kSceneNameMaxLength = CHIP_CONFIG_SCENES_CLUSTER_MAXIMUM_NAME_LENGTH; - -/// @brief SceneHandlers are meant as interface between various clusters and the Scene table. -/// When a scene command involving extension field sets is received, the Scene Table will go through -/// the list of handlers to either retrieve, populate or apply those extension field sets. -/// -/// Generally, for each specific pair there should be one and only one handler -/// registered with the scene table that claims to handle that pair. -/// -/// A SceneHandler can handle a single pair, or many such pairs. -/// -/// @note If more than one handler claims to handle a specific pair, only one of -/// those handlers will get called when executing actions related to extension field sets on the scene -/// table. It is not defined which handler will be selected. - -class SceneHandler : public IntrusiveListNodeBase<> -{ -public: - SceneHandler(){}; - virtual ~SceneHandler() = default; - - /// @brief Copies the list of supported clusters for an endpoint in a Span and resizes the span to fit the actual number of - /// supported clusters - /// @param endpoint target endpoint - /// @param clusterBuffer Buffer to hold the supported cluster IDs, cannot hold more than - /// CHIP_CONFIG_SCENES_MAX_CLUSTERS_PER_SCENE. The function shall use the reduce_size() method in the event it is supporting - /// less than CHIP_CONFIG_SCENES_MAX_CLUSTERS_PER_SCENE clusters. - virtual void GetSupportedClusters(EndpointId endpoint, Span & clusterBuffer) = 0; - - /// @brief Returns whether or not a cluster for scenes is supported on an endpoint - /// - /// @param endpoint Target Endpoint ID - /// @param cluster Target Cluster ID - /// @return true if supported, false if not supported - virtual bool SupportsCluster(EndpointId endpoint, ClusterId cluster) = 0; - - /// @brief Called when handling AddScene. Allows the handler to filter through the clusters in the command to serialize only - /// the supported ones. - /// - /// @param endpoint[in] Endpoint ID - /// @param extensionFieldSet[in] ExtensionFieldSets provided by the AddScene Command, pre initialized - /// @param serialisedBytes[out] Buffer to fill from the ExtensionFieldSet in command - /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise - /// @note Only gets called after the scene-cluster has previously verified that the endpoint,cluster pair is supported by - - /// the handler. It is therefore the implementation's reponsibility to also implement the SupportsCluster method. - virtual CHIP_ERROR SerializeAdd(EndpointId endpoint, - const app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & extensionFieldSet, - MutableByteSpan & serialisedBytes) = 0; - - /// @brief Called when handling StoreScene, and only if the handler supports the given endpoint and cluster. - /// - /// The implementation must write the actual scene data to store to serializedBytes as described below. - /// - /// @param endpoint[in] Target Endpoint - /// @param cluster[in] Target Cluster - /// @param serializedBytes[out] Output buffer, data needs to be writen in there and size adjusted to the size of the data - /// written. - /// - /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise - virtual CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) = 0; - - /// @brief Deserialize an ExtensionFieldSet into a cluster object (e.g. when handling ViewScene). - /// - /// @param endpoint[in] Endpoint ID - /// @param cluster[in] Cluster ID - /// @param serializedBytes[in] ExtensionFieldSet stored in NVM - /// - /// @param extensionFieldSet[out] ExtensionFieldSet in command format - /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise - /// @note Only gets called for handlers for which SupportsCluster() is true for the given endpoint and cluster. - virtual CHIP_ERROR Deserialize(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, - - app::Clusters::Scenes::Structs::ExtensionFieldSet::Type & extensionFieldSet) = 0; - - /// @brief Restore a stored scene for the given cluster instance, over timeMs milliseconds (e.g. when handling RecallScene) - /// - /// @param endpoint[in] Endpoint ID - /// @param cluster[in] Cluster ID - /// @param serializedBytes[in] ExtensionFieldSet stored in NVM - /// - /// @param timeMs[in] Transition time in ms to apply the scene - /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise - /// @note Only gets called for handlers for which SupportsCluster() is true for the given endpoint and cluster. - virtual CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, - TransitionTimeMs timeMs) = 0; -}; - -template -class SceneTable -{ -public: - /// @brief struct used to identify a scene in storage by 3 ids, endpoint, group and scene - struct SceneStorageId - { - // Identifies endpoint to which this scene applies - EndpointId mEndpointId = kInvalidEndpointId; - // Identifies group within the scope of the given fabric - GroupId mGroupId = kGlobalGroupSceneId; - SceneId mSceneId = kUndefinedSceneId; - - SceneStorageId() = default; - SceneStorageId(EndpointId endpoint, SceneId id, GroupId groupId = kGlobalGroupSceneId) : - mEndpointId(endpoint), mGroupId(groupId), mSceneId(id) - {} - - void Clear() - { - mEndpointId = kInvalidEndpointId; - mGroupId = kGlobalGroupSceneId; - mSceneId = kUndefinedSceneId; - } - - bool IsValid() { return (mEndpointId != kInvalidEndpointId) && (mSceneId != kUndefinedSceneId); } - - bool operator==(const SceneStorageId & other) - { - return (mEndpointId == other.mEndpointId && mGroupId == other.mGroupId && mSceneId == other.mSceneId); - } - }; - - /// @brief struct used to store data held in a scene - /// Members: - /// mName: char buffer holding the name of the scene, only serialized when mNameLenght is greater than 0 - /// mNameLength: lentgh of the name if a name was provided at scene creation - /// mSceneTransitionTimeSeconds: Time in seconds it will take a cluster to change to the scene - /// mExtensionFieldSets: class holding the different field sets of each cluster values to store with the scene - /// mTransitionTime100ms: Transition time in tenths of a second, allows for more precise transition when combiened with - /// mSceneTransitionTimeSeconds in enhanced scene commands - struct SceneData - { - char mName[kSceneNameMaxLength] = { 0 }; - size_t mNameLength = 0; - SceneTransitionTime mSceneTransitionTimeMs = 0; - EFStype mExtensionFieldSets; - - SceneData(const CharSpan & sceneName = CharSpan(), SceneTransitionTime time = 0) : mSceneTransitionTimeMs(time) - { - SetName(sceneName); - } - SceneData(EFStype fields, const CharSpan & sceneName = CharSpan(), SceneTransitionTime time = 0) : - mSceneTransitionTimeMs(time) - { - SetName(sceneName); - - mExtensionFieldSets = fields; - } - SceneData(const SceneData & other) : mSceneTransitionTimeMs(other.mSceneTransitionTimeMs) - { - SetName(CharSpan(other.mName, other.mNameLength)); - - mExtensionFieldSets = other.mExtensionFieldSets; - } - ~SceneData(){}; - - void SetName(const CharSpan & sceneName) - { - if (nullptr == sceneName.data()) - { - mName[0] = 0; - mNameLength = 0; - } - else - { - size_t maxChars = std::min(sceneName.size(), kSceneNameMaxLength); - memcpy(mName, sceneName.data(), maxChars); - mNameLength = maxChars; - } - } - - void Clear() - { - SetName(CharSpan()); - - mSceneTransitionTimeMs = 0; - mExtensionFieldSets.Clear(); - } - - bool operator==(const SceneData & other) - { - return (mNameLength == other.mNameLength && !memcmp(mName, other.mName, mNameLength) && - (mSceneTransitionTimeMs == other.mSceneTransitionTimeMs) && (mExtensionFieldSets == other.mExtensionFieldSets)); - } - - void operator=(const SceneData & other) - { - SetName(CharSpan(other.mName, other.mNameLength)); - mExtensionFieldSets = other.mExtensionFieldSets; - mSceneTransitionTimeMs = other.mSceneTransitionTimeMs; - } - }; - - /// @brief Struct combining both ID and data of a table entry - struct SceneTableEntry - { - // ID - SceneStorageId mStorageId; - - // DATA - SceneData mStorageData; - - SceneTableEntry() = default; - SceneTableEntry(SceneStorageId id) : mStorageId(id) {} - SceneTableEntry(const SceneStorageId id, const SceneData data) : mStorageId(id), mStorageData(data) {} - - bool operator==(const SceneTableEntry & other) - { - return (mStorageId == other.mStorageId && mStorageData == other.mStorageData); - } - - void operator=(const SceneTableEntry & other) - { - mStorageId = other.mStorageId; - mStorageData = other.mStorageData; - } - }; - - SceneTable(){}; - - virtual ~SceneTable() = default; - - // Not copyable - SceneTable(const SceneTable &) = delete; - - SceneTable & operator=(const SceneTable &) = delete; - - virtual CHIP_ERROR Init(PersistentStorageDelegate * storage) = 0; - virtual void Finish() = 0; - - // Data - virtual CHIP_ERROR SetSceneTableEntry(FabricIndex fabric_index, const SceneTableEntry & entry) = 0; - virtual CHIP_ERROR GetSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id, SceneTableEntry & entry) = 0; - virtual CHIP_ERROR RemoveSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id) = 0; - virtual CHIP_ERROR RemoveSceneTableEntryAtPosition(FabricIndex fabric_index, SceneIndex scene_idx) = 0; - - // SceneHandlers - virtual void RegisterHandler(SceneHandler * handler) = 0; - virtual void UnregisterHandler(SceneHandler * handler) = 0; - virtual void UnregisterAllHandlers() = 0; - - // Extension field sets operation - virtual CHIP_ERROR SceneSaveEFS(SceneTableEntry & scene) = 0; - virtual CHIP_ERROR SceneApplyEFS(const SceneTableEntry & scene) = 0; - - // Fabrics - virtual CHIP_ERROR RemoveFabric(FabricIndex fabric_index) = 0; - - // Iterators - using SceneEntryIterator = CommonIterator; - - virtual SceneEntryIterator * IterateSceneEntries(FabricIndex fabric_index) = 0; - - // Handlers - virtual bool HandlerListEmpty() { return mHandlerList.Empty(); } - - IntrusiveList mHandlerList; -}; - -} // namespace scenes -} // namespace chip +/* + * + * 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 +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace scenes { + +// Storage index for scenes in nvm +typedef uint8_t SceneIndex; + +typedef uint32_t TransitionTimeMs; +typedef uint32_t SceneTransitionTime; + +constexpr GroupId kGlobalGroupSceneId = 0x0000; +constexpr SceneIndex kUndefinedSceneIndex = 0xff; +constexpr SceneId kUndefinedSceneId = 0xff; +static constexpr uint8_t kMaxScenesPerFabric = CHIP_CONFIG_SCENES_MAX_PER_FABRIC; +static constexpr uint8_t kMaxScenesGlobal = CHIP_CONFIG_SCENES_MAX_NUMBER; + +static constexpr size_t kIteratorsMax = CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS; +static constexpr size_t kSceneNameMaxLength = CHIP_CONFIG_SCENES_CLUSTER_MAXIMUM_NAME_LENGTH; + +/// @brief SceneHandlers are meant as interface between various clusters and the Scene table. +/// When a scene command involving extension field sets is received, the Scene Table will go through +/// the list of handlers to either retrieve, populate or apply those extension field sets. +/// +/// Generally, for each specific pair there should be one and only one handler +/// registered with the scene table that claims to handle that pair. +/// +/// A SceneHandler can handle a single pair, or many such pairs. +/// +/// @note If more than one handler claims to handle a specific pair, only one of +/// those handlers will get called when executing actions related to extension field sets on the scene +/// table. It is not defined which handler will be selected. + +class SceneHandler : public IntrusiveListNodeBase<> +{ +public: + SceneHandler(){}; + virtual ~SceneHandler() = default; + + /// @brief Copies the list of supported clusters for an endpoint in a Span and resizes the span to fit the actual number of + /// supported clusters + /// @param endpoint target endpoint + /// @param clusterBuffer Buffer to hold the supported cluster IDs, cannot hold more than + /// CHIP_CONFIG_SCENES_MAX_CLUSTERS_PER_SCENE. The function shall use the reduce_size() method in the event it is supporting + /// less than CHIP_CONFIG_SCENES_MAX_CLUSTERS_PER_SCENE clusters. + virtual void GetSupportedClusters(EndpointId endpoint, Span & clusterBuffer) = 0; + + /// @brief Returns whether or not a cluster for scenes is supported on an endpoint + /// + /// @param endpoint Target Endpoint ID + /// @param cluster Target Cluster ID + /// @return true if supported, false if not supported + virtual bool SupportsCluster(EndpointId endpoint, ClusterId cluster) = 0; + + /// @brief Called when handling AddScene. Allows the handler to filter through the clusters in the command to serialize only + /// the supported ones. + /// + /// @param endpoint[in] Endpoint ID + /// @param extensionFieldSet[in] ExtensionFieldSets provided by the AddScene Command, pre initialized + /// @param serialisedBytes[out] Buffer to fill from the ExtensionFieldSet in command + /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise + /// @note Only gets called after the scene-cluster has previously verified that the endpoint,cluster pair is supported by + + /// the handler. It is therefore the implementation's reponsibility to also implement the SupportsCluster method. + virtual CHIP_ERROR SerializeAdd(EndpointId endpoint, + const app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & extensionFieldSet, + MutableByteSpan & serialisedBytes) = 0; + + /// @brief Called when handling StoreScene, and only if the handler supports the given endpoint and cluster. + /// + /// The implementation must write the actual scene data to store to serializedBytes as described below. + /// + /// @param endpoint[in] Target Endpoint + /// @param cluster[in] Target Cluster + /// @param serializedBytes[out] Output buffer, data needs to be writen in there and size adjusted to the size of the data + /// written. + /// + /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise + virtual CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) = 0; + + /// @brief Deserialize an ExtensionFieldSet into a cluster object (e.g. when handling ViewScene). + /// + /// @param endpoint[in] Endpoint ID + /// @param cluster[in] Cluster ID + /// @param serializedBytes[in] ExtensionFieldSet stored in NVM + /// + /// @param extensionFieldSet[out] ExtensionFieldSet in command format + /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise + /// @note Only gets called for handlers for which SupportsCluster() is true for the given endpoint and cluster. + virtual CHIP_ERROR Deserialize(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, + + app::Clusters::Scenes::Structs::ExtensionFieldSet::Type & extensionFieldSet) = 0; + + /// @brief Restore a stored scene for the given cluster instance, over timeMs milliseconds (e.g. when handling RecallScene) + /// + /// @param endpoint[in] Endpoint ID + /// @param cluster[in] Cluster ID + /// @param serializedBytes[in] ExtensionFieldSet stored in NVM + /// + /// @param timeMs[in] Transition time in ms to apply the scene + /// @return CHIP_NO_ERROR if successful, CHIP_ERROR value otherwise + /// @note Only gets called for handlers for which SupportsCluster() is true for the given endpoint and cluster. + virtual CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, + TransitionTimeMs timeMs) = 0; +}; + +template +class SceneTable +{ +public: + /// @brief struct used to identify a scene in storage by 3 ids, endpoint, group and scene + struct SceneStorageId + { + // Identifies endpoint to which this scene applies + EndpointId mEndpointId = kInvalidEndpointId; + // Identifies group within the scope of the given fabric + GroupId mGroupId = kGlobalGroupSceneId; + SceneId mSceneId = kUndefinedSceneId; + + SceneStorageId() = default; + SceneStorageId(EndpointId endpoint, SceneId id, GroupId groupId = kGlobalGroupSceneId) : + mEndpointId(endpoint), mGroupId(groupId), mSceneId(id) + {} + + void Clear() + { + mEndpointId = kInvalidEndpointId; + mGroupId = kGlobalGroupSceneId; + mSceneId = kUndefinedSceneId; + } + + bool IsValid() { return (mEndpointId != kInvalidEndpointId) && (mSceneId != kUndefinedSceneId); } + + bool operator==(const SceneStorageId & other) + { + return (mEndpointId == other.mEndpointId && mGroupId == other.mGroupId && mSceneId == other.mSceneId); + } + }; + + /// @brief struct used to store data held in a scene + /// Members: + /// mName: char buffer holding the name of the scene, only serialized when mNameLenght is greater than 0 + /// mNameLength: lentgh of the name if a name was provided at scene creation + /// mSceneTransitionTimeSeconds: Time in seconds it will take a cluster to change to the scene + /// mExtensionFieldSets: class holding the different field sets of each cluster values to store with the scene + /// mTransitionTime100ms: Transition time in tenths of a second, allows for more precise transition when combiened with + /// mSceneTransitionTimeSeconds in enhanced scene commands + struct SceneData + { + char mName[kSceneNameMaxLength] = { 0 }; + size_t mNameLength = 0; + SceneTransitionTime mSceneTransitionTimeMs = 0; + EFStype mExtensionFieldSets; + + SceneData(const CharSpan & sceneName = CharSpan(), SceneTransitionTime time = 0) : mSceneTransitionTimeMs(time) + { + SetName(sceneName); + } + SceneData(EFStype fields, const CharSpan & sceneName = CharSpan(), SceneTransitionTime time = 0) : + mSceneTransitionTimeMs(time) + { + SetName(sceneName); + + mExtensionFieldSets = fields; + } + SceneData(const SceneData & other) : mSceneTransitionTimeMs(other.mSceneTransitionTimeMs) + { + SetName(CharSpan(other.mName, other.mNameLength)); + + mExtensionFieldSets = other.mExtensionFieldSets; + } + ~SceneData(){}; + + void SetName(const CharSpan & sceneName) + { + if (nullptr == sceneName.data()) + { + mName[0] = 0; + mNameLength = 0; + } + else + { + size_t maxChars = std::min(sceneName.size(), kSceneNameMaxLength); + memcpy(mName, sceneName.data(), maxChars); + mNameLength = maxChars; + } + } + + void Clear() + { + SetName(CharSpan()); + + mSceneTransitionTimeMs = 0; + mExtensionFieldSets.Clear(); + } + + bool operator==(const SceneData & other) + { + return (mNameLength == other.mNameLength && !memcmp(mName, other.mName, mNameLength) && + (mSceneTransitionTimeMs == other.mSceneTransitionTimeMs) && (mExtensionFieldSets == other.mExtensionFieldSets)); + } + + void operator=(const SceneData & other) + { + SetName(CharSpan(other.mName, other.mNameLength)); + mExtensionFieldSets = other.mExtensionFieldSets; + mSceneTransitionTimeMs = other.mSceneTransitionTimeMs; + } + }; + + /// @brief Struct combining both ID and data of a table entry + struct SceneTableEntry + { + // ID + SceneStorageId mStorageId; + + // DATA + SceneData mStorageData; + + SceneTableEntry() = default; + SceneTableEntry(SceneStorageId id) : mStorageId(id) {} + SceneTableEntry(const SceneStorageId id, const SceneData data) : mStorageId(id), mStorageData(data) {} + + bool operator==(const SceneTableEntry & other) + { + return (mStorageId == other.mStorageId && mStorageData == other.mStorageData); + } + + void operator=(const SceneTableEntry & other) + { + mStorageId = other.mStorageId; + mStorageData = other.mStorageData; + } + }; + + SceneTable(){}; + + virtual ~SceneTable() = default; + + // Not copyable + SceneTable(const SceneTable &) = delete; + + SceneTable & operator=(const SceneTable &) = delete; + + virtual CHIP_ERROR Init(PersistentStorageDelegate * storage) = 0; + virtual void Finish() = 0; + + // Global scene count + virtual CHIP_ERROR GetGlobalSceneCount(uint8_t & scene_count) = 0; + + // Data + virtual CHIP_ERROR GetRemainingCapacity(FabricIndex fabric_index, uint8_t & capacity) = 0; + virtual CHIP_ERROR SetSceneTableEntry(FabricIndex fabric_index, const SceneTableEntry & entry) = 0; + virtual CHIP_ERROR GetSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id, SceneTableEntry & entry) = 0; + virtual CHIP_ERROR RemoveSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id) = 0; + virtual CHIP_ERROR RemoveSceneTableEntryAtPosition(FabricIndex fabric_index, SceneIndex scene_idx) = 0; + + // Groups + virtual CHIP_ERROR GetAllSceneIdsInGroup(FabricIndex fabric_index, GroupId group_id, Span & scene_list) = 0; + virtual CHIP_ERROR DeleteAllScenesInGroup(FabricIndex fabric_index, GroupId group_id) = 0; + + // SceneHandlers + virtual void RegisterHandler(SceneHandler * handler) = 0; + virtual void UnregisterHandler(SceneHandler * handler) = 0; + virtual void UnregisterAllHandlers() = 0; + + // Extension field sets operation + virtual CHIP_ERROR SceneSaveEFS(SceneTableEntry & scene) = 0; + virtual CHIP_ERROR SceneApplyEFS(const SceneTableEntry & scene) = 0; + + // Fabrics + virtual CHIP_ERROR RemoveFabric(FabricIndex fabric_index) = 0; + + // Iterators + using SceneEntryIterator = CommonIterator; + + virtual SceneEntryIterator * IterateSceneEntries(FabricIndex fabric_index) = 0; + + // Handlers + virtual bool HandlerListEmpty() { return mHandlerList.Empty(); } + + IntrusiveList mHandlerList; +}; + +} // namespace scenes +} // namespace chip diff --git a/src/app/clusters/scenes/SceneTableImpl.cpp b/src/app/clusters/scenes/SceneTableImpl.cpp index 19b9a2994151f3..a34cd9179ddcc7 100644 --- a/src/app/clusters/scenes/SceneTableImpl.cpp +++ b/src/app/clusters/scenes/SceneTableImpl.cpp @@ -33,7 +33,8 @@ namespace scenes { /// kTransitionTime: Tag for the transition time of the scene in miliseconds enum class TagScene : uint8_t { - kSceneCount = 1, + kGlobalSceneCount = 1, + kSceneCount, kStorageIDArray, kEndpointID, kGroupID, @@ -47,6 +48,57 @@ using SceneTableEntry = DefaultSceneTableImpl::SceneTableEntry; using SceneStorageId = DefaultSceneTableImpl::SceneStorageId; using SceneData = DefaultSceneTableImpl::SceneData; +// Currently takes 5 Bytes to serialize Container and value in a TLV: 1 byte start struct, 2 bytes control + tag for the value, 1 +// byte value, 1 byte end struct. 8 Bytes leaves space for potential increase in count_value size. +static constexpr size_t kPersistentBufferSceneCountBytes = 8; + +struct GlobalSceneCount : public PersistentData +{ + uint8_t count_value = 0; + + GlobalSceneCount(uint8_t count = 0) : count_value(count) {} + ~GlobalSceneCount() {} + + void Clear() override { count_value = 0; } + + CHIP_ERROR UpdateKey(StorageKeyName & key) override + { + key = DefaultStorageKeyAllocator::GlobalSceneCountKey(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override + { + TLV::TLVType container; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container)); + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(TagScene::kGlobalSceneCount), count_value)); + return writer.EndContainer(container); + } + + CHIP_ERROR Deserialize(TLV::TLVReader & reader) override + { + ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag())); + + TLV::TLVType container; + ReturnErrorOnFailure(reader.EnterContainer(container)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kGlobalSceneCount))); + ReturnErrorOnFailure(reader.Get(count_value)); + return reader.ExitContainer(container); + } + + CHIP_ERROR Load(PersistentStorageDelegate * storage) override + { + CHIP_ERROR err = PersistentData::Load(storage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); + if (CHIP_ERROR_NOT_FOUND == err) + { + count_value = 0; + } + + return CHIP_NO_ERROR; + } +}; + // Worst case tested: Add Scene Command with EFS using the default SerializeAdd Method. This yielded a serialized scene of 212bytes // when using the OnOff, Level Control and Color Control as well as the maximal name length of 16 bytes. Putting 256 gives some // slack in case different clusters are used. Value obtained by using writer.GetLengthWritten at the end of the SceneTableData @@ -151,12 +203,17 @@ static constexpr size_t kPersistentFabricBufferMax = 128; */ struct FabricSceneData : public PersistentData { - FabricIndex fabric_index = kUndefinedFabricIndex; - uint8_t scene_count = 0; + FabricIndex fabric_index; + uint8_t scene_count = 0; + uint8_t max_scenes_per_fabric; + uint8_t max_scenes_global; SceneStorageId scene_map[kMaxScenesPerFabric]; - FabricSceneData() = default; - FabricSceneData(FabricIndex fabric) : fabric_index(fabric) {} + FabricSceneData(FabricIndex fabric = kUndefinedFabricIndex, uint8_t maxScenesPerFabric = kMaxScenesPerFabric, + uint8_t maxScenesGlobal = kMaxScenesGlobal) : + fabric_index(fabric), + max_scenes_per_fabric(maxScenesPerFabric), max_scenes_global(maxScenesGlobal) + {} CHIP_ERROR UpdateKey(StorageKeyName & key) override { @@ -168,7 +225,7 @@ struct FabricSceneData : public PersistentData void Clear() override { scene_count = 0; - for (uint8_t i = 0; i < kMaxScenesPerFabric; i++) + for (uint8_t i = 0; i < max_scenes_per_fabric; i++) { scene_map[i].Clear(); } @@ -184,7 +241,7 @@ struct FabricSceneData : public PersistentData writer.StartContainer(TLV::ContextTag(TagScene::kStorageIDArray), TLV::kTLVType_Array, sceneMapContainer)); // Storing the scene map - for (uint8_t i = 0; i < kMaxScenesPerFabric; i++) + for (uint8_t i = 0; i < max_scenes_per_fabric; i++) { TLV::TLVType sceneIdContainer; ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, sceneIdContainer)); @@ -197,40 +254,71 @@ struct FabricSceneData : public PersistentData return writer.EndContainer(fabricSceneContainer); } - CHIP_ERROR Deserialize(TLV::TLVReader & reader) override + /// @brief This Deserialize method is implemented only to allow compilation. It is not used throughout the code. + /// @param reader TLV reader + /// @return CHIP_NO_ERROR + CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { return CHIP_ERROR_INCORRECT_STATE; } + + /// @brief This Deserialize method checks that the recovered scenes from the deserialization fit in the current max and if + /// there are too many scenes in nvm, it deletes them. The method sets the deleted_scenes output parameter to true if scenes + /// were deleted so that the load function can know it needs to save the Fabric scene data to update the scene_count and the + /// scene map in stored memory. + /// @param reade [in] TLV reader, must be big enough to hold the scene map size + /// @param storage [in] Persistent Storage Delegate, required to delete scenes if the number of scenes in storage is greater + /// than the maximum allowed + /// @param deleted_scenes_count [out] uint8_t letting the caller (in this case the load method) know how many scenes were + /// deleted so it can adjust the fabric and global scene count accordingly. Even if Deserialize fails, this value will return + /// the number of scenes deleted before the failure happened. + /// @return CHIP_NO_ERROR on success, specific CHIP_ERROR otherwise + CHIP_ERROR Deserialize(TLV::TLVReader & reader, PersistentStorageDelegate * storage, uint8_t & deleted_scenes_count) { ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag())); - TLV::TLVType fabricSceneContainer; ReturnErrorOnFailure(reader.EnterContainer(fabricSceneContainer)); - ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kSceneCount))); ReturnErrorOnFailure(reader.Get(scene_count)); + scene_count = min(scene_count, max_scenes_per_fabric); ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Array, TLV::ContextTag(TagScene::kStorageIDArray))); TLV::TLVType sceneMapContainer; ReturnErrorOnFailure(reader.EnterContainer(sceneMapContainer)); uint8_t i = 0; CHIP_ERROR err; - while ((err = reader.Next(TLV::AnonymousTag())) == CHIP_NO_ERROR && i < kMaxScenesPerFabric) + deleted_scenes_count = 0; + + while ((err = reader.Next(TLV::AnonymousTag())) == CHIP_NO_ERROR) { TLV::TLVType sceneIdContainer; - ReturnErrorOnFailure(reader.EnterContainer(sceneIdContainer)); - ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kEndpointID))); - ReturnErrorOnFailure(reader.Get(scene_map[i].mEndpointId)); - ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kGroupID))); - ReturnErrorOnFailure(reader.Get(scene_map[i].mGroupId)); - ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kSceneID))); - ReturnErrorOnFailure(reader.Get(scene_map[i].mSceneId)); - ReturnErrorOnFailure(reader.ExitContainer(sceneIdContainer)); + if (i < max_scenes_per_fabric) + { + ReturnErrorOnFailure(reader.EnterContainer(sceneIdContainer)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kEndpointID))); + ReturnErrorOnFailure(reader.Get(scene_map[i].mEndpointId)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kGroupID))); + ReturnErrorOnFailure(reader.Get(scene_map[i].mGroupId)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kSceneID))); + ReturnErrorOnFailure(reader.Get(scene_map[i].mSceneId)); + ReturnErrorOnFailure(reader.ExitContainer(sceneIdContainer)); + } + else + { + SceneTableData scene(fabric_index, i); + ReturnErrorOnFailure(reader.EnterContainer(sceneIdContainer)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kEndpointID))); + ReturnErrorOnFailure(reader.Get(scene.mStorageId.mEndpointId)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kGroupID))); + ReturnErrorOnFailure(reader.Get(scene.mStorageId.mGroupId)); + ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kSceneID))); + ReturnErrorOnFailure(reader.Get(scene.mStorageId.mSceneId)); + ReturnErrorOnFailure(reader.ExitContainer(sceneIdContainer)); + ReturnErrorOnFailure(scene.Delete(storage)); + deleted_scenes_count++; + } i++; } - // In the event of an OTA, is kMaxScenesPerFabric was reduced, err will be equal to CHIP_NO_ERROR. We close the TLV with - // only the acceptable number of scenes and the next save will take care of reducing the memory usage of the map. This - // allows the user to preserve their scenes in between OTA updates. - VerifyOrReturnError(err == CHIP_END_OF_TLV || err == CHIP_NO_ERROR, err); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(sceneMapContainer)); return reader.ExitContainer(fabricSceneContainer); } @@ -246,7 +334,7 @@ struct FabricSceneData : public PersistentData SceneIndex firstFreeIdx = kUndefinedSceneIndex; // storage index if scene not found uint8_t index = 0; - while (index < kMaxScenesPerFabric) + while (index < max_scenes_per_fabric) { if (scene_map[index] == target_scene) { @@ -260,7 +348,7 @@ struct FabricSceneData : public PersistentData index++; } - if (firstFreeIdx < kMaxScenesPerFabric) + if (firstFreeIdx < max_scenes_per_fabric) { idx = firstFreeIdx; return CHIP_ERROR_NOT_FOUND; @@ -284,26 +372,48 @@ struct FabricSceneData : public PersistentData if (CHIP_ERROR_NOT_FOUND == err) // If not found, scene.index should be the first free index { + // Update the global scene count + GlobalSceneCount global_scene_count; + ReturnErrorOnFailure(global_scene_count.Load(storage)); + VerifyOrReturnError(global_scene_count.count_value < max_scenes_global, CHIP_ERROR_NO_MEMORY); + global_scene_count.count_value++; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + scene_count++; scene_map[scene.index] = scene.mStorageId; - ReturnErrorOnFailure(this->Save(storage)); + + err = this->Save(storage); + if (CHIP_NO_ERROR != err) + { + global_scene_count.count_value--; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + return err; + } err = scene.Save(storage); // on failure to save the scene, undoes the changes to Fabric Scene Data - if (err != CHIP_NO_ERROR) + if (CHIP_NO_ERROR != err) { + global_scene_count.count_value--; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + scene_count--; scene_map[scene.index].Clear(); ReturnErrorOnFailure(this->Save(storage)); + return err; } - - return err; } - return CHIP_ERROR_INVALID_LIST_LENGTH; + return err; } + /// @brief Removes a scene from the non-volatile memory and clears its index in the scene map. Decreases the number of scenes in + /// the global scene count and in the scene fabric data if successful. As the scene map size is not compressed upon removal, + /// this only clears the entry correpsonding to the scene from the scene map. + /// @param storage Storage delegate to access the scene + /// @param scene_id Scene to remove + /// @return CHIP_NO_ERROR if successful, specific CHIP_ERROR otherwise CHIP_ERROR RemoveScene(PersistentStorageDelegate * storage, const SceneStorageId & scene_id) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -315,22 +425,81 @@ struct FabricSceneData : public PersistentData // If Find doesn't return CHIP_NO_ERROR, the scene wasn't found, which doesn't return an error VerifyOrReturnValue(this->Find(scene_id, scene.index) == CHIP_NO_ERROR, CHIP_NO_ERROR); + // Update the global scene count + GlobalSceneCount global_scene_count; + ReturnErrorOnFailure(global_scene_count.Load(storage)); + global_scene_count.count_value--; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + scene_count--; scene_map[scene.index].Clear(); - ReturnErrorOnFailure(this->Save(storage)); + err = this->Save(storage); + + // On failure to update the scene map, undo the global count modification + if (CHIP_NO_ERROR != err) + { + global_scene_count.count_value++; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + return err; + } err = scene.Delete(storage); - // On failure to delete scene, undoes the change to the Fabric Scene Data - if (err != CHIP_NO_ERROR) + // On failure to delete scene, undo the change to the Fabric Scene Data and the global scene count + if (CHIP_NO_ERROR != err) { + global_scene_count.count_value++; + ReturnErrorOnFailure(global_scene_count.Save(storage)); + scene_count++; scene_map[scene.index] = scene.mStorageId; ReturnErrorOnFailure(this->Save(storage)); + return err; } } return err; } + + CHIP_ERROR Load(PersistentStorageDelegate * storage) override + { + VerifyOrReturnError(nullptr != storage, CHIP_ERROR_INVALID_ARGUMENT); + uint8_t deleted_scenes_count = 0; + + uint8_t buffer[kPersistentFabricBufferMax] = { 0 }; + StorageKeyName key = StorageKeyName::Uninitialized(); + + // Set data to defaults + Clear(); + + // Update storage key + ReturnErrorOnFailure(UpdateKey(key)); + + // Load the serialized data + uint16_t size = static_cast(sizeof(buffer)); + CHIP_ERROR err = storage->SyncGetKeyValue(key.KeyName(), buffer, size); + VerifyOrReturnError(CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND != err, CHIP_ERROR_NOT_FOUND); + ReturnErrorOnFailure(err); + + // Decode serialized data + TLV::TLVReader reader; + reader.Init(buffer, size); + + err = Deserialize(reader, storage, deleted_scenes_count); + + // If Deserialize sets the "deleted_scenes" variable, the table in flash memory held too many scenes (can happen + // if max_scenes_per_fabric was reduced during an OTA) and was adjusted during deserailizing . The fabric data must then + // be updated + if (deleted_scenes_count) + { + GlobalSceneCount global_count; + ReturnErrorOnFailure(global_count.Load(storage)); + global_count.count_value = static_cast(global_count.count_value - deleted_scenes_count); + ReturnErrorOnFailure(global_count.Save(storage)); + ReturnErrorOnFailure(this->Save(storage)); + } + + return err; + } }; CHIP_ERROR DefaultSceneTableImpl::Init(PersistentStorageDelegate * storage) @@ -340,6 +509,9 @@ CHIP_ERROR DefaultSceneTableImpl::Init(PersistentStorageDelegate * storage) return CHIP_ERROR_INCORRECT_STATE; } + // Verified the initialized parameter respect the maximum allowed values for scene capacity + VerifyOrReturnError(mMaxScenesPerFabric <= kMaxScenesPerFabric && mMaxScenesGlobal <= kMaxScenesGlobal, + CHIP_ERROR_INVALID_INTEGER_VALUE); mStorage = storage; return CHIP_NO_ERROR; } @@ -350,28 +522,91 @@ void DefaultSceneTableImpl::Finish() mSceneEntryIterators.ReleaseAll(); } -CHIP_ERROR DefaultSceneTableImpl::SetSceneTableEntry(FabricIndex fabric_index, const SceneTableEntry & entry) +CHIP_ERROR DefaultSceneTableImpl::GetGlobalSceneCount(uint8_t & scene_count) { VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + GlobalSceneCount global_count; + + ReturnErrorOnFailure(global_count.Load(mStorage)); + scene_count = global_count.count_value; + + return CHIP_NO_ERROR; +} +CHIP_ERROR DefaultSceneTableImpl::SetGlobalSceneCount(const uint8_t & scene_count) +{ + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + GlobalSceneCount global_count(scene_count); + return global_count.Save(mStorage); +} + +CHIP_ERROR DefaultSceneTableImpl::GetRemainingCapacity(FabricIndex fabric_index, uint8_t & capacity) +{ + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + uint8_t global_scene_count = 0; + ReturnErrorOnFailure(GetGlobalSceneCount(global_scene_count)); + + // If the global scene count is higher than the maximal Global scene capacity, this returns a capacity of 0 until enough scenes + // have been deleted to bring the global number of scenes under the global maximum. + if (global_scene_count > mMaxScenesGlobal) + { + capacity = 0; + return CHIP_NO_ERROR; + } + uint8_t remaining_capacity_global = static_cast(mMaxScenesGlobal - global_scene_count); + uint8_t remaining_capacity_fabric = mMaxScenesPerFabric; + FabricSceneData fabric(fabric_index); // Load fabric data (defaults to zero) CHIP_ERROR err = fabric.Load(mStorage); VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); + if (err == CHIP_NO_ERROR) + { + remaining_capacity_fabric = static_cast(mMaxScenesPerFabric - fabric.scene_count); + } + + capacity = min(remaining_capacity_fabric, remaining_capacity_global); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DefaultSceneTableImpl::SetSceneTableEntry(FabricIndex fabric_index, const SceneTableEntry & entry) +{ + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); + + // Load fabric data (defaults to zero) + CHIP_ERROR err = fabric.Load(mStorage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); + return fabric.SaveScene(mStorage, entry); } CHIP_ERROR DefaultSceneTableImpl::GetSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id, SceneTableEntry & entry) { - FabricSceneData fabric(fabric_index); + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); SceneTableData scene(fabric_index); ReturnErrorOnFailure(fabric.Load(mStorage)); VerifyOrReturnError(fabric.Find(scene_id, scene.index) == CHIP_NO_ERROR, CHIP_ERROR_NOT_FOUND); - ReturnErrorOnFailure(scene.Load(mStorage)); + CHIP_ERROR err = scene.Load(mStorage); + + // If scene.Load returns "buffer too small", the scene in memory is too big to be retrieve (this could happen if the + // kMaxClustersPerScene was reduced by OTA) and therefore must be deleted as is is no longer considered accessible. + if (err == CHIP_ERROR_BUFFER_TOO_SMALL) + { + ReturnErrorOnFailure(this->RemoveSceneTableEntry(fabric_index, scene_id)); + } + ReturnErrorOnFailure(err); + entry.mStorageId = scene.mStorageId; entry.mStorageData = scene.mStorageData; @@ -380,7 +615,9 @@ CHIP_ERROR DefaultSceneTableImpl::GetSceneTableEntry(FabricIndex fabric_index, S CHIP_ERROR DefaultSceneTableImpl::RemoveSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id) { - FabricSceneData fabric(fabric_index); + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); ReturnErrorOnFailure(fabric.Load(mStorage)); @@ -394,8 +631,10 @@ CHIP_ERROR DefaultSceneTableImpl::RemoveSceneTableEntry(FabricIndex fabric_index /// @return CHIP_NO_ERROR if removal was successful, errors if failed to remove the scene or to update the fabric after removing it CHIP_ERROR DefaultSceneTableImpl::RemoveSceneTableEntryAtPosition(FabricIndex fabric_index, SceneIndex scene_idx) { + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + CHIP_ERROR err = CHIP_NO_ERROR; - FabricSceneData fabric(fabric_index); + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); SceneTableData scene(fabric_index, scene_idx); ReturnErrorOnFailure(fabric.Load(mStorage)); @@ -406,6 +645,55 @@ CHIP_ERROR DefaultSceneTableImpl::RemoveSceneTableEntryAtPosition(FabricIndex fa return fabric.RemoveScene(mStorage, scene.mStorageId); } +CHIP_ERROR DefaultSceneTableImpl::GetAllSceneIdsInGroup(FabricIndex fabric_index, GroupId group_id, Span & scene_list) +{ + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); + SceneTableData scene(fabric_index); + + auto * iterator = this->IterateSceneEntries(fabric_index); + VerifyOrReturnError(nullptr != iterator, CHIP_ERROR_INTERNAL); + SceneId * list = scene_list.data(); + uint8_t scene_count = 0; + + while (iterator->Next(scene)) + { + if (scene.mStorageId.mGroupId == group_id) + { + if (scene_count >= scene_list.size()) + { + iterator->Release(); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + list[scene_count] = scene.mStorageId.mSceneId; + scene_count++; + } + } + scene_list.reduce_size(scene_count); + iterator->Release(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DefaultSceneTableImpl::DeleteAllScenesInGroup(FabricIndex fabric_index, GroupId group_id) +{ + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); + SceneTableData scene(fabric_index); + + ReturnErrorOnFailure(fabric.Load(mStorage)); + + for (uint8_t i = 0; i < mMaxScenesPerFabric; i++) + { + if (fabric.scene_map[i].mGroupId == group_id) + { + // Removing each scene from the nvm and clearing their entry in the scene map + ReturnErrorOnFailure(fabric.RemoveScene(mStorage, fabric.scene_map[i])); + } + } + + return CHIP_NO_ERROR; +} + /// @brief Register a handler in the handler linked list /// @param handler Cluster specific handler for extension field sets interaction void DefaultSceneTableImpl::RegisterHandler(SceneHandler * handler) @@ -502,12 +790,14 @@ CHIP_ERROR DefaultSceneTableImpl::SceneApplyEFS(const SceneTableEntry & scene) CHIP_ERROR DefaultSceneTableImpl::RemoveFabric(FabricIndex fabric_index) { + VerifyOrReturnError(IsInitialized(), CHIP_ERROR_INTERNAL); + FabricSceneData fabric(fabric_index); SceneIndex idx = 0; CHIP_ERROR err = fabric.Load(mStorage); VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); - while (idx < kMaxScenesPerFabric) + while (idx < mMaxScenesPerFabric) { err = RemoveSceneTableEntryAtPosition(fabric_index, idx); VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND == err, err); @@ -528,13 +818,15 @@ uint8_t DefaultSceneTableImpl::GetClustersFromEndpoint(EndpointId endpoint, Clus DefaultSceneTableImpl::SceneEntryIterator * DefaultSceneTableImpl::IterateSceneEntries(FabricIndex fabric_index) { VerifyOrReturnError(IsInitialized(), nullptr); - return mSceneEntryIterators.CreateObject(*this, fabric_index); + return mSceneEntryIterators.CreateObject(*this, fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); } -DefaultSceneTableImpl::SceneEntryIteratorImpl::SceneEntryIteratorImpl(DefaultSceneTableImpl & provider, FabricIndex fabric_index) : - mProvider(provider), mFabric(fabric_index) +DefaultSceneTableImpl::SceneEntryIteratorImpl::SceneEntryIteratorImpl(DefaultSceneTableImpl & provider, FabricIndex fabric_index, + uint8_t maxScenesPerFabric, uint8_t maxScenesGlobal) : + mProvider(provider), + mFabric(fabric_index), mMaxScenesPerFabric(maxScenesPerFabric), mMaxScenesGlobal(maxScenesGlobal) { - FabricSceneData fabric(fabric_index); + FabricSceneData fabric(fabric_index, mMaxScenesPerFabric, mMaxScenesGlobal); ReturnOnFailure(fabric.Load(provider.mStorage)); mTotalScenes = fabric.scene_count; mSceneIndex = 0; @@ -553,7 +845,7 @@ bool DefaultSceneTableImpl::SceneEntryIteratorImpl::Next(SceneTableEntry & outpu VerifyOrReturnError(fabric.Load(mProvider.mStorage) == CHIP_NO_ERROR, false); // looks for next available scene - while (mSceneIndex < kMaxScenesPerFabric) + while (mSceneIndex < mMaxScenesPerFabric) { if (fabric.scene_map[mSceneIndex].IsValid()) { diff --git a/src/app/clusters/scenes/SceneTableImpl.h b/src/app/clusters/scenes/SceneTableImpl.h index c136d4f630c124..c0453b5e9da58d 100644 --- a/src/app/clusters/scenes/SceneTableImpl.h +++ b/src/app/clusters/scenes/SceneTableImpl.h @@ -178,19 +178,27 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler class DefaultSceneTableImpl : public SceneTable { public: - DefaultSceneTableImpl() = default; + DefaultSceneTableImpl() {} ~DefaultSceneTableImpl() override {} CHIP_ERROR Init(PersistentStorageDelegate * storage) override; void Finish() override; - // Scene access by Id + // Global scene count + CHIP_ERROR GetGlobalSceneCount(uint8_t & scene_count) override; + + // Data + CHIP_ERROR GetRemainingCapacity(FabricIndex fabric_index, uint8_t & capacity) override; CHIP_ERROR SetSceneTableEntry(FabricIndex fabric_index, const SceneTableEntry & entry) override; CHIP_ERROR GetSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id, SceneTableEntry & entry) override; CHIP_ERROR RemoveSceneTableEntry(FabricIndex fabric_index, SceneStorageId scene_id) override; CHIP_ERROR RemoveSceneTableEntryAtPosition(FabricIndex fabric_index, SceneIndex scene_idx) override; + // Groups + CHIP_ERROR GetAllSceneIdsInGroup(FabricIndex fabric_index, GroupId group_id, Span & scene_list) override; + CHIP_ERROR DeleteAllScenesInGroup(FabricIndex fabric_index, GroupId group_id) override; + // SceneHandlers void RegisterHandler(SceneHandler * handler) override; void UnregisterHandler(SceneHandler * handler) override; @@ -208,13 +216,25 @@ class DefaultSceneTableImpl : public SceneTable SceneEntryIterator * IterateSceneEntries(FabricIndex fabric_index) override; protected: + // This constructor is meant for test purposes, it allows to change the defined max for scenes per fabric and global, which + // allows to simulate OTA where this value was changed + DefaultSceneTableImpl(uint8_t maxScenesPerFabric = scenes::kMaxScenesPerFabric, + uint8_t maxScenesGlobal = scenes::kMaxScenesGlobal) : + mMaxScenesPerFabric(maxScenesPerFabric), + mMaxScenesGlobal(maxScenesGlobal) + {} + + // Global scene count + CHIP_ERROR SetGlobalSceneCount(const uint8_t & scene_count); + // wrapper function around emberAfGetClustersFromEndpoint to allow override when testing virtual uint8_t GetClustersFromEndpoint(EndpointId endpoint, ClusterId * clusterList, uint8_t listLen); class SceneEntryIteratorImpl : public SceneEntryIterator { public: - SceneEntryIteratorImpl(DefaultSceneTableImpl & provider, FabricIndex fabric_index); + SceneEntryIteratorImpl(DefaultSceneTableImpl & provider, FabricIndex fabric_index, uint8_t maxScenesPerFabric, + uint8_t maxScenesGlobal); size_t Count() override; bool Next(SceneTableEntry & output) override; void Release() override; @@ -225,9 +245,13 @@ class DefaultSceneTableImpl : public SceneTable SceneIndex mNextSceneIdx; SceneIndex mSceneIndex = 0; uint8_t mTotalScenes = 0; + uint8_t mMaxScenesPerFabric; + uint8_t mMaxScenesGlobal; }; bool IsInitialized() { return (mStorage != nullptr); } + const uint8_t mMaxScenesPerFabric = kMaxScenesPerFabric; + const uint8_t mMaxScenesGlobal = kMaxScenesGlobal; chip::PersistentStorageDelegate * mStorage = nullptr; ObjectPool mSceneEntryIterators; }; // class DefaultSceneTableImpl diff --git a/src/app/tests/TestSceneTable.cpp b/src/app/tests/TestSceneTable.cpp index 45d0ca7c840171..c4e09b2b83e3e1 100644 --- a/src/app/tests/TestSceneTable.cpp +++ b/src/app/tests/TestSceneTable.cpp @@ -59,20 +59,33 @@ constexpr uint32_t kColorLoopActiveId = 0x4002; constexpr uint32_t kColorLoopDirectionId = 0x4003; constexpr uint32_t kColorLoopTimeId = 0x4004; +// Test Group ID +constexpr chip::GroupId kGroup1 = 0x101; +constexpr chip::GroupId kGroup2 = 0x102; +constexpr chip::GroupId kGroup3 = 0x103; +constexpr chip::GroupId kGroup4 = 0x00; + +// Test Scene ID +constexpr chip::SceneId kScene1 = 0xAA; +constexpr chip::SceneId kScene2 = 0x45; +constexpr chip::SceneId kScene3 = 0x77; +constexpr chip::SceneId kScene4 = 0xEE; + // Test fabrics, adding more requires to modify the "ResetSceneTable" function constexpr chip::FabricIndex kFabric1 = 1; constexpr chip::FabricIndex kFabric2 = 7; +constexpr chip::FabricIndex kFabric3 = 77; // Scene storage ID -static const SceneStorageId sceneId1(kTestEndpoint1, 0xAA, 0x101); -static const SceneStorageId sceneId2(kTestEndpoint1, 0xBB, 0x00); -static const SceneStorageId sceneId3(kTestEndpoint2, 0xCC, 0x102); -static const SceneStorageId sceneId4(kTestEndpoint2, 0xBE, 0x00); -static const SceneStorageId sceneId5(kTestEndpoint1, 0x45, 0x103); -static const SceneStorageId sceneId6(kTestEndpoint1, 0x65, 0x00); -static const SceneStorageId sceneId7(kTestEndpoint1, 0x77, 0x101); -static const SceneStorageId sceneId8(kTestEndpoint3, 0xEE, 0x101); -static const SceneStorageId sceneId9(kTestEndpoint2, 0xAB, 0x101); +static const SceneStorageId sceneId1(kTestEndpoint1, kScene1, kGroup1); +static const SceneStorageId sceneId2(kTestEndpoint1, kScene4, kGroup1); +static const SceneStorageId sceneId3(kTestEndpoint2, kScene2, kGroup1); +static const SceneStorageId sceneId4(kTestEndpoint2, kScene4, kGroup1); +static const SceneStorageId sceneId5(kTestEndpoint1, kScene3, kGroup2); +static const SceneStorageId sceneId6(kTestEndpoint1, kScene4, kGroup2); +static const SceneStorageId sceneId7(kTestEndpoint1, kScene1, kGroup3); +static const SceneStorageId sceneId8(kTestEndpoint3, kScene1, kGroup4); +static const SceneStorageId sceneId9(kTestEndpoint2, kScene1, kGroup4); CharSpan empty; @@ -367,6 +380,14 @@ class TestSceneHandler : public scenes::DefaultSceneHandlerImpl class TestSceneTableImpl : public SceneTableImpl { +public: + TestSceneTableImpl(uint8_t maxScenesPerFabric = scenes::kMaxScenesPerFabric, + uint8_t maxScenesGlobal = scenes::kMaxScenesGlobal) : + SceneTableImpl(maxScenesPerFabric, maxScenesGlobal) + {} + ~TestSceneTableImpl() override {} + +protected: uint8_t GetClustersFromEndpoint(EndpointId endpoint, ClusterId * clusterList, uint8_t listLen) override { if (listLen >= 3) @@ -391,6 +412,7 @@ void ResetSceneTable(SceneTable * sceneTable) { sceneTable->RemoveFabric(kFabric1); sceneTable->RemoveFabric(kFabric2); + sceneTable->RemoveFabric(kFabric3); } void TestHandlerRegistration(nlTestSuite * aSuite, void * aContext) @@ -724,6 +746,8 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) void TestStoreScenes(nlTestSuite * aSuite, void * aContext) { SceneTable * sceneTable = &sSceneTable; + SceneId sceneList[scenes::kMaxScenesPerFabric]; + NL_TEST_ASSERT(aSuite, sceneTable); // Reset test @@ -745,8 +769,22 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SceneSaveEFS(scene8)); SceneTableEntry scene; + Span sceneListSpan = Span(sceneList); + Span emptyListSpan = Span(sceneList, 0); + Span smallListSpan = Span(sceneList, 1); + + // Test Get All scenes in Group in empty scene table + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, emptyListSpan)); + NL_TEST_ASSERT(aSuite, 0 == emptyListSpan.size()); + // Set test NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); + + // Test single scene in table with 0 size span + NL_TEST_ASSERT(aSuite, CHIP_ERROR_BUFFER_TOO_SMALL == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, emptyListSpan)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, smallListSpan)); + NL_TEST_ASSERT(aSuite, 1 == smallListSpan.size()); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene2)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene3)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene4)); @@ -756,10 +794,11 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); // Too many scenes for 1 fabric - NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_LIST_LENGTH == sceneTable->SetSceneTableEntry(kFabric1, scene9)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric1, scene9)); // Not Found NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId9, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_BUFFER_TOO_SMALL == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, emptyListSpan)); // Get test NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -787,6 +826,37 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); NL_TEST_ASSERT(aSuite, scene == scene8); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SceneApplyEFS(scene)); + + // Test error when list too small in a full table + // Test failure for 3 spaces in 4 scenes list + NL_TEST_ASSERT(aSuite, CHIP_ERROR_BUFFER_TOO_SMALL == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, smallListSpan)); + // Test failure for no space in a 4 scenes list + NL_TEST_ASSERT(aSuite, CHIP_ERROR_BUFFER_TOO_SMALL == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, emptyListSpan)); + // Test failure for no space in a 1 scene list + NL_TEST_ASSERT(aSuite, CHIP_ERROR_BUFFER_TOO_SMALL == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup3, emptyListSpan)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup3, smallListSpan)); + NL_TEST_ASSERT(aSuite, 1 == smallListSpan.size()); + + // Test successfully getting Ids from various groups + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup1, sceneListSpan)); + NL_TEST_ASSERT(aSuite, 4 == sceneListSpan.size()); + NL_TEST_ASSERT(aSuite, kScene1 == sceneList[0]); + NL_TEST_ASSERT(aSuite, kScene4 == sceneList[1]); + NL_TEST_ASSERT(aSuite, kScene2 == sceneList[2]); + NL_TEST_ASSERT(aSuite, kScene4 == sceneList[3]); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup2, sceneListSpan)); + NL_TEST_ASSERT(aSuite, 2 == sceneListSpan.size()); + NL_TEST_ASSERT(aSuite, kScene3 == sceneList[0]); + NL_TEST_ASSERT(aSuite, kScene4 == sceneList[1]); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup3, sceneListSpan)); + NL_TEST_ASSERT(aSuite, 1 == sceneListSpan.size()); + NL_TEST_ASSERT(aSuite, kScene1 == sceneList[0]); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup4, sceneListSpan)); + NL_TEST_ASSERT(aSuite, 1 == sceneListSpan.size()); + NL_TEST_ASSERT(aSuite, kScene1 == sceneList[0]); } void TestOverwriteScenes(nlTestSuite * aSuite, void * aContext) @@ -943,6 +1013,31 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) iterator = sceneTable->IterateSceneEntries(kFabric1); NL_TEST_ASSERT(aSuite, iterator->Count() == 0); iterator->Release(); + + // Test Remove all scenes in Group + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene2)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene3)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene4)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); + iterator = sceneTable->IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, iterator->Count() == 6); + iterator->Release(); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->DeleteAllScenesInGroup(kFabric1, kGroup1)); + iterator = sceneTable->IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, iterator->Count() == 2); + NL_TEST_ASSERT(aSuite, iterator->Next(scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); + NL_TEST_ASSERT(aSuite, iterator->Next(scene)); + NL_TEST_ASSERT(aSuite, scene == scene6); + iterator->Release(); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->DeleteAllScenesInGroup(kFabric1, kGroup2)); + iterator = sceneTable->IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, iterator->Count() == 0); + iterator->Release(); } void TestFabricScenes(nlTestSuite * aSuite, void * aContext) @@ -954,29 +1049,93 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) ResetSceneTable(sceneTable); SceneTableEntry scene; + uint8_t fabric_capacity = 0; + + // Verify capacities are at max + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); // Fabric 1 inserts NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene2)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene3)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene4)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // Fabric 2 inserts + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene1)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene2)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene3)); - + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene4)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, (scenes::kMaxScenesPerFabric - 4) == fabric_capacity); + + // Fabric 3 inserts, should only be 4 spaces left at this point since 12 got taken + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene1)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene2)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene3)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene4)); + + // Checks capacity is now 0 accross all fabrics + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + + // To many scenes accross fabrics (Max scenes accross fabrics == 16) + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric3, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric2, scene5)); + + // Verifying all inserted scenes are accessible NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); NL_TEST_ASSERT(aSuite, scene == scene1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId2, scene)); NL_TEST_ASSERT(aSuite, scene == scene2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId3, scene)); NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId6, scene)); + NL_TEST_ASSERT(aSuite, scene == scene6); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); + NL_TEST_ASSERT(aSuite, scene == scene7); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); + NL_TEST_ASSERT(aSuite, scene == scene8); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); NL_TEST_ASSERT(aSuite, scene == scene1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId2, scene)); NL_TEST_ASSERT(aSuite, scene == scene2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId3, scene)); NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, scene == scene1); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); + NL_TEST_ASSERT(aSuite, scene == scene2); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); // Remove Fabric 1 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric1)); @@ -985,6 +1144,11 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId2, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId6, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); // Verify Fabric 2 still there NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); @@ -993,6 +1157,46 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId3, scene)); NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); + + // Verify capacity updated for all fabrics + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + + // Verify we can now write more scenes in scene fabric 2 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId6, scene)); + NL_TEST_ASSERT(aSuite, scene == scene6); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId7, scene)); + NL_TEST_ASSERT(aSuite, scene == scene7); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); + NL_TEST_ASSERT(aSuite, scene == scene8); + + // Verify capacity updated properly + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + + // Verify Fabric 3 still there + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, scene == scene1); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); + NL_TEST_ASSERT(aSuite, scene == scene2); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); // Remove Fabric 2 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric2)); @@ -1001,6 +1205,172 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId2, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId6, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId7, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); + + // Verify Fabric 3 still there + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, scene == scene1); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); + NL_TEST_ASSERT(aSuite, scene == scene2); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, scene == scene3); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, scene == scene4); + + // Remove Fabric 3 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric3)); + // Verify Fabric 3 removed + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->RemoveFabric(kFabric3)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId3, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); + + // Verify capacity updated for all fabrics + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); +} + +void TestOTAChanges(nlTestSuite * aSuite, void * aContext) +{ + SceneTable * sceneTable = &sSceneTable; + NL_TEST_ASSERT(aSuite, sceneTable); + + // Reset test + ResetSceneTable(sceneTable); + + SceneTableEntry scene; + uint8_t fabric_capacity = 0; + + // Fill scene table + // Fill fabric 1 to capacity + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene2)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene3)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene4)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + auto * iterator = sceneTable->IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == iterator->Count()); + iterator->Release(); + + // Fill fabric 2 to capacity + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene1)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene2)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene3)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene4)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + iterator = sceneTable->IterateSceneEntries(kFabric2); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == iterator->Count()); + iterator->Release(); + // SceneTable should be full at this point + uint8_t scene_count; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetGlobalSceneCount(scene_count)); + // Global count should not have been modified + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesGlobal == scene_count); + + // Test failure to init a SceneTable with sizes above the defined max scenes per fabric or globaly + TestSceneTableImpl SceneTableTooManyPerFabric(scenes::kMaxScenesPerFabric + 1, scenes::kMaxScenesGlobal); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_INTEGER_VALUE == SceneTableTooManyPerFabric.Init(&testStorage)); + SceneTableTooManyPerFabric.Finish(); + + TestSceneTableImpl SceneTableTooManyGlobal(scenes::kMaxScenesPerFabric, scenes::kMaxScenesGlobal + 1); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_INTEGER_VALUE == SceneTableTooManyGlobal.Init(&testStorage)); + SceneTableTooManyGlobal.Finish(); + + // Create a new table with a different limit of scenes per fabric + TestSceneTableImpl ReducedSceneTable(scenes::kMaxScenesPerFabric - 1, scenes::kMaxScenesGlobal - 2); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.Init(&testStorage)); + // Global count should not have been modified + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetGlobalSceneCount(scene_count)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesGlobal == scene_count); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + + // Load a scene from fabric 1, this should adjust fabric 1 scene count in flash + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetSceneTableEntry(kFabric1, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, scene == scene1); + + // The number count of scenes in Fabric 1 should have been adjusted here + iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == iterator->Count()); + iterator->Release(); + // Capacity should still be 0 + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetGlobalSceneCount(scene_count)); + // Global count should have been reduced by 1 + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesGlobal - 1 == scene_count); + + // Remove a Scene from the Fabric 1 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene.mStorageId)); + // Check count updated for fabric + iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 2 == iterator->Count()); + iterator->Release(); + // Check fabric still doesn't have capacity because fabric 2 still have a higher number of scene than allowed + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + // Remove another scene from fabric 1 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene2.mStorageId)); + // Check count updated for fabric + iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 3 == iterator->Count()); + iterator->Release(); + + // Global count should now have been adjusted + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetGlobalSceneCount(scene_count)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesGlobal - 3 == scene_count); + // Confirm we now have capacity + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 1 == fabric_capacity); + + // Load a scene from fabric 2, this should adjust fabric 1 scene count in flash + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetSceneTableEntry(kFabric2, sceneId1, scene)); + NL_TEST_ASSERT(aSuite, scene == scene1); + + // The number count of scenes in Fabric 1 should have been adjusted here + iterator = ReducedSceneTable.IterateSceneEntries(kFabric2); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == iterator->Count()); + iterator->Release(); + // Global count should now have been adjusted + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetGlobalSceneCount(scene_count)); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesGlobal - 4 == scene_count); + // Confirm we now have capacity in the first fabric since we previously removed 2 scenes form there + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 2 == fabric_capacity); + // Fabric 2 should still be at capacity + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + + ReducedSceneTable.Finish(); + + // The Scene 8 should now have been deleted from the memory and thus not be accessible from both fabrics in the original scene + // table + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); + // The Remaining capacity in the original scene table therefore have been modified as well + // Fabric 2 should still be at capacity + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 3 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 1 == fabric_capacity); } } // namespace TestScenes @@ -1040,6 +1410,7 @@ int TestSceneTable() NL_TEST_DEF("TestIterateScenes", TestScenes::TestIterateScenes), NL_TEST_DEF("TestRemoveScenes", TestScenes::TestRemoveScenes), NL_TEST_DEF("TestFabricScenes", TestScenes::TestFabricScenes), + NL_TEST_DEF("TestOTAChanges", TestScenes::TestOTAChanges), NL_TEST_SENTINEL() }; diff --git a/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml b/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml new file mode 100644 index 00000000000000..9890afb851586c --- /dev/null +++ b/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml @@ -0,0 +1,156 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Test + +config: + nodeId: 0x12344321 + endpoint: 0 + +tests: + - label: "Wait for the alpha device to be retrieved " + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the fabrics list from alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + response: + value: [{ Label: "", NodeID: nodeId }] + constraints: + type: list + + - label: + "Send ArmFailSafe command to target device with ExpiryLengthSeconds 60 + seconds" + cluster: "General Commissioning" + command: "ArmFailSafe" + arguments: + values: + - name: "ExpiryLengthSeconds" + value: 60 + - name: "Breadcrumb" + value: 0 + + - label: "Send CSRRequest command from alpha" + command: "CSRRequest" + cluster: "Operational Credentials" + arguments: + values: + - name: CSRNonce + value: "\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07" + response: + values: + - name: "NOCSRElements" + saveAs: NOCSRElements + - name: "AttestationSignature" + saveAs: attestationSignature + + - label: "Read the commissioner node ID from the beta fabric" + identity: "beta" + cluster: "CommissionerCommands" + command: "GetCommissionerNodeId" + response: + values: + - name: "nodeId" + saveAs: commissionerNodeIdBeta + + - label: "Read the commissioner root certificate from the beta fabric" + identity: "beta" + cluster: "CommissionerCommands" + command: "GetCommissionerRootCertificate" + response: + values: + - name: "RCAC" + saveAs: commissionerRCACBeta + + - label: + "Create a NOC chain for commissioner beta with the results of the + CSRRequest from alpha" + identity: "beta" + cluster: "CommissionerCommands" + command: "IssueNocChain" + arguments: + values: + - name: "Elements" + value: NOCSRElements + - name: "nodeId" + value: 0x43211234 + response: + values: + - name: "NOC" + saveAs: noc + - name: "ICAC" + saveAs: icac + - name: "IPK" + saveAs: ipk + + - label: "Send AddTrustedRootCertificate command from alpha" + command: "AddTrustedRootCertificate" + cluster: "Operational Credentials" + arguments: + values: + - name: "RootCACertificate" + value: commissionerRCACBeta + + - label: "Send AddNOC command from alpha" + command: "AddNOC" + cluster: "Operational Credentials" + arguments: + values: + - name: "NOCValue" + value: noc + - name: "ICACValue" + value: icac + - name: "IPKValue" + value: ipk + - name: "CaseAdminSubject" + value: commissionerNodeIdBeta + - name: "AdminVendorId" + value: 0xFFF1 + response: + values: + - name: "StatusCode" + value: 0 + + - label: "Send Commissioning Complete command from beta" + nodeId: 0x43211234 + identity: "beta" + cluster: "General Commissioning" + command: "CommissioningComplete" + + - label: "Read the fabrics list again from alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + response: + value: [{ Label: "", NodeID: nodeId }] + constraints: + type: list + + - label: "Read the fabrics list from beta this time" + identity: "beta" + nodeId: 0x43211234 + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + response: + value: [{ Label: "", NodeID: 0x43211234 }] + constraints: + type: list diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index 7cb1d55149d14f..9802426b29f942 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -1,10 +1,12 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -{{#chip_shared_structs}} +{{#zcl_structs}} +{{#if has_more_than_one_cluster}} {{>idl_structure_definition extraIndent=0}} -{{/chip_shared_structs}} +{{/if}} +{{/zcl_structs}} {{#all_user_clusters~}} /** {{description}} */ {{side}} cluster {{asUpperCamelCase name}} = {{code}} { @@ -24,17 +26,10 @@ } {{/zcl_bitmaps}} - {{#if (is_client side)~}} - {{#zcl_structs}} - {{~>idl_structure_definition extraIndent=1}} + {{#zcl_structs}} + {{~>idl_structure_definition extraIndent=1}} - {{/zcl_structs}} - {{~else~}} - {{#chip_cluster_specific_structs}} - {{~>idl_structure_definition extraIndent=1}} - - {{/chip_cluster_specific_structs}} - {{/if}} + {{/zcl_structs}} {{#zcl_events}} {{#if isFabricSensitive}}fabric_sensitive {{/if~}} {{priority}} event {{!ensure space}} {{~#chip_access_elements entity="event"~}} diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a728b838846eca..a77f66684da4c4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1,16 +1,16 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - struct ApplicationStruct { int16u catalogVendorID = 0; char_string applicationID = 1; } +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index a6fa4ab3cd2e3c..d1c51b5edeee33 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -60,7 +60,7 @@ if ({{source}}.IsNull()) { env->SetByteArrayRegion({{target}}ByteArray, 0, static_cast({{source}}.size()), reinterpret_cast({{source}}.data())); {{target}} = {{target}}ByteArray; {{else if (isCharString type)}} - {{target}} = env->NewStringUTF(std::string({{source}}.data(), {{source}}.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF({{source}}, {{target}})); {{else}} std::string {{target}}ClassName = "{{asJniClassName type null cluster}}"; std::string {{target}}CtorSignature = "({{asJniSignature type null cluster false}})V"; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index f435fdbdf3cc66..4e02a196cc0db1 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1372,7 +1372,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::Description::Id: { @@ -1384,7 +1384,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::InactiveText::Id: { @@ -1396,7 +1396,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::OutOfService::Id: { @@ -2540,7 +2540,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_actionIDCtorSignature.c_str(), entry_0.actionID, newElement_0_actionID); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_type; std::string newElement_0_typeClassName = "java/lang/Integer"; std::string newElement_0_typeCtorSignature = "(I)V"; @@ -2614,7 +2614,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_endpointListIDCtorSignature.c_str(), entry_0.endpointListID, newElement_0_endpointListID); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_type; std::string newElement_0_typeClassName = "java/lang/Integer"; std::string newElement_0_typeCtorSignature = "(I)V"; @@ -2669,7 +2669,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::GeneratedCommandList::Id: { @@ -2832,7 +2832,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::VendorID::Id: { @@ -2859,7 +2859,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductID::Id: { @@ -2886,7 +2886,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::Location::Id: { @@ -2898,7 +2898,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::HardwareVersion::Id: { @@ -2925,7 +2925,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::SoftwareVersion::Id: { @@ -2952,7 +2952,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ManufacturingDate::Id: { @@ -2964,7 +2964,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::PartNumber::Id: { @@ -2976,7 +2976,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductURL::Id: { @@ -2988,7 +2988,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductLabel::Id: { @@ -3000,7 +3000,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::SerialNumber::Id: { @@ -3012,7 +3012,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::LocalConfigDisabled::Id: { @@ -3054,7 +3054,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::CapabilityMinima::Id: { @@ -3627,7 +3627,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::SupportedLocales::Id: { @@ -3646,7 +3646,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - newElement_0 = env->NewStringUTF(std::string(entry_0.data(), entry_0.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0, newElement_0)); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -4327,7 +4327,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::WiredAssessedInputVoltage::Id: { @@ -4639,7 +4639,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::BatCommonDesignation::Id: { @@ -4666,7 +4666,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::BatIECDesignation::Id: { @@ -4678,7 +4678,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::BatApprovedChemistry::Id: { @@ -5664,7 +5664,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_isOperational; std::string newElement_0_isOperationalClassName = "java/lang/Boolean"; std::string newElement_0_isOperationalCtorSignature = "(Z)V"; @@ -6080,8 +6080,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_nameInsideOptional; - newElement_0_nameInsideOptional = - env->NewStringUTF(std::string(entry_0.name.Value().data(), entry_0.name.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } jobject newElement_0_stackFreeCurrent; @@ -6400,7 +6400,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - value = env->NewStringUTF(std::string(cppValue.Value().data(), cppValue.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); } return value; } @@ -8606,7 +8606,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::VendorID::Id: { @@ -8633,7 +8633,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::NodeLabel::Id: { @@ -8645,7 +8645,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::HardwareVersion::Id: { @@ -8672,7 +8672,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::SoftwareVersion::Id: { @@ -8699,7 +8699,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ManufacturingDate::Id: { @@ -8711,7 +8711,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::PartNumber::Id: { @@ -8723,7 +8723,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductURL::Id: { @@ -8735,7 +8735,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductLabel::Id: { @@ -8747,7 +8747,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::SerialNumber::Id: { @@ -8759,7 +8759,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::Reachable::Id: { @@ -8786,7 +8786,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::GeneratedCommandList::Id: { @@ -9403,7 +9403,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -9743,8 +9743,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_groupNameInsideOptional; - newElement_0_groupNameInsideOptional = - env->NewStringUTF(std::string(entry_0.groupName.Value().data(), entry_0.groupName.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); } jobject newElement_0_fabricIndex; @@ -9961,9 +9961,9 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_value; - newElement_0_value = env->NewStringUTF(std::string(entry_0.value.data(), entry_0.value.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -10140,9 +10140,9 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_value; - newElement_0_value = env->NewStringUTF(std::string(entry_0.value.data(), entry_0.value.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -10462,7 +10462,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::StandardNamespace::Id: { @@ -10504,7 +10504,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_mode; std::string newElement_0_modeClassName = "java/lang/Integer"; std::string newElement_0_modeCtorSignature = "(I)V"; @@ -11078,7 +11078,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::LEDSettings::Id: { @@ -14415,7 +14415,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ColorTemperatureMireds::Id: { @@ -15449,7 +15449,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::LampManufacturer::Id: { @@ -15461,7 +15461,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::LampRatedHours::Id: { @@ -17209,7 +17209,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::GeneratedCommandList::Id: { @@ -17384,8 +17384,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_nameInsideOptional; - newElement_0_nameInsideOptional = - env->NewStringUTF(std::string(entry_0.name.Value().data(), entry_0.name.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } jobject newElement_0_callSign; @@ -17396,8 +17396,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_callSignInsideOptional; - newElement_0_callSignInsideOptional = - env->NewStringUTF(std::string(entry_0.callSign.Value().data(), entry_0.callSign.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.callSign.Value(), + newElement_0_callSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_callSignInsideOptional, newElement_0_callSign); } jobject newElement_0_affiliateCallSign; @@ -17408,8 +17408,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_affiliateCallSignInsideOptional; - newElement_0_affiliateCallSignInsideOptional = env->NewStringUTF( - std::string(entry_0.affiliateCallSign.Value().data(), entry_0.affiliateCallSign.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.affiliateCallSign.Value(), newElement_0_affiliateCallSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_affiliateCallSignInsideOptional, newElement_0_affiliateCallSign); } @@ -17454,8 +17454,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_operatorName; - value_operatorName = env->NewStringUTF( - std::string(cppValue.Value().operatorName.data(), cppValue.Value().operatorName.size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().operatorName, value_operatorName)); jobject value_lineupName; if (!cppValue.Value().lineupName.HasValue()) { @@ -17464,9 +17464,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_lineupNameInsideOptional; - value_lineupNameInsideOptional = env->NewStringUTF( - std::string(cppValue.Value().lineupName.Value().data(), cppValue.Value().lineupName.Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().lineupName.Value(), + value_lineupNameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_lineupNameInsideOptional, value_lineupName); } jobject value_postalCode; @@ -17477,9 +17476,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_postalCodeInsideOptional; - value_postalCodeInsideOptional = env->NewStringUTF( - std::string(cppValue.Value().postalCode.Value().data(), cppValue.Value().postalCode.Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().postalCode.Value(), + value_postalCodeInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_postalCodeInsideOptional, value_postalCode); } jobject value_lineupInfoType; @@ -17546,8 +17544,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_nameInsideOptional; - value_nameInsideOptional = env->NewStringUTF( - std::string(cppValue.Value().name.Value().data(), cppValue.Value().name.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().name.Value(), + value_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_nameInsideOptional, value_name); } jobject value_callSign; @@ -17558,8 +17556,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_callSignInsideOptional; - value_callSignInsideOptional = env->NewStringUTF( - std::string(cppValue.Value().callSign.Value().data(), cppValue.Value().callSign.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().callSign.Value(), + value_callSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_callSignInsideOptional, value_callSign); } jobject value_affiliateCallSign; @@ -17570,10 +17568,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_affiliateCallSignInsideOptional; - value_affiliateCallSignInsideOptional = - env->NewStringUTF(std::string(cppValue.Value().affiliateCallSign.Value().data(), - cppValue.Value().affiliateCallSign.Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().affiliateCallSign.Value(), + value_affiliateCallSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_affiliateCallSignInsideOptional, value_affiliateCallSign); } @@ -17759,7 +17755,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_identifierCtorSignature.c_str(), entry_0.identifier, newElement_0_identifier); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jclass targetInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -18274,10 +18270,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_inputTypeClassName.c_str(), newElement_0_inputTypeCtorSignature.c_str(), static_cast(entry_0.inputType), newElement_0_inputType); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_description; - newElement_0_description = - env->NewStringUTF(std::string(entry_0.description.data(), entry_0.description.size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.description, newElement_0_description)); jclass inputInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -18741,7 +18737,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - newElement_0 = env->NewStringUTF(std::string(entry_0.data(), entry_0.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0, newElement_0)); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -18926,7 +18922,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_outputTypeClassName.c_str(), newElement_0_outputTypeCtorSignature.c_str(), static_cast(entry_0.outputType), newElement_0_outputType); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jclass outputInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -19148,9 +19144,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_application_catalogVendorIDClassName.c_str(), value_application_catalogVendorIDCtorSignature.c_str(), cppValue.Value().application.catalogVendorID, value_application_catalogVendorID); jobject value_application_applicationID; - value_application_applicationID = env->NewStringUTF(std::string(cppValue.Value().application.applicationID.data(), - cppValue.Value().application.applicationID.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().application.applicationID, + value_application_applicationID)); jclass applicationStructStructClass_2; err = chip::JniReferences::GetInstance().GetClassRef( @@ -19355,7 +19350,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::VendorID::Id: { @@ -19382,7 +19377,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::ProductID::Id: { @@ -19416,8 +19411,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_catalogVendorIDCtorSignature.c_str(), cppValue.catalogVendorID, value_catalogVendorID); jobject value_applicationID; - value_applicationID = - env->NewStringUTF(std::string(cppValue.applicationID.data(), cppValue.applicationID.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.applicationID, value_applicationID)); jclass applicationStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( @@ -19463,7 +19457,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::AllowedVendorList::Id: { @@ -22569,7 +22563,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::LongCharString::Id: { @@ -22581,7 +22575,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } case Attributes::EpochUs::Id: { @@ -22706,8 +22700,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - newElement_0_nullableString = env->NewStringUTF( - std::string(entry_0.nullableString.Value().data(), entry_0.nullableString.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.nullableString.Value(), + newElement_0_nullableString)); } jobject newElement_0_optionalString; if (!entry_0.optionalString.HasValue()) @@ -22717,8 +22711,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject newElement_0_optionalStringInsideOptional; - newElement_0_optionalStringInsideOptional = env->NewStringUTF( - std::string(entry_0.optionalString.Value().data(), entry_0.optionalString.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.optionalString.Value(), newElement_0_optionalStringInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStringInsideOptional, newElement_0_optionalString); } @@ -22736,10 +22730,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - newElement_0_nullableOptionalStringInsideOptional = - env->NewStringUTF(std::string(entry_0.nullableOptionalString.Value().Value().data(), - entry_0.nullableOptionalString.Value().Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.nullableOptionalString.Value().Value(), newElement_0_nullableOptionalStringInsideOptional)); } chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStringInsideOptional, newElement_0_nullableOptionalString); @@ -22777,8 +22769,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(entry_0.nullableStruct.Value().d.data())); newElement_0_nullableStruct_d = newElement_0_nullableStruct_dByteArray; jobject newElement_0_nullableStruct_e; - newElement_0_nullableStruct_e = env->NewStringUTF( - std::string(entry_0.nullableStruct.Value().e.data(), entry_0.nullableStruct.Value().e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.nullableStruct.Value().e, + newElement_0_nullableStruct_e)); jobject newElement_0_nullableStruct_f; std::string newElement_0_nullableStruct_fClassName = "java/lang/Integer"; std::string newElement_0_nullableStruct_fCtorSignature = "(I)V"; @@ -22859,8 +22851,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(entry_0.optionalStruct.Value().d.data())); newElement_0_optionalStructInsideOptional_d = newElement_0_optionalStructInsideOptional_dByteArray; jobject newElement_0_optionalStructInsideOptional_e; - newElement_0_optionalStructInsideOptional_e = env->NewStringUTF( - std::string(entry_0.optionalStruct.Value().e.data(), entry_0.optionalStruct.Value().e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.optionalStruct.Value().e, newElement_0_optionalStructInsideOptional_e)); jobject newElement_0_optionalStructInsideOptional_f; std::string newElement_0_optionalStructInsideOptional_fClassName = "java/lang/Integer"; std::string newElement_0_optionalStructInsideOptional_fCtorSignature = "(I)V"; @@ -22956,10 +22948,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalStructInsideOptional_d = newElement_0_nullableOptionalStructInsideOptional_dByteArray; jobject newElement_0_nullableOptionalStructInsideOptional_e; - newElement_0_nullableOptionalStructInsideOptional_e = - env->NewStringUTF(std::string(entry_0.nullableOptionalStruct.Value().Value().e.data(), - entry_0.nullableOptionalStruct.Value().Value().e.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.nullableOptionalStruct.Value().Value().e, newElement_0_nullableOptionalStructInsideOptional_e)); jobject newElement_0_nullableOptionalStructInsideOptional_f; std::string newElement_0_nullableOptionalStructInsideOptional_fClassName = "java/lang/Integer"; std::string newElement_0_nullableOptionalStructInsideOptional_fCtorSignature = "(I)V"; @@ -23172,7 +23162,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(cppValue.d.data())); value_d = value_dByteArray; jobject value_e; - value_e = env->NewStringUTF(std::string(cppValue.e.data(), cppValue.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.e, value_e)); jobject value_f; std::string value_fClassName = "java/lang/Integer"; std::string value_fCtorSignature = "(I)V"; @@ -23375,8 +23365,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalFabricSensitiveInt8u); } jobject newElement_0_fabricSensitiveCharString; - newElement_0_fabricSensitiveCharString = env->NewStringUTF( - std::string(entry_0.fabricSensitiveCharString.data(), entry_0.fabricSensitiveCharString.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.fabricSensitiveCharString, + newElement_0_fabricSensitiveCharString)); jobject newElement_0_fabricSensitiveStruct; jobject newElement_0_fabricSensitiveStruct_a; std::string newElement_0_fabricSensitiveStruct_aClassName = "java/lang/Integer"; @@ -23407,8 +23397,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(entry_0.fabricSensitiveStruct.d.data())); newElement_0_fabricSensitiveStruct_d = newElement_0_fabricSensitiveStruct_dByteArray; jobject newElement_0_fabricSensitiveStruct_e; - newElement_0_fabricSensitiveStruct_e = env->NewStringUTF( - std::string(entry_0.fabricSensitiveStruct.e.data(), entry_0.fabricSensitiveStruct.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.fabricSensitiveStruct.e, + newElement_0_fabricSensitiveStruct_e)); jobject newElement_0_fabricSensitiveStruct_f; std::string newElement_0_fabricSensitiveStruct_fClassName = "java/lang/Integer"; std::string newElement_0_fabricSensitiveStruct_fCtorSignature = "(I)V"; @@ -24150,7 +24140,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - value = env->NewStringUTF(std::string(cppValue.Value().data(), cppValue.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); } return value; } @@ -24212,7 +24202,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(cppValue.Value().d.data())); value_d = value_dByteArray; jobject value_e; - value_e = env->NewStringUTF(std::string(cppValue.Value().e.data(), cppValue.Value().e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().e, value_e)); jobject value_f; std::string value_fClassName = "java/lang/Integer"; std::string value_fCtorSignature = "(I)V"; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index ab27364d930ee3..066d36bdd1f4d2 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -1420,8 +1420,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & else { jobject value_nameInsideOptional; - value_nameInsideOptional = - env->NewStringUTF(std::string(cppValue.name.Value().data(), cppValue.name.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.name.Value(), value_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(value_nameInsideOptional, value_name); } @@ -3498,7 +3498,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & reinterpret_cast(cppValue.arg4.d.data())); value_arg4_d = value_arg4_dByteArray; jobject value_arg4_e; - value_arg4_e = env->NewStringUTF(std::string(cppValue.arg4.e.data(), cppValue.arg4.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.arg4.e, value_arg4_e)); jobject value_arg4_f; std::string value_arg4_fClassName = "java/lang/Integer"; std::string value_arg4_fCtorSignature = "(I)V"; @@ -3566,7 +3566,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & reinterpret_cast(entry_0.d.data())); newElement_0_d = newElement_0_dByteArray; jobject newElement_0_e; - newElement_0_e = env->NewStringUTF(std::string(entry_0.e.data(), entry_0.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.e, newElement_0_e)); jobject newElement_0_f; std::string newElement_0_fClassName = "java/lang/Integer"; std::string newElement_0_fCtorSignature = "(I)V"; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index f2527732efb160..2fb5e13227f298 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -157,7 +157,7 @@ void CHIPGroupsClusterViewGroupResponseCallback::CallbackFn( chip::JniReferences::GetInstance().CreateBoxedObject(GroupIDClassName.c_str(), GroupIDCtorSignature.c_str(), dataResponse.groupID, GroupID); jobject GroupName; - GroupName = env->NewStringUTF(std::string(dataResponse.groupName.data(), dataResponse.groupName.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.groupName, GroupName)); env->CallVoidMethod(javaCallbackRef, javaMethod, Status, GroupID, GroupName); } @@ -470,8 +470,8 @@ void CHIPScenesClusterViewSceneResponseCallback::CallbackFn( else { jobject SceneNameInsideOptional; - SceneNameInsideOptional = - env->NewStringUTF(std::string(dataResponse.sceneName.Value().data(), dataResponse.sceneName.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.sceneName.Value(), SceneNameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(SceneNameInsideOptional, SceneName); } jobject ExtensionFieldSets; @@ -1052,8 +1052,8 @@ void CHIPScenesClusterEnhancedViewSceneResponseCallback::CallbackFn( else { jobject SceneNameInsideOptional; - SceneNameInsideOptional = - env->NewStringUTF(std::string(dataResponse.sceneName.Value().data(), dataResponse.sceneName.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.sceneName.Value(), SceneNameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(SceneNameInsideOptional, SceneName); } jobject ExtensionFieldSets; @@ -1321,8 +1321,8 @@ void CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::CallbackFn( else { jobject ImageURIInsideOptional; - ImageURIInsideOptional = - env->NewStringUTF(std::string(dataResponse.imageURI.Value().data(), dataResponse.imageURI.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.imageURI.Value(), ImageURIInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(ImageURIInsideOptional, ImageURI); } jobject SoftwareVersion; @@ -1348,9 +1348,8 @@ void CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::CallbackFn( else { jobject SoftwareVersionStringInsideOptional; - SoftwareVersionStringInsideOptional = env->NewStringUTF( - std::string(dataResponse.softwareVersionString.Value().data(), dataResponse.softwareVersionString.Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.softwareVersionString.Value(), + SoftwareVersionStringInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(SoftwareVersionStringInsideOptional, SoftwareVersionString); } jobject UpdateToken; @@ -1532,7 +1531,7 @@ void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), static_cast(dataResponse.errorCode), ErrorCode); jobject DebugText; - DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText, DebugText)); env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } @@ -1598,7 +1597,7 @@ void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::Callbac chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), static_cast(dataResponse.errorCode), ErrorCode); jobject DebugText; - DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText, DebugText)); env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } @@ -1664,7 +1663,7 @@ void CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::Callb chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), static_cast(dataResponse.errorCode), ErrorCode); jobject DebugText; - DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText, DebugText)); env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } @@ -1737,8 +1736,8 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( else { jobject DebugTextInsideOptional; - DebugTextInsideOptional = - env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText.Value(), DebugTextInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); } jobject WiFiScanResults; @@ -1842,8 +1841,7 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( newElement_1_extendedPanIdCtorSignature.c_str(), entry_1.extendedPanId, newElement_1_extendedPanId); jobject newElement_1_networkName; - newElement_1_networkName = - env->NewStringUTF(std::string(entry_1.networkName.data(), entry_1.networkName.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.networkName, newElement_1_networkName)); jobject newElement_1_channel; std::string newElement_1_channelClassName = "java/lang/Integer"; std::string newElement_1_channelCtorSignature = "(I)V"; @@ -1971,8 +1969,8 @@ void CHIPNetworkCommissioningClusterNetworkConfigResponseCallback::CallbackFn( else { jobject DebugTextInsideOptional; - DebugTextInsideOptional = - env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText.Value(), DebugTextInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); } jobject NetworkIndex; @@ -2061,8 +2059,8 @@ void CHIPNetworkCommissioningClusterConnectNetworkResponseCallback::CallbackFn( else { jobject DebugTextInsideOptional; - DebugTextInsideOptional = - env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText.Value(), DebugTextInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); } jobject ErrorValue; @@ -2451,8 +2449,8 @@ void CHIPOperationalCredentialsClusterNOCResponseCallback::CallbackFn( else { jobject DebugTextInsideOptional; - DebugTextInsideOptional = - env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.debugText.Value(), DebugTextInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); } @@ -3135,8 +3133,7 @@ void CHIPDoorLockClusterGetUserResponseCallback::CallbackFn( } else { - UserName = - env->NewStringUTF(std::string(dataResponse.userName.Value().data(), dataResponse.userName.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.userName.Value(), UserName)); } jobject UserUniqueID; if (dataResponse.userUniqueID.IsNull()) @@ -3683,8 +3680,7 @@ void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( else { jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.data.Value(), DataInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } @@ -3757,8 +3753,7 @@ void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( else { jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.data.Value(), DataInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } @@ -3829,8 +3824,7 @@ void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( else { jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.data.Value(), DataInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } @@ -3961,8 +3955,7 @@ void CHIPContentLauncherClusterLauncherResponseCallback::CallbackFn( else { jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.data.Value(), DataInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } @@ -4097,7 +4090,7 @@ void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject SetupPIN; - SetupPIN = env->NewStringUTF(std::string(dataResponse.setupPIN.data(), dataResponse.setupPIN.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.setupPIN, SetupPIN)); env->CallVoidMethod(javaCallbackRef, javaMethod, SetupPIN); } @@ -4574,7 +4567,7 @@ void CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::CallbackFn( reinterpret_cast(entry_0.c.d.data())); newElement_0_c_d = newElement_0_c_dByteArray; jobject newElement_0_c_e; - newElement_0_c_e = env->NewStringUTF(std::string(entry_0.c.e.data(), entry_0.c.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.c.e, newElement_0_c_e)); jobject newElement_0_c_f; std::string newElement_0_c_fClassName = "java/lang/Integer"; std::string newElement_0_c_fCtorSignature = "(I)V"; @@ -4642,7 +4635,7 @@ void CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::CallbackFn( reinterpret_cast(entry_2.d.data())); newElement_2_d = newElement_2_dByteArray; jobject newElement_2_e; - newElement_2_e = env->NewStringUTF(std::string(entry_2.e.data(), entry_2.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.e, newElement_2_e)); jobject newElement_2_f; std::string newElement_2_fClassName = "java/lang/Integer"; std::string newElement_2_fCtorSignature = "(I)V"; @@ -4776,7 +4769,7 @@ void CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::CallbackFn( reinterpret_cast(entry_0.d.data())); newElement_0_d = newElement_0_dByteArray; jobject newElement_0_e; - newElement_0_e = env->NewStringUTF(std::string(entry_0.e.data(), entry_0.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.e, newElement_0_e)); jobject newElement_0_f; std::string newElement_0_fClassName = "java/lang/Integer"; std::string newElement_0_fCtorSignature = "(I)V"; @@ -5262,8 +5255,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback else { jobject NullableStringValueInsideOptional; - NullableStringValueInsideOptional = env->NewStringUTF( - std::string(dataResponse.nullableStringValue.Value().data(), dataResponse.nullableStringValue.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.nullableStringValue.Value(), + NullableStringValueInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(NullableStringValueInsideOptional, NullableStringValue); } jobject OptionalStringWasPresent; @@ -5280,8 +5273,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback else { jobject OptionalStringValueInsideOptional; - OptionalStringValueInsideOptional = env->NewStringUTF( - std::string(dataResponse.optionalStringValue.Value().data(), dataResponse.optionalStringValue.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.optionalStringValue.Value(), + OptionalStringValueInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(OptionalStringValueInsideOptional, OptionalStringValue); } jobject NullableOptionalStringWasPresent; @@ -5315,10 +5308,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback else { jobject NullableOptionalStringValueInsideOptional; - NullableOptionalStringValueInsideOptional = - env->NewStringUTF(std::string(dataResponse.nullableOptionalStringValue.Value().data(), - dataResponse.nullableOptionalStringValue.Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.nullableOptionalStringValue.Value(), + NullableOptionalStringValueInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(NullableOptionalStringValueInsideOptional, NullableOptionalStringValue); } jobject NullableStructWasNull; @@ -5361,9 +5352,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback reinterpret_cast(dataResponse.nullableStructValue.Value().d.data())); NullableStructValueInsideOptional_d = NullableStructValueInsideOptional_dByteArray; jobject NullableStructValueInsideOptional_e; - NullableStructValueInsideOptional_e = env->NewStringUTF( - std::string(dataResponse.nullableStructValue.Value().e.data(), dataResponse.nullableStructValue.Value().e.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.nullableStructValue.Value().e, + NullableStructValueInsideOptional_e)); jobject NullableStructValueInsideOptional_f; std::string NullableStructValueInsideOptional_fClassName = "java/lang/Integer"; std::string NullableStructValueInsideOptional_fCtorSignature = "(I)V"; @@ -5448,9 +5438,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback reinterpret_cast(dataResponse.optionalStructValue.Value().d.data())); OptionalStructValueInsideOptional_d = OptionalStructValueInsideOptional_dByteArray; jobject OptionalStructValueInsideOptional_e; - OptionalStructValueInsideOptional_e = env->NewStringUTF( - std::string(dataResponse.optionalStructValue.Value().e.data(), dataResponse.optionalStructValue.Value().e.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.optionalStructValue.Value().e, + OptionalStructValueInsideOptional_e)); jobject OptionalStructValueInsideOptional_f; std::string OptionalStructValueInsideOptional_fClassName = "java/lang/Integer"; std::string OptionalStructValueInsideOptional_fCtorSignature = "(I)V"; @@ -5555,10 +5544,8 @@ void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::Callback reinterpret_cast(dataResponse.nullableOptionalStructValue.Value().d.data())); NullableOptionalStructValueInsideOptional_d = NullableOptionalStructValueInsideOptional_dByteArray; jobject NullableOptionalStructValueInsideOptional_e; - NullableOptionalStructValueInsideOptional_e = - env->NewStringUTF(std::string(dataResponse.nullableOptionalStructValue.Value().e.data(), - dataResponse.nullableOptionalStructValue.Value().e.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.nullableOptionalStructValue.Value().e, + NullableOptionalStructValueInsideOptional_e)); jobject NullableOptionalStructValueInsideOptional_f; std::string NullableOptionalStructValueInsideOptional_fClassName = "java/lang/Integer"; std::string NullableOptionalStructValueInsideOptional_fCtorSignature = "(I)V"; @@ -5854,7 +5841,7 @@ void CHIPUnitTestingClusterSimpleStructResponseCallback::CallbackFn( reinterpret_cast(dataResponse.arg1.d.data())); arg1_d = arg1_dByteArray; jobject arg1_e; - arg1_e = env->NewStringUTF(std::string(dataResponse.arg1.e.data(), dataResponse.arg1.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.arg1.e, arg1_e)); jobject arg1_f; std::string arg1_fClassName = "java/lang/Integer"; std::string arg1_fCtorSignature = "(I)V"; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 0367add107cdf2..caf86b14ed9214 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -4836,7 +4836,7 @@ void CHIPActionsActionListAttributeCallback::CallbackFn( newElement_0_actionIDCtorSignature.c_str(), entry_0.actionID, newElement_0_actionID); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_type; std::string newElement_0_typeClassName = "java/lang/Integer"; std::string newElement_0_typeCtorSignature = "(I)V"; @@ -4955,7 +4955,7 @@ void CHIPActionsEndpointListsAttributeCallback::CallbackFn( newElement_0_endpointListIDCtorSignature.c_str(), entry_0.endpointListID, newElement_0_endpointListID); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_type; std::string newElement_0_typeClassName = "java/lang/Integer"; std::string newElement_0_typeCtorSignature = "(I)V"; @@ -6375,7 +6375,7 @@ void CHIPLocalizationConfigurationSupportedLocalesAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - newElement_0 = env->NewStringUTF(std::string(entry_0.data(), entry_0.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0, newElement_0)); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -9905,7 +9905,7 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_isOperational; std::string newElement_0_isOperationalClassName = "java/lang/Boolean"; std::string newElement_0_isOperationalCtorSignature = "(Z)V"; @@ -10581,8 +10581,8 @@ void CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CallbackFn( else { jobject newElement_0_nameInsideOptional; - newElement_0_nameInsideOptional = - env->NewStringUTF(std::string(entry_0.name.Value().data(), entry_0.name.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } jobject newElement_0_stackFreeCurrent; @@ -11139,7 +11139,7 @@ void CHIPThreadNetworkDiagnosticsNetworkNameAttributeCallback::CallbackFn( } else { - javaValue = env->NewStringUTF(std::string(value.Value().data(), value.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(value.Value(), javaValue)); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); @@ -15468,7 +15468,7 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_nodeIDClassName.c_str(), newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -16056,8 +16056,8 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( else { jobject newElement_0_groupNameInsideOptional; - newElement_0_groupNameInsideOptional = - env->NewStringUTF(std::string(entry_0.groupName.Value().data(), entry_0.groupName.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); } jobject newElement_0_fabricIndex; @@ -16437,9 +16437,9 @@ void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_value; - newElement_0_value = env->NewStringUTF(std::string(entry_0.value.data(), entry_0.value.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", @@ -16805,9 +16805,9 @@ void CHIPUserLabelLabelListAttributeCallback::CallbackFn( auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_value; - newElement_0_value = env->NewStringUTF(std::string(entry_0.value.data(), entry_0.value.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", @@ -17522,7 +17522,7 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; jobject newElement_0_label; - newElement_0_label = env->NewStringUTF(std::string(entry_0.label.data(), entry_0.label.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_mode; std::string newElement_0_modeClassName = "java/lang/Integer"; std::string newElement_0_modeCtorSignature = "(I)V"; @@ -27709,8 +27709,8 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( else { jobject newElement_0_nameInsideOptional; - newElement_0_nameInsideOptional = - env->NewStringUTF(std::string(entry_0.name.Value().data(), entry_0.name.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } jobject newElement_0_callSign; @@ -27721,8 +27721,8 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( else { jobject newElement_0_callSignInsideOptional; - newElement_0_callSignInsideOptional = - env->NewStringUTF(std::string(entry_0.callSign.Value().data(), entry_0.callSign.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.callSign.Value(), newElement_0_callSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_callSignInsideOptional, newElement_0_callSign); } jobject newElement_0_affiliateCallSign; @@ -27733,8 +27733,8 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( else { jobject newElement_0_affiliateCallSignInsideOptional; - newElement_0_affiliateCallSignInsideOptional = env->NewStringUTF( - std::string(entry_0.affiliateCallSign.Value().data(), entry_0.affiliateCallSign.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.affiliateCallSign.Value(), + newElement_0_affiliateCallSignInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_affiliateCallSignInsideOptional, newElement_0_affiliateCallSign); } @@ -28115,7 +28115,7 @@ void CHIPTargetNavigatorTargetListAttributeCallback::CallbackFn( newElement_0_identifierCtorSignature.c_str(), entry_0.identifier, newElement_0_identifier); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jclass targetInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -29039,9 +29039,9 @@ void CHIPMediaInputInputListAttributeCallback::CallbackFn( newElement_0_inputTypeClassName.c_str(), newElement_0_inputTypeCtorSignature.c_str(), static_cast(entry_0.inputType), newElement_0_inputType); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jobject newElement_0_description; - newElement_0_description = env->NewStringUTF(std::string(entry_0.description.data(), entry_0.description.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.description, newElement_0_description)); jclass inputInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -29969,7 +29969,7 @@ void CHIPContentLauncherAcceptHeaderAttributeCallback::CallbackFn(void * context { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - newElement_0 = env->NewStringUTF(std::string(entry_0.data(), entry_0.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0, newElement_0)); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -30330,7 +30330,7 @@ void CHIPAudioOutputOutputListAttributeCallback::CallbackFn( newElement_0_outputTypeClassName.c_str(), newElement_0_outputTypeCtorSignature.c_str(), static_cast(entry_0.outputType), newElement_0_outputType); jobject newElement_0_name; - newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); jclass outputInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -32663,8 +32663,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn } else { - newElement_0_nullableString = env->NewStringUTF( - std::string(entry_0.nullableString.Value().data(), entry_0.nullableString.Value().size()).c_str()); + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.nullableString.Value(), newElement_0_nullableString)); } jobject newElement_0_optionalString; if (!entry_0.optionalString.HasValue()) @@ -32674,8 +32674,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn else { jobject newElement_0_optionalStringInsideOptional; - newElement_0_optionalStringInsideOptional = env->NewStringUTF( - std::string(entry_0.optionalString.Value().data(), entry_0.optionalString.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.optionalString.Value(), + newElement_0_optionalStringInsideOptional)); chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStringInsideOptional, newElement_0_optionalString); } @@ -32693,10 +32693,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn } else { - newElement_0_nullableOptionalStringInsideOptional = - env->NewStringUTF(std::string(entry_0.nullableOptionalString.Value().Value().data(), - entry_0.nullableOptionalString.Value().Value().size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.nullableOptionalString.Value().Value(), newElement_0_nullableOptionalStringInsideOptional)); } chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStringInsideOptional, newElement_0_nullableOptionalString); @@ -32734,8 +32732,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn reinterpret_cast(entry_0.nullableStruct.Value().d.data())); newElement_0_nullableStruct_d = newElement_0_nullableStruct_dByteArray; jobject newElement_0_nullableStruct_e; - newElement_0_nullableStruct_e = env->NewStringUTF( - std::string(entry_0.nullableStruct.Value().e.data(), entry_0.nullableStruct.Value().e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.nullableStruct.Value().e, + newElement_0_nullableStruct_e)); jobject newElement_0_nullableStruct_f; std::string newElement_0_nullableStruct_fClassName = "java/lang/Integer"; std::string newElement_0_nullableStruct_fCtorSignature = "(I)V"; @@ -32815,8 +32813,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn reinterpret_cast(entry_0.optionalStruct.Value().d.data())); newElement_0_optionalStructInsideOptional_d = newElement_0_optionalStructInsideOptional_dByteArray; jobject newElement_0_optionalStructInsideOptional_e; - newElement_0_optionalStructInsideOptional_e = env->NewStringUTF( - std::string(entry_0.optionalStruct.Value().e.data(), entry_0.optionalStruct.Value().e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.optionalStruct.Value().e, + newElement_0_optionalStructInsideOptional_e)); jobject newElement_0_optionalStructInsideOptional_f; std::string newElement_0_optionalStructInsideOptional_fClassName = "java/lang/Integer"; std::string newElement_0_optionalStructInsideOptional_fCtorSignature = "(I)V"; @@ -32910,10 +32908,8 @@ void CHIPUnitTestingListNullablesAndOptionalsStructAttributeCallback::CallbackFn reinterpret_cast(entry_0.nullableOptionalStruct.Value().Value().d.data())); newElement_0_nullableOptionalStructInsideOptional_d = newElement_0_nullableOptionalStructInsideOptional_dByteArray; jobject newElement_0_nullableOptionalStructInsideOptional_e; - newElement_0_nullableOptionalStructInsideOptional_e = - env->NewStringUTF(std::string(entry_0.nullableOptionalStruct.Value().Value().e.data(), - entry_0.nullableOptionalStruct.Value().Value().e.size()) - .c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.nullableOptionalStruct.Value().Value().e, newElement_0_nullableOptionalStructInsideOptional_e)); jobject newElement_0_nullableOptionalStructInsideOptional_f; std::string newElement_0_nullableOptionalStructInsideOptional_fClassName = "java/lang/Integer"; std::string newElement_0_nullableOptionalStructInsideOptional_fCtorSignature = "(I)V"; @@ -33268,8 +33264,8 @@ void CHIPUnitTestingListFabricScopedAttributeCallback::CallbackFn( newElement_0_nullableOptionalFabricSensitiveInt8u); } jobject newElement_0_fabricSensitiveCharString; - newElement_0_fabricSensitiveCharString = env->NewStringUTF( - std::string(entry_0.fabricSensitiveCharString.data(), entry_0.fabricSensitiveCharString.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.fabricSensitiveCharString, + newElement_0_fabricSensitiveCharString)); jobject newElement_0_fabricSensitiveStruct; jobject newElement_0_fabricSensitiveStruct_a; std::string newElement_0_fabricSensitiveStruct_aClassName = "java/lang/Integer"; @@ -33297,8 +33293,8 @@ void CHIPUnitTestingListFabricScopedAttributeCallback::CallbackFn( reinterpret_cast(entry_0.fabricSensitiveStruct.d.data())); newElement_0_fabricSensitiveStruct_d = newElement_0_fabricSensitiveStruct_dByteArray; jobject newElement_0_fabricSensitiveStruct_e; - newElement_0_fabricSensitiveStruct_e = - env->NewStringUTF(std::string(entry_0.fabricSensitiveStruct.e.data(), entry_0.fabricSensitiveStruct.e.size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.fabricSensitiveStruct.e, + newElement_0_fabricSensitiveStruct_e)); jobject newElement_0_fabricSensitiveStruct_f; std::string newElement_0_fabricSensitiveStruct_fClassName = "java/lang/Integer"; std::string newElement_0_fabricSensitiveStruct_fCtorSignature = "(I)V"; @@ -35184,7 +35180,7 @@ void CHIPUnitTestingNullableCharStringAttributeCallback::CallbackFn(void * conte } else { - javaValue = env->NewStringUTF(std::string(value.Value().data(), value.Value().size()).c_str()); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(value.Value(), javaValue)); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); diff --git a/src/lib/support/DefaultStorageKeyAllocator.h b/src/lib/support/DefaultStorageKeyAllocator.h index 6be4b307eda680..418220a3f3d520 100644 --- a/src/lib/support/DefaultStorageKeyAllocator.h +++ b/src/lib/support/DefaultStorageKeyAllocator.h @@ -198,6 +198,7 @@ class DefaultStorageKeyAllocator } static StorageKeyName SubscriptionResumptionMaxCount() { return StorageKeyName::Formatted("g/sum"); } + static StorageKeyName GlobalSceneCountKey() { return StorageKeyName::Formatted("g/scc"); } static StorageKeyName FabricSceneDataKey(chip::FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/sc", fabric); } static StorageKeyName FabricSceneKey(chip::FabricIndex fabric, uint8_t id) { diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index c7834348e06a1a..1a4fae9e22ff32 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -388,4 +388,34 @@ CHIP_ERROR JniReferences::GetObjectField(jobject objectToRead, const char * name return err; } +CHIP_ERROR JniReferences::CharToStringUTF(const chip::CharSpan & charSpan, jobject & outStr) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jobject jbyteBuffer = env->NewDirectByteBuffer((void *) charSpan.data(), static_cast(charSpan.size())); + + jclass charSetClass = env->FindClass("java/nio/charset/Charset"); + jmethodID charsetForNameMethod = + env->GetStaticMethodID(charSetClass, "forName", "(Ljava/lang/String;)Ljava/nio/charset/Charset;"); + jobject charsetObject = env->CallStaticObjectMethod(charSetClass, charsetForNameMethod, env->NewStringUTF("UTF-8")); + + jclass charSetDocoderClass = env->FindClass("java/nio/charset/CharsetDecoder"); + jmethodID newDocoderMethod = env->GetMethodID(charSetClass, "newDecoder", "()Ljava/nio/charset/CharsetDecoder;"); + jobject decoderObject = env->CallObjectMethod(charsetObject, newDocoderMethod); + + jmethodID charSetDecodeMethod = env->GetMethodID(charSetDocoderClass, "decode", "(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;"); + jobject decodeObject = env->CallObjectMethod(decoderObject, charSetDecodeMethod, jbyteBuffer); + env->DeleteLocalRef(jbyteBuffer); + + // If decode exception occur, outStr will be set null. + outStr = nullptr; + + VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); + + jclass charBufferClass = env->FindClass("java/nio/CharBuffer"); + jmethodID charBufferToString = env->GetMethodID(charBufferClass, "toString", "()Ljava/lang/String;"); + outStr = static_cast(env->CallObjectMethod(decodeObject, charBufferToString)); + + return CHIP_NO_ERROR; +} + } // namespace chip diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index f2e357de2db46a..5e323d93f46394 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -160,6 +161,15 @@ class JniReferences return CreateBoxedObject(boxedTypeClsName, constructorSignature, chip::to_underlying(value), outObj); } + /** + * Use instead of 'NewStringUTF' function + * If the value is not decoded with "UTF-8", the error will be returned. + * (The NewStringUTF function crashes when the value can not decoded as "UTF-8".) + * + * Creates a java string type based on char array. + */ + CHIP_ERROR CharToStringUTF(const chip::CharSpan & charSpan, jobject & outString); + private: JniReferences() {} diff --git a/src/lib/support/PersistentData.h b/src/lib/support/PersistentData.h index f2961c7a5427f0..4ad74da92bf32a 100644 --- a/src/lib/support/PersistentData.h +++ b/src/lib/support/PersistentData.h @@ -52,7 +52,7 @@ struct PersistentData return storage->SyncSetKeyValue(key.KeyName(), buffer, static_cast(writer.GetLengthWritten())); } - CHIP_ERROR Load(PersistentStorageDelegate * storage) + virtual CHIP_ERROR Load(PersistentStorageDelegate * storage) { VerifyOrReturnError(nullptr != storage, CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/platform/Ameba/AmebaUtils.cpp b/src/platform/Ameba/AmebaUtils.cpp index 72d0e7fda0c4cc..578ffab2cd5816 100644 --- a/src/platform/Ameba/AmebaUtils.cpp +++ b/src/platform/Ameba/AmebaUtils.cpp @@ -136,7 +136,7 @@ CHIP_ERROR AmebaUtils::WiFiDisconnect(void) return err; } -CHIP_ERROR AmebaUtils::WiFiConnect(void) +CHIP_ERROR AmebaUtils::WiFiConnectProvisionedNetwork(void) { CHIP_ERROR err = CHIP_NO_ERROR; rtw_wifi_config_t * config = (rtw_wifi_config_t *) pvPortMalloc(sizeof(rtw_wifi_config_t)); @@ -144,9 +144,56 @@ CHIP_ERROR AmebaUtils::WiFiConnect(void) GetWiFiConfig(config); ChipLogProgress(DeviceLayer, "Connecting to AP : [%s]", (char *) config->ssid); int ameba_err = matter_wifi_connect((char *) config->ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) config->password, - strlen((const char *) config->ssid), strlen((const char *) config->password), 0, NULL); + strlen((const char *) config->ssid), strlen((const char *) config->password), 0, nullptr); vPortFree(config); err = (ameba_err == RTW_SUCCESS) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; return err; } + +CHIP_ERROR AmebaUtils::WiFiConnect(const char * ssid, const char * password) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogProgress(DeviceLayer, "Connecting to AP : [%s]", (char *) ssid); + int ameba_err = matter_wifi_connect((char *) ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) password, strlen(ssid), + strlen(password), 0, nullptr); + err = (ameba_err == RTW_SUCCESS) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; + return err; +} + +CHIP_ERROR AmebaUtils::SetCurrentProvisionedNetwork() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + rtw_wifi_setting_t pSetting; + int ret = matter_get_sta_wifi_info(&pSetting); + if (ret < 0) + { + ChipLogProgress(DeviceLayer, "STA No Wi-Fi Info"); + goto exit; + } + else + { + rtw_wifi_config_t config = { 0 }; + GetWiFiConfig(&config); + if (!memcmp(config.ssid, pSetting.ssid, strlen((const char *) pSetting.ssid) + 1)) + { + ChipLogProgress(DeviceLayer, "STA Wi-Fi Info exist, do nothing"); + goto exit; + } + else + { + ChipLogProgress(DeviceLayer, "STA Wi-Fi Info "); + + memcpy(config.ssid, pSetting.ssid, strlen((const char *) pSetting.ssid) + 1); + memcpy(config.password, pSetting.password, strlen((const char *) pSetting.password) + 1); + err = SetWiFiConfig(&config); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "SetWiFiConfig() failed"); + goto exit; + } + } + } +exit: + return err; +} diff --git a/src/platform/Ameba/AmebaUtils.h b/src/platform/Ameba/AmebaUtils.h index b2f68f38dad1ef..5fcc5c9c2ef487 100644 --- a/src/platform/Ameba/AmebaUtils.h +++ b/src/platform/Ameba/AmebaUtils.h @@ -36,7 +36,9 @@ class AmebaUtils static CHIP_ERROR GetWiFiConfig(rtw_wifi_config_t * config); static CHIP_ERROR ClearWiFiConfig(void); static CHIP_ERROR WiFiDisconnect(void); - static CHIP_ERROR WiFiConnect(void); + static CHIP_ERROR WiFiConnectProvisionedNetwork(void); + static CHIP_ERROR WiFiConnect(const char * ssid, const char * password); + static CHIP_ERROR SetCurrentProvisionedNetwork(void); }; } // namespace Internal diff --git a/src/platform/Ameba/ConnectivityManagerImpl.cpp b/src/platform/Ameba/ConnectivityManagerImpl.cpp index 670c060e95b94f..ba289b115c0bab 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.cpp +++ b/src/platform/Ameba/ConnectivityManagerImpl.cpp @@ -83,7 +83,7 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() chip_connmgr_set_callback_func((chip_connmgr_callback)(conn_callback_dispatcher), this); // Register WiFi event handlers - wifi_reg_event_handler(WIFI_EVENT_CONNECT, ConnectivityManagerImpl::RtkWiFiStationConnectedHandler, NULL); + wifi_reg_event_handler(WIFI_EVENT_FOURWAY_HANDSHAKE_DONE, ConnectivityManagerImpl::RtkWiFiStationConnectedHandler, NULL); wifi_reg_event_handler(WIFI_EVENT_DISCONNECT, ConnectivityManagerImpl::RtkWiFiStationDisconnectedHandler, NULL); err = Internal::AmebaUtils::StartWiFi(); @@ -148,13 +148,16 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) if (event->Type == DeviceEventType::kRtkWiFiStationConnectedEvent) { ChipLogProgress(DeviceLayer, "WiFiStationConnected"); + // Only do DHCP when connecting to wifi via matter provisioning + // External wifi provisioning will do DHCP on their own if (mWiFiStationState == kWiFiStationState_Connecting) { - ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + DHCPProcess(); } - if (rtw_join_status & JOIN_HANDSHAKE_DONE) + // Allow external wifi provisioning methods by allowing NotConnected states to advance to Connecting_succeed + if ((mWiFiStationState == kWiFiStationState_Connecting) || (mWiFiStationState == kWiFiStationState_NotConnected)) { - DHCPProcess(); + ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); } DriveStationState(); } @@ -166,6 +169,10 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) { ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); } + if (mWiFiStationState == kWiFiStationState_Connected) + { + ChangeWiFiStationState(kWiFiStationState_Disconnecting); + } DriveStationState(); } if (event->Type == DeviceEventType::kRtkWiFiScanCompletedEvent) @@ -204,7 +211,8 @@ CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationMode(WiFiStationMode val) if (mWiFiStationMode != val) { - ChipLogProgress(DeviceLayer, "WiFi station mode change: %d -> %d", (mWiFiStationMode), (val)); + ChipLogProgress(DeviceLayer, "WiFi station mode change: %s -> %s", WiFiStationModeToStr(mWiFiStationMode), + WiFiStationModeToStr(val)); } mWiFiStationMode = val; @@ -221,9 +229,7 @@ bool ConnectivityManagerImpl::_IsWiFiStationProvisioned(void) void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) { // Clear Ameba WiFi station config - rtw_wifi_config_t wifiConfig; - memset(&wifiConfig, 0, sizeof(wifiConfig)); - Internal::AmebaUtils::SetWiFiConfig(&wifiConfig); + Internal::AmebaUtils::ClearWiFiConfig(); } CHIP_ERROR ConnectivityManagerImpl::_SetWiFiAPMode(WiFiAPMode val) @@ -496,9 +502,9 @@ void ConnectivityManagerImpl::DriveStationState() // If the station interface is currently connected ... if (stationConnected) { - // Advance the station state to Connected if it was previously NotConnected or + // Advance the station state to Connected if // a previously initiated connect attempt succeeded. - if (mWiFiStationState == kWiFiStationState_NotConnected || mWiFiStationState == kWiFiStationState_Connecting_Succeeded) + if (mWiFiStationState == kWiFiStationState_Connecting_Succeeded) { ChangeWiFiStationState(kWiFiStationState_Connected); ChipLogProgress(DeviceLayer, "WiFi station interface connected"); @@ -512,23 +518,23 @@ void ConnectivityManagerImpl::DriveStationState() { System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); - // Advance the station state to NotConnected if it was previously Connected or Disconnecting, + // Advance the station state to NotConnected if it was previously Disconnecting, // or if a previous initiated connect attempt failed. - if (mWiFiStationState == kWiFiStationState_Connected || mWiFiStationState == kWiFiStationState_Disconnecting || - mWiFiStationState == kWiFiStationState_Connecting_Failed) + if (mWiFiStationState == kWiFiStationState_Disconnecting || mWiFiStationState == kWiFiStationState_Connecting_Failed) { WiFiStationState prevState = mWiFiStationState; ChangeWiFiStationState(kWiFiStationState_NotConnected); if (prevState != kWiFiStationState_Connecting_Failed) { - ChipLogProgress(DeviceLayer, "WiFi station interface disconnected"); - mLastStationConnectFailTime = System::Clock::kZero; - OnStationDisconnected(); + ChipLogProgress(DeviceLayer, "WiFi station failed to connect"); + // TODO: check retry count if exceeded, then clearwificonfig } else { - mLastStationConnectFailTime = now; + ChipLogProgress(DeviceLayer, "WiFi station disconnected"); } + mLastStationConnectFailTime = now; + OnStationDisconnected(); } // If the WiFi station interface is now enabled and provisioned (and by implication, // not presently under application control), AND the system is not in the process of @@ -541,14 +547,13 @@ void ConnectivityManagerImpl::DriveStationState() now >= mLastStationConnectFailTime + mWiFiStationReconnectInterval) { ChipLogProgress(DeviceLayer, "Attempting to connect WiFi station interface"); - err = Internal::AmebaUtils::WiFiConnect(); + ChangeWiFiStationState(kWiFiStationState_Connecting); + err = Internal::AmebaUtils::WiFiConnectProvisionedNetwork(); if (err != CHIP_NO_ERROR) { - ChipLogError(DeviceLayer, "WiFiConnect() failed: %s", chip::ErrorStr(err)); + ChipLogError(DeviceLayer, "WiFiConnectProvisionedNetwork() failed: %s", chip::ErrorStr(err)); } SuccessOrExit(err); - - ChangeWiFiStationState(kWiFiStationState_Connecting); } // Otherwise arrange another connection attempt at a suitable point in the future. @@ -644,7 +649,8 @@ void ConnectivityManagerImpl::ChangeWiFiStationState(WiFiStationState newState) { if (mWiFiStationState != newState) { - ChipLogProgress(DeviceLayer, "WiFi station state change: %d -> %d", (mWiFiStationState), (newState)); + ChipLogProgress(DeviceLayer, "WiFi station state change: %s -> %s", WiFiStationStateToStr(mWiFiStationState), + WiFiStationStateToStr(newState)); mWiFiStationState = newState; SystemLayer().ScheduleLambda([]() { NetworkCommissioning::AmebaWiFiDriver::GetInstance().OnNetworkStatusChange(); }); } diff --git a/src/platform/Ameba/ConnectivityManagerImpl.h b/src/platform/Ameba/ConnectivityManagerImpl.h index 9863c47dec88d8..c4c04c5346e482 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.h +++ b/src/platform/Ameba/ConnectivityManagerImpl.h @@ -84,6 +84,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, // the implementation methods provided by this class. friend class ConnectivityManager; +public: + void ChangeWiFiStationState(WiFiStationState newState); + private: CHIP_ERROR _Init(void); void _OnPlatformEvent(const ChipDeviceEvent * event); @@ -130,7 +133,6 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void DriveStationState(void); void OnStationConnected(void); void OnStationDisconnected(void); - void ChangeWiFiStationState(WiFiStationState newState); static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState); void DriveAPState(void); diff --git a/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp b/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp index e89bc635377215..38be3f2080f0b5 100644 --- a/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -145,25 +146,10 @@ CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLe } } - ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled)); + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); - rtw_wifi_config_t wifiConfig; - - // Set the wifi configuration - memset(&wifiConfig, 0, sizeof(wifiConfig)); - memcpy(wifiConfig.ssid, ssid, ssidLen + 1); - memcpy(wifiConfig.password, key, keyLen + 1); - - // Configure the WiFi interface. - err = chip::DeviceLayer::Internal::AmebaUtils::SetWiFiConfig(&wifiConfig); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "SetWiFiConfig() failed"); - return err; - } - - ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled)); - return ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Enabled); + err = chip::DeviceLayer::Internal::AmebaUtils::WiFiConnect(ssid, key); + return err; } void AmebaWiFiDriver::OnConnectWiFiNetwork() @@ -318,7 +304,7 @@ void AmebaWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * cal CHIP_ERROR AmebaWiFiDriver::SetLastDisconnectReason(const ChipDeviceEvent * event) { VerifyOrReturnError(event->Type == DeviceEventType::kRtkWiFiStationDisconnectedEvent, CHIP_ERROR_INVALID_ARGUMENT); - mLastDisconnectedReason = wifi_get_last_error(); + mLastDisconnectedReason = wifi_get_last_error(); // TODO: change this to wrapper return CHIP_NO_ERROR; } diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 922cf5ac98e238..0f94f26a207d1e 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 922cf5ac98e238f3a75d272713868c6e2b75457b +Subproject commit 0f94f26a207d1ead2fe55f978d99d4c0b04d05e6