From 6c3e2486ca5ff35b1e2fa318dcb92d808458a244 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 1 Nov 2023 09:05:08 -0400 Subject: [PATCH] Move `Application Launcher Cluster` to be spec compliant (#30134) * Rename ApplicationLauncherStatusEnum to StatusEnum * Make current app read-only, remove length from array size, remove default of 0 * zap regen * Minor copyright change to trigger CI rebuild * Revert availability change - sed should not have touched that * zap regen --- .../all-clusters-minimal-app.matter | 4 +- .../placeholder/linux/apps/app1/config.matter | 10 ++-- .../placeholder/linux/apps/app2/config.matter | 10 ++-- .../ApplicationLauncherManager.cpp | 6 +- .../ApplicationLauncherManager.cpp | 6 +- examples/tv-app/tv-common/tv-app.matter | 6 +- .../tv-casting-common/tv-casting-app.matter | 6 +- .../inputs/large_all_clusters_app.matter | 2 +- .../application-launcher-server.cpp | 8 +-- .../chip/application-launcher-cluster.xml | 10 ++-- .../data_model/controller-clusters.matter | 6 +- .../chip/devicecontroller/ChipClusters.java | 10 ---- .../python/chip/clusters/CHIPClusters.py | 1 - .../python/chip/clusters/Objects.py | 6 +- .../CHIP/zap-generated/MTRBaseClusters.h | 12 ++-- .../CHIP/zap-generated/MTRBaseClusters.mm | 46 --------------- .../CHIP/zap-generated/MTRClusters.h | 2 - .../CHIP/zap-generated/MTRClusters.mm | 11 ---- .../integration-tests/tv-app/test_app.py | 6 +- .../zap-generated/cluster-enums-check.h | 4 +- .../app-common/zap-generated/cluster-enums.h | 4 +- .../zap-generated/cluster-objects.h | 4 +- .../zap-generated/cluster/Commands.h | 2 +- .../zap-generated/cluster/Commands.h | 57 ------------------- 24 files changed, 54 insertions(+), 185 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 8a69d89ed9222d..31724f0ef98dd0 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 @@ -3572,7 +3572,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; @@ -3613,7 +3613,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 9c8f973de9a8f1..c1c3047b03c942 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6310,7 +6310,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; @@ -6331,7 +6331,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; @@ -6353,7 +6353,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } @@ -6367,7 +6367,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; @@ -6388,7 +6388,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 b6de3ec30f2df4..009d443d1c8742 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6269,7 +6269,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; @@ -6290,7 +6290,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; @@ -6312,7 +6312,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - ApplicationLauncherStatusEnum status = 0; + StatusEnum status = 0; optional octet_string data = 1; } @@ -6326,7 +6326,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; @@ -6347,7 +6347,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/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