Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Application Launcher Cluster to be spec compliant #30134

Merged
merged 8 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -3609,7 +3609,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 @@ -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;
Expand All @@ -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;
Expand All @@ -6349,7 +6349,7 @@ client cluster ApplicationLauncher = 1292 {
}

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

Expand All @@ -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;
Expand All @@ -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;
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 @@ -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;
Expand All @@ -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;
Expand All @@ -6308,7 +6308,7 @@ client cluster ApplicationLauncher = 1292 {
}

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

Expand All @@ -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;
Expand All @@ -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;
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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. This might need to get changed in the spec instead, if we can't figure out a way to not have client APIs break on this.


<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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason a backwards compat shim for the old name was not added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created #30202

<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 @@ -6365,7 +6365,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 @@ -6386,7 +6386,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 @@ -6408,7 +6408,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
Loading