From c8240fdb16f5f8c5867d5f51be072b38169bf60e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 Oct 2023 14:31:59 -0400 Subject: [PATCH 1/6] Rename ApplicationLauncherStatusEnum to StatusEnum --- .../all-clusters-common/all-clusters-minimal-app.matter | 4 ++-- examples/placeholder/linux/apps/app1/config.matter | 6 +++--- examples/placeholder/linux/apps/app2/config.matter | 6 +++--- .../application-launcher/ApplicationLauncherManager.cpp | 6 +++--- .../application-launcher/ApplicationLauncherManager.cpp | 6 +++--- examples/tv-app/tv-common/tv-app.matter | 4 ++-- .../tv-casting-common/tv-casting-app.matter | 4 ++-- .../matter_idl/tests/inputs/large_all_clusters_app.matter | 2 +- .../application-launcher-server.cpp | 8 ++++---- .../zcl/data-model/chip/application-launcher-cluster.xml | 4 ++-- src/controller/data_model/controller-clusters.matter | 4 ++-- src/controller/python/chip/clusters/Objects.py | 6 +++--- src/darwin/Framework/CHIP/templates/availability.yaml | 4 ++-- .../openiotsdk/integration-tests/tv-app/test_app.py | 6 +++--- .../app-common/zap-generated/cluster-enums-check.h | 4 ++-- .../app-common/app-common/zap-generated/cluster-enums.h | 4 ++-- .../app-common/app-common/zap-generated/cluster-objects.h | 4 ++-- 17 files changed, 41 insertions(+), 41 deletions(-) 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 d80602ebfc5633..7876e03040be92 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 @@ -3568,7 +3568,7 @@ server cluster AudioOutput = 1291 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -3609,7 +3609,7 @@ server cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 8daed1603f891c..03703caadb5169 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6306,7 +6306,7 @@ server cluster AudioOutput = 1291 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -6349,7 +6349,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } @@ -6363,7 +6363,7 @@ client cluster ApplicationLauncher = 1292 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 654c6f2fec41de..69a3bb7a146121 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6265,7 +6265,7 @@ server cluster AudioOutput = 1291 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -6308,7 +6308,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } @@ -6322,7 +6322,7 @@ client cluster ApplicationLauncher = 1292 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp index cfc840ce1c83d3..c915856f48fd4d 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp @@ -45,7 +45,7 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper This command SHALL be generated in response to LaunchApp commands. - + @@ -69,7 +69,7 @@ limitations under the License. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 41a318647f425d..081b28ed7ea46e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6335,7 +6335,7 @@ client cluster AudioOutput = 1291 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : enum8 { + enum StatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -6378,7 +6378,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cffb2a70cb56a6..fc602ea941e6ad 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -34872,7 +34872,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class ApplicationLauncherStatusEnum(MatterIntEnum): + class StatusEnum(MatterIntEnum): kSuccess = 0x00 kAppNotAvailable = 0x01 kSystemBusy = 0x02 @@ -34975,11 +34975,11 @@ class LauncherResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.StatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[bytes]), ]) - status: 'ApplicationLauncher.Enums.ApplicationLauncherStatusEnum' = 0 + status: 'ApplicationLauncher.Enums.StatusEnum' = 0 data: 'typing.Optional[bytes]' = None class Attributes: diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 50dd02c4952444..44e3dff5e45167 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -3258,7 +3258,7 @@ AudioOutput: - OutputTypeEnum ApplicationLauncher: - - ApplicationLauncherStatusEnum + - StatusEnum ApplicationBasic: - ApplicationStatusEnum TestCluster: @@ -4137,7 +4137,7 @@ - Internal - Other ApplicationLauncher: - ApplicationLauncherStatusEnum: + StatusEnum: - Success - AppNotAvailable - SystemBusy diff --git a/src/test_driver/openiotsdk/integration-tests/tv-app/test_app.py b/src/test_driver/openiotsdk/integration-tests/tv-app/test_app.py index 306da35acd10ef..dd1ec0db34cfe2 100644 --- a/src/test_driver/openiotsdk/integration-tests/tv-app/test_app.py +++ b/src/test_driver/openiotsdk/integration-tests/tv-app/test_app.py @@ -282,7 +282,7 @@ def test_tv_ctrl(device, controller): catalogVendorID=TV_CTRL_TEST_APP_ADMIN_VENDOR_ID, applicationID=application_id)), requestTimeoutMs=1000) assert err == 0 - assert res.status == ApplicationLauncher.Enums.ApplicationLauncherStatusEnum.kSuccess + assert res.status == ApplicationLauncher.Enums.StatusEnum.kSuccess ret = device.wait_for_output("ApplicationLauncherManager::HandleLaunchApp") assert ret is not None and len(ret) > 0 @@ -291,7 +291,7 @@ def test_tv_ctrl(device, controller): catalogVendorID=TV_CTRL_TEST_APP_ADMIN_VENDOR_ID, applicationID=application_id)), requestTimeoutMs=1000) assert err == 0 - assert res.status == ApplicationLauncher.Enums.ApplicationLauncherStatusEnum.kSuccess + assert res.status == ApplicationLauncher.Enums.StatusEnum.kSuccess ret = device.wait_for_output("ApplicationLauncherManager::HandleStopApp") assert ret is not None and len(ret) > 0 @@ -300,7 +300,7 @@ def test_tv_ctrl(device, controller): catalogVendorID=TV_CTRL_TEST_APP_ADMIN_VENDOR_ID, applicationID=application_id)), requestTimeoutMs=1000) assert err == 0 - assert res.status == ApplicationLauncher.Enums.ApplicationLauncherStatusEnum.kSuccess + assert res.status == ApplicationLauncher.Enums.StatusEnum.kSuccess ret = device.wait_for_output("ApplicationLauncherManager::HandleHideApp") assert ret is not None and len(ret) > 0 diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index c047b38ee99562..a1a1da52588719 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2867,9 +2867,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(AudioOutput::OutputType } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ApplicationLauncher::ApplicationLauncherStatusEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ApplicationLauncher::StatusEnum val) { - using EnumType = ApplicationLauncher::ApplicationLauncherStatusEnum; + using EnumType = ApplicationLauncher::StatusEnum; switch (val) { case EnumType::kSuccess: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 3c99edccb8242c..0bbdeed8ea34e2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4055,8 +4055,8 @@ enum class Feature : uint32_t namespace ApplicationLauncher { -// Enum for ApplicationLauncherStatusEnum -enum class ApplicationLauncherStatusEnum : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kAppNotAvailable = 0x01, diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index ae63fcf4a89d02..9988eedf53e024 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -30261,7 +30261,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatusEnum status = static_cast(0); + StatusEnum status = static_cast(0); Optional data; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -30277,7 +30277,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatusEnum status = static_cast(0); + StatusEnum status = static_cast(0); Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; From aeda0e84126386dd38b660a1d8c49aa133019cf2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 Oct 2023 14:33:44 -0400 Subject: [PATCH 2/6] Make current app read-only, remove length from array size, remove default of 0 --- .../zcl/data-model/chip/application-launcher-cluster.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index 003c473bb5ecb0..db8bc171f38f0c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -25,8 +25,8 @@ limitations under the License. true This cluster provides an interface for launching content on a media player device such as a TV or Speaker. - CatalogList - CurrentApp + CatalogList + CurrentApp Upon receipt, this SHALL launch the specified app with optional data. The TV Device SHALL launch and bring to foreground the identified application in the command if the application is not already launched and in foreground. The TV Device SHALL update state attribute on the Application Basic cluster of the Endpoint corresponding to the launched application. This command returns a Launch Response. From 54f76d8e03e2bf22b370047233297bc2d2bad2c4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 Oct 2023 14:34:29 -0400 Subject: [PATCH 3/6] zap regen --- .../placeholder/linux/apps/app1/config.matter | 4 +- .../placeholder/linux/apps/app2/config.matter | 4 +- examples/tv-app/tv-common/tv-app.matter | 2 +- .../tv-casting-common/tv-casting-app.matter | 2 +- .../data_model/controller-clusters.matter | 2 +- .../chip/devicecontroller/ChipClusters.java | 10 --- .../python/chip/clusters/CHIPClusters.py | 1 - .../CHIP/zap-generated/MTRBaseClusters.h | 4 -- .../CHIP/zap-generated/MTRBaseClusters.mm | 46 -------------- .../CHIP/zap-generated/MTRClusters.h | 2 - .../CHIP/zap-generated/MTRClusters.mm | 11 ---- .../zap-generated/cluster/Commands.h | 2 +- .../zap-generated/cluster/Commands.h | 62 ++----------------- 13 files changed, 13 insertions(+), 139 deletions(-) diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 03703caadb5169..b0ffa4e5e52011 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6327,7 +6327,7 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute optional int16u catalogList[] = 0; - attribute optional nullable ApplicationEPStruct currentApp = 1; + readonly attribute optional nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6384,7 +6384,7 @@ server cluster ApplicationLauncher = 1292 { } readonly attribute int16u catalogList[] = 0; - attribute nullable ApplicationEPStruct currentApp = 1; + readonly attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 69a3bb7a146121..9a56b0e45584cb 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6286,7 +6286,7 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute optional int16u catalogList[] = 0; - attribute optional nullable ApplicationEPStruct currentApp = 1; + readonly attribute optional nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6343,7 +6343,7 @@ server cluster ApplicationLauncher = 1292 { } readonly attribute int16u catalogList[] = 0; - attribute nullable ApplicationEPStruct currentApp = 1; + readonly attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 3f483767526deb..9a80376a01fd38 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2365,7 +2365,7 @@ server cluster ApplicationLauncher = 1292 { } readonly attribute int16u catalogList[] = 0; - attribute nullable ApplicationEPStruct currentApp = 1; + readonly attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 71249ea22ca47e..7a141abe1790b3 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 @@ -1909,7 +1909,7 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute optional int16u catalogList[] = 0; - attribute optional nullable ApplicationEPStruct currentApp = 1; + readonly attribute optional nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 081b28ed7ea46e..eda904bd427eed 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6356,7 +6356,7 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute optional int16u catalogList[] = 0; - attribute optional nullable ApplicationEPStruct currentApp = 1; + readonly attribute optional nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 006c23aaf1d582..bd54e6bd17f89c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -26893,14 +26893,6 @@ public void readCurrentAppAttribute( readCurrentAppAttribute(chipClusterPtr, callback); } - public void writeCurrentAppAttribute(DefaultClusterCallback callback, ChipStructs.ApplicationLauncherClusterApplicationEPStruct value) { - writeCurrentAppAttribute(chipClusterPtr, callback, value, null); - } - - public void writeCurrentAppAttribute(DefaultClusterCallback callback, ChipStructs.ApplicationLauncherClusterApplicationEPStruct value, int timedWriteTimeoutMs) { - writeCurrentAppAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); - } - public void subscribeCurrentAppAttribute( CurrentAppAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentAppAttribute(chipClusterPtr, callback, minInterval, maxInterval); @@ -26972,8 +26964,6 @@ public void subscribeClusterRevisionAttribute( private native void readCurrentAppAttribute(long chipClusterPtr, CurrentAppAttributeCallback callback); - private native void writeCurrentAppAttribute(long chipClusterPtr, DefaultClusterCallback callback, ChipStructs.ApplicationLauncherClusterApplicationEPStruct value, @Nullable Integer timedWriteTimeoutMs); - private native void subscribeCurrentAppAttribute(long chipClusterPtr, CurrentAppAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute(long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index ea04b2c6cf583d..ec082f818704ba 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -10245,7 +10245,6 @@ class ChipClusters: "attributeId": 0x00000001, "type": "", "reportable": True, - "writable": True, }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9a05da483a248f..fcbe37c50f5a7f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -11184,8 +11184,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + (void)readAttributeCatalogListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeCurrentAppWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -23154,8 +23152,6 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { + (void)readAttributeCatalogListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeCatalogListWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)readAttributeCurrentAppWithCompletionHandler:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeCurrentAppWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeCurrentAppWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeCurrentAppWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributeCurrentAppWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 4e04fc5f85c6f5..3563ffff7b1f4e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -89430,44 +89430,6 @@ - (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherCl completion:completion]; } -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::CurrentApp::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; - nonNullValue_0.application.applicationID = AsCharSpan(value.application.applicationID); - if (value.endpoint != nil) { - auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); - definedValue_2 = value.endpoint.unsignedShortValue; - } - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - - (void)subscribeAttributeCurrentAppWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))reportHandler @@ -89781,14 +89743,6 @@ - (void)readAttributeCurrentAppWithCompletionHandler:(void (^)(MTRApplicationLau completionHandler(static_cast(value), error); }]; } -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeCurrentAppWithValue:value params:nil completion:completionHandler]; -} -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeCurrentAppWithValue:value params:params completion:completionHandler]; -} - (void)subscribeAttributeCurrentAppWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index c3c7c512f33813..79f67f5719b081 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5451,8 +5451,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary * _Nullable)readAttributeCatalogListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeCurrentAppWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index ae12459f547741..c3cab5648b9854 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -16540,17 +16540,6 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullabl return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeApplicationLauncherID) attributeID:@(MTRAttributeIDTypeClusterApplicationLauncherAttributeCurrentAppID) params:params]; } -- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeCurrentAppWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeApplicationLauncherID) attributeID:@(MTRAttributeIDTypeClusterApplicationLauncherAttributeCurrentAppID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeApplicationLauncherID) attributeID:@(MTRAttributeIDTypeClusterApplicationLauncherAttributeGeneratedCommandListID) params:params]; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ad1bbc556ee196..35abfa7b96f3e2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -20159,7 +20159,7 @@ void registerClusterApplicationLauncher(Commands & commands, CredentialIssuerCom Id, "catalog-list", Attributes::CatalogList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( - Id, "current-app", Attributes::CurrentApp::Id, WriteCommandType::kWrite, credsIssuerConfig), // + Id, "current-app", Attributes::CurrentApp::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 31c1d5a6e5bbb9..4f7b460c33da83 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -28016,6 +28016,7 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +#if MTR_ENABLE_PROVISIONAL /* * Command TimeSnapshot */ @@ -28066,6 +28067,8 @@ class GeneralDiagnosticsTimeSnapshot : public ClusterCommand { private: }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute NetworkInterfaces */ @@ -126157,62 +126160,6 @@ class ReadApplicationLauncherCurrentApp : public ReadAttribute { } }; -class WriteApplicationLauncherCurrentApp : public WriteAttribute { -public: - WriteApplicationLauncherCurrentApp() - : WriteAttribute("current-app") - , mComplex(&mValue) - { - AddArgument("attr-name", "current-app"); - AddArgument("attr-value", &mComplex); - WriteAttribute::AddArguments(); - } - - ~WriteApplicationLauncherCurrentApp() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; - if (mValue.IsNull()) { - value = nil; - } else { - value = [MTRApplicationLauncherClusterApplicationEPStruct new]; - value.application = [MTRApplicationLauncherClusterApplicationStruct new]; - value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:mValue.Value().application.catalogVendorID]; - value.application.applicationID = [[NSString alloc] initWithBytes:mValue.Value().application.applicationID.data() length:mValue.Value().application.applicationID.size() encoding:NSUTF8StringEncoding]; - if (mValue.Value().endpoint.HasValue()) { - value.endpoint = [NSNumber numberWithUnsignedShort:mValue.Value().endpoint.Value()]; - } else { - value.endpoint = nil; - } - } - - [cluster writeAttributeCurrentAppWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("ApplicationLauncher CurrentApp write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; - TypedComplexArgument> mComplex; -}; - class SubscribeAttributeApplicationLauncherCurrentApp : public SubscribeAttribute { public: SubscribeAttributeApplicationLauncherCurrentApp() @@ -154644,7 +154591,9 @@ void registerClusterGeneralDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // @@ -158848,7 +158797,6 @@ void registerClusterApplicationLauncher(Commands & commands) make_unique(), // make_unique(), // make_unique(), // - make_unique(), // make_unique(), // make_unique(), // make_unique(), // From 02fead018f85977781e6613798155a613fd6ae6c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 Oct 2023 14:38:32 -0400 Subject: [PATCH 4/6] Minor copyright change to trigger CI rebuild --- .../zcl/data-model/chip/application-launcher-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index db8bc171f38f0c..d68b3d3851ae22 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -1,6 +1,6 @@