Skip to content

Commit

Permalink
Move Application Launcher Cluster to be spec compliant (project-chi…
Browse files Browse the repository at this point in the history
…p#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
  • Loading branch information
andy31415 authored and pull[bot] committed May 7, 2024
1 parent 72f45b2 commit 6c3e248
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -3613,7 +3613,7 @@ server cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand Down
10 changes: 5 additions & 5 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -6353,7 +6353,7 @@ client cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand All @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -6312,7 +6312,7 @@ client cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper<LauncherR
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}

Expand All @@ -58,7 +58,7 @@ void ApplicationLauncherManager::HandleStopApp(CommandResponseHelper<LauncherRes
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}

Expand All @@ -71,6 +71,6 @@ void ApplicationLauncherManager::HandleHideApp(CommandResponseHelper<LauncherRes
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper<LauncherR
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}

Expand All @@ -58,7 +58,7 @@ void ApplicationLauncherManager::HandleStopApp(CommandResponseHelper<LauncherRes
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}

Expand All @@ -71,6 +71,6 @@ void ApplicationLauncherManager::HandleHideApp(CommandResponseHelper<LauncherRes
LauncherResponseType response;
const char * buf = "data";
response.data.SetValue(ByteSpan(from_const_char(buf), strlen(buf)));
response.status = ApplicationLauncherStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
6 changes: 3 additions & 3 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,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;
Expand All @@ -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;
Expand All @@ -2387,7 +2387,7 @@ server cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,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;
Expand All @@ -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;
Expand All @@ -1931,7 +1931,7 @@ client cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3472,7 +3472,7 @@ server cluster AudioOutput = 1291 {
}

server cluster ApplicationLauncher = 1292 {
enum ApplicationLauncherStatusEnum : ENUM8 {
enum StatusEnum : ENUM8 {
kSuccess = 0;
kAppNotAvailable = 1;
kSystemBusy = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co
{
ChipLogError(Zcl, "ApplicationLauncher target app not found");
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kAppNotAvailable;
response.status = StatusEnum::kAppNotAvailable;
responder.Success(response);
return true;
}
Expand Down Expand Up @@ -293,7 +293,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co
{
ChipLogError(Zcl, "ApplicationLauncher target app not found");
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kAppNotAvailable;
response.status = StatusEnum::kAppNotAvailable;
responder.Success(response);
return true;
}
Expand Down Expand Up @@ -352,7 +352,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm
{
ChipLogError(Zcl, "ApplicationLauncher target app not loaded");
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kAppNotAvailable;
response.status = StatusEnum::kAppNotAvailable;
responder.Success(response);
return true;
}
Expand Down Expand Up @@ -441,7 +441,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm
{
ChipLogError(Zcl, "ApplicationLauncher target app not loaded");
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kAppNotAvailable;
response.status = StatusEnum::kAppNotAvailable;
responder.Success(response);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2021 Project CHIP Authors
Copyright (c) 2021-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.
Expand All @@ -25,8 +25,8 @@ limitations under the License.
<server init="false" tick="false">true</server>
<description>This cluster provides an interface for launching content on a media player device such as a TV or Speaker.</description>

<attribute side="server" code="0x0000" define="APPLICATION_LAUNCHER_LIST" type="ARRAY" entryType="int16u" length="254" reportable="true" writable="false" optional="true">CatalogList</attribute>
<attribute side="server" code="0x0001" define="APPLICATION_LAUNCHER_CURRENT_APP" type="ApplicationEPStruct" default="0x0" isNullable="true" writable="true" optional="true">CurrentApp</attribute>
<attribute side="server" code="0x0000" define="APPLICATION_LAUNCHER_LIST" type="ARRAY" entryType="int16u" reportable="true" writable="false" optional="true">CatalogList</attribute>
<attribute side="server" code="0x0001" define="APPLICATION_LAUNCHER_CURRENT_APP" type="ApplicationEPStruct" isNullable="true" writable="false" optional="true">CurrentApp</attribute>

<command source="client" code="0x00" name="LaunchApp" response="LauncherResponse" optional="false">
<description>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.</description>
Expand All @@ -46,7 +46,7 @@ limitations under the License.

<command source="server" code="0x03" name="LauncherResponse" optional="false">
<description>This command SHALL be generated in response to LaunchApp commands.</description>
<arg name="Status" type="ApplicationLauncherStatusEnum"/>
<arg name="Status" type="StatusEnum"/>
<arg name="Data" type="octet_string" optional="true"/>
</command>

Expand All @@ -69,7 +69,7 @@ limitations under the License.
<item name="ApplicationID" type="char_string"/>
</struct>

<enum name="ApplicationLauncherStatusEnum" type="enum8">
<enum name="StatusEnum" type="enum8">
<cluster code="0x050c"/>
<item name="Success" value="0x00"/>
<item name="AppNotAvailable" value="0x01"/>
Expand Down
6 changes: 3 additions & 3 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -6369,7 +6369,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;
Expand All @@ -6390,7 +6390,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;
Expand All @@ -6412,7 +6412,7 @@ client cluster ApplicationLauncher = 1292 {
}

response struct LauncherResponse = 3 {
ApplicationLauncherStatusEnum status = 0;
StatusEnum status = 0;
optional octet_string data = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27102,14 +27102,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);
Expand Down Expand Up @@ -27181,8 +27173,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);
Expand Down
1 change: 0 additions & 1 deletion src/controller/python/chip/clusters/CHIPClusters.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c3e248

Please sign in to comment.