diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp index 8dca2eac469d49..cff2cebbffe20e 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp @@ -131,7 +131,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } - case 0x050A: // Content Launch Cluster + case 0x050A: // Content Launcher Cluster { uint16_t entryOffset = kSizeLengthInBytes; switch (am->attributeId) @@ -787,7 +787,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; - case 0x050A: // Content Launch Cluster + case 0x050A: // Content Launcher Cluster switch (attributeId) { case 0x0000: // accepts header list diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index e263ef31d431e3..654ac901e49896 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -60,7 +60,7 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) emberAfColorControlClusterInitCallback(endpoint); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: - emberAfContentLaunchClusterInitCallback(endpoint); + emberAfContentLauncherClusterInitCallback(endpoint); break; case ZCL_DESCRIPTOR_CLUSTER_ID: emberAfDescriptorClusterInitCallback(endpoint); @@ -220,7 +220,7 @@ void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId end // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfContentLaunchClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index 71c7e836e03030..f1f52b30aada13 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -120,13 +120,13 @@ void emberAfBridgedDeviceBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfColorControlClusterInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Init +/** @brief Content Launcher Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterInitCallback(chip::EndpointId endpoint); /** @brief Descriptor Cluster Init * @@ -1102,27 +1102,27 @@ EmberAfStatus emberAfColorControlClusterServerPreAttributeChangedCallback(chip:: void emberAfColorControlClusterServerTickCallback(chip::EndpointId endpoint); // -// Content Launch Cluster server +// Content Launcher Cluster server // -/** @brief Content Launch Cluster Server Init +/** @brief Content Launcher Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Server Attribute Changed +/** @brief Content Launcher Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfContentLauncherClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Content Launch Cluster Server Manufacturer Specific Attribute Changed +/** @brief Content Launcher Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -1130,11 +1130,11 @@ void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfContentLauncherClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Content Launch Cluster Server Message Sent +/** @brief Content Launcher Cluster Server Message Sent * * Server Message Sent * @@ -1145,11 +1145,11 @@ void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfContentLauncherClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Content Launch Cluster Server Pre Attribute Changed +/** @brief Content Launcher Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -1159,17 +1159,18 @@ void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSen * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfContentLaunchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint16_t size, - uint8_t * value); +EmberAfStatus emberAfContentLauncherClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); -/** @brief Content Launch Cluster Server Tick +/** @brief Content Launcher Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfContentLaunchClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterServerTickCallback(chip::EndpointId endpoint); // // Descriptor Cluster server diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index eda7550336f347..d20a5b38742a96 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -689,7 +689,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Content Launch (server), big-endian */ \ + /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ /* 6928 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1498,7 +1498,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Content Launch (server), little-endian */ \ + /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ /* 6928 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -2049,7 +2049,7 @@ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 1, Cluster: Content Launch (server) */ \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6928) }, /* accepts header list */ \ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7182) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ @@ -2305,7 +2305,7 @@ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ 0x050A, ZAP_ATTRIBUTE_INDEX(275), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Content Launch (server) */ \ + }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ 0x050B, ZAP_ATTRIBUTE_INDEX(278), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ @@ -2631,7 +2631,7 @@ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ \ - /* Endpoint: 1, Cluster: Content Launch (server) */ \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h index a306fe23f6605f..40a635361465ac 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h @@ -131,10 +131,10 @@ #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV -// Use this macro to check if the server side of the Content Launch cluster is included +// Use this macro to check if the server side of the Content Launcher cluster is included #define ZCL_USING_CONTENT_LAUNCH_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCH_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCH +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_SERVER +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER // Use this macro to check if the server side of the Descriptor cluster is included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index 257fd23adc6ee0..1728188699923e 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -138,17 +138,17 @@ static void OnApplicationLauncherClusterLaunchAppResponse(void * context, uint8_ command->SetCommandExitStatus(true); } -static void OnContentLaunchClusterLaunchContentResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus) +static void OnContentLauncherClusterLaunchContentResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus) { - ChipLogProgress(chipTool, "ContentLaunchClusterLaunchContentResponse"); + ChipLogProgress(chipTool, "ContentLauncherClusterLaunchContentResponse"); ModelCommand * command = reinterpret_cast(context); command->SetCommandExitStatus(true); } -static void OnContentLaunchClusterLaunchURLResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus) +static void OnContentLauncherClusterLaunchURLResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus) { - ChipLogProgress(chipTool, "ContentLaunchClusterLaunchURLResponse"); + ChipLogProgress(chipTool, "ContentLauncherClusterLaunchURLResponse"); ModelCommand * command = reinterpret_cast(context); command->SetCommandExitStatus(true); @@ -721,9 +721,9 @@ static void OnAudioOutputAudioOutputListListAttributeResponse(void * context, ui command->SetCommandExitStatus(true); } -static void OnContentLaunchAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries) +static void OnContentLauncherAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries) { - ChipLogProgress(chipTool, "OnContentLaunchAcceptsHeaderListListAttributeResponse: %" PRIu16 " entries", count); + ChipLogProgress(chipTool, "OnContentLauncherAcceptsHeaderListListAttributeResponse: %" PRIu16 " entries", count); for (uint16_t i = 0; i < count; i++) { @@ -734,9 +734,9 @@ static void OnContentLaunchAcceptsHeaderListListAttributeResponse(void * context command->SetCommandExitStatus(true); } -static void OnContentLaunchSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries) +static void OnContentLauncherSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries) { - ChipLogProgress(chipTool, "OnContentLaunchSupportedStreamingTypesListAttributeResponse: %" PRIu16 " entries", count); + ChipLogProgress(chipTool, "OnContentLauncherSupportedStreamingTypesListAttributeResponse: %" PRIu16 " entries", count); for (uint16_t i = 0; i < count; i++) { @@ -1099,7 +1099,7 @@ static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeRespon | Binding | 0xF000 | | BridgedDeviceBasic | 0x0039 | | ColorControl | 0x0300 | -| ContentLaunch | 0x050A | +| ContentLauncher | 0x050A | | Descriptor | 0x001D | | DoorLock | 0x0101 | | EthernetNetworkDiagnostics | 0x0037 | @@ -1143,7 +1143,7 @@ constexpr chip::ClusterId kBinaryInputBasicClusterId = 0x000F; constexpr chip::ClusterId kBindingClusterId = 0xF000; constexpr chip::ClusterId kBridgedDeviceBasicClusterId = 0x0039; constexpr chip::ClusterId kColorControlClusterId = 0x0300; -constexpr chip::ClusterId kContentLaunchClusterId = 0x050A; +constexpr chip::ClusterId kContentLauncherClusterId = 0x050A; constexpr chip::ClusterId kDescriptorClusterId = 0x001D; constexpr chip::ClusterId kDoorLockClusterId = 0x0101; constexpr chip::ClusterId kEthernetNetworkDiagnosticsClusterId = 0x0037; @@ -1329,6 +1329,7 @@ class ReadAccountLoginClusterRevision : public ModelCommand | Cluster ApplicationBasic | 0x050D | |------------------------------------------------------------------------------| | Commands: | | +| * ChangeStatus | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * VendorName | 0x0000 | @@ -1341,6 +1342,40 @@ class ReadAccountLoginClusterRevision : public ModelCommand | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ +/* + * Command ChangeStatus + */ +class ApplicationBasicChangeStatus : public ModelCommand +{ +public: + ApplicationBasicChangeStatus() : ModelCommand("change-status") + { + AddArgument("status", 0, UINT8_MAX, &mStatus); + ModelCommand::AddArguments(); + } + ~ApplicationBasicChangeStatus() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ChangeStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStatus); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mStatus; +}; + /* * Discover Attributes */ @@ -7241,7 +7276,7 @@ class ReadColorControlClusterRevision : public ModelCommand }; /*----------------------------------------------------------------------------*\ -| Cluster ContentLaunch | 0x050A | +| Cluster ContentLauncher | 0x050A | |------------------------------------------------------------------------------| | Commands: | | | * LaunchContent | 0x00 | @@ -7256,16 +7291,16 @@ class ReadColorControlClusterRevision : public ModelCommand /* * Command LaunchContent */ -class ContentLaunchLaunchContent : public ModelCommand +class ContentLauncherLaunchContent : public ModelCommand { public: - ContentLaunchLaunchContent() : ModelCommand("launch-content") + ContentLauncherLaunchContent() : ModelCommand("launch-content") { AddArgument("autoPlay", 0, UINT8_MAX, &mAutoPlay); AddArgument("data", &mData); ModelCommand::AddArguments(); } - ~ContentLaunchLaunchContent() + ~ContentLauncherLaunchContent() { delete onSuccessCallback; delete onFailureCallback; @@ -7275,16 +7310,16 @@ class ContentLaunchLaunchContent : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.LaunchContent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mAutoPlay, chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData))); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnContentLaunchClusterLaunchContentResponse, - this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnContentLauncherClusterLaunchContentResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); uint8_t mAutoPlay; @@ -7294,16 +7329,16 @@ class ContentLaunchLaunchContent : public ModelCommand /* * Command LaunchURL */ -class ContentLaunchLaunchURL : public ModelCommand +class ContentLauncherLaunchURL : public ModelCommand { public: - ContentLaunchLaunchURL() : ModelCommand("launch-url") + ContentLauncherLaunchURL() : ModelCommand("launch-url") { AddArgument("contentURL", &mContentURL); AddArgument("displayString", &mDisplayString); ModelCommand::AddArguments(); } - ~ContentLaunchLaunchURL() + ~ContentLauncherLaunchURL() { delete onSuccessCallback; delete onFailureCallback; @@ -7313,7 +7348,7 @@ class ContentLaunchLaunchURL : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.LaunchURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), chip::ByteSpan(chip::Uint8::from_char(mContentURL), strlen(mContentURL)), @@ -7321,8 +7356,9 @@ class ContentLaunchLaunchURL : public ModelCommand } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnContentLaunchClusterLaunchURLResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnContentLauncherClusterLaunchURLResponse, + this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); char * mContentURL; @@ -7332,12 +7368,12 @@ class ContentLaunchLaunchURL : public ModelCommand /* * Discover Attributes */ -class DiscoverContentLaunchAttributes : public ModelCommand +class DiscoverContentLauncherAttributes : public ModelCommand { public: - DiscoverContentLaunchAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + DiscoverContentLauncherAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } - ~DiscoverContentLaunchAttributes() + ~DiscoverContentLauncherAttributes() { delete onSuccessCallback; delete onFailureCallback; @@ -7347,7 +7383,7 @@ class DiscoverContentLaunchAttributes : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -7362,16 +7398,16 @@ class DiscoverContentLaunchAttributes : public ModelCommand /* * Attribute AcceptsHeaderList */ -class ReadContentLaunchAcceptsHeaderList : public ModelCommand +class ReadContentLauncherAcceptsHeaderList : public ModelCommand { public: - ReadContentLaunchAcceptsHeaderList() : ModelCommand("read") + ReadContentLauncherAcceptsHeaderList() : ModelCommand("read") { AddArgument("attr-name", "accepts-header-list"); ModelCommand::AddArguments(); } - ~ReadContentLaunchAcceptsHeaderList() + ~ReadContentLauncherAcceptsHeaderList() { delete onSuccessCallback; delete onFailureCallback; @@ -7381,15 +7417,15 @@ class ReadContentLaunchAcceptsHeaderList : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeAcceptsHeaderList(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnContentLaunchAcceptsHeaderListListAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnContentLauncherAcceptsHeaderListListAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; @@ -7397,16 +7433,16 @@ class ReadContentLaunchAcceptsHeaderList : public ModelCommand /* * Attribute SupportedStreamingTypes */ -class ReadContentLaunchSupportedStreamingTypes : public ModelCommand +class ReadContentLauncherSupportedStreamingTypes : public ModelCommand { public: - ReadContentLaunchSupportedStreamingTypes() : ModelCommand("read") + ReadContentLauncherSupportedStreamingTypes() : ModelCommand("read") { AddArgument("attr-name", "supported-streaming-types"); ModelCommand::AddArguments(); } - ~ReadContentLaunchSupportedStreamingTypes() + ~ReadContentLauncherSupportedStreamingTypes() { delete onSuccessCallback; delete onFailureCallback; @@ -7416,15 +7452,15 @@ class ReadContentLaunchSupportedStreamingTypes : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeSupportedStreamingTypes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnContentLaunchSupportedStreamingTypesListAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnContentLauncherSupportedStreamingTypesListAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; @@ -7432,16 +7468,16 @@ class ReadContentLaunchSupportedStreamingTypes : public ModelCommand /* * Attribute ClusterRevision */ -class ReadContentLaunchClusterRevision : public ModelCommand +class ReadContentLauncherClusterRevision : public ModelCommand { public: - ReadContentLaunchClusterRevision() : ModelCommand("read") + ReadContentLauncherClusterRevision() : ModelCommand("read") { AddArgument("attr-name", "cluster-revision"); ModelCommand::AddArguments(); } - ~ReadContentLaunchClusterRevision() + ~ReadContentLauncherClusterRevision() { delete onSuccessCallback; delete onFailureCallback; @@ -7451,7 +7487,7 @@ class ReadContentLaunchClusterRevision : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -20464,11 +20500,11 @@ void registerClusterApplicationBasic(Commands & commands) const char * clusterName = "ApplicationBasic"; commands_list clusterCommands = { - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), }; commands.Register(clusterName, clusterCommands); @@ -20681,17 +20717,17 @@ void registerClusterColorControl(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterContentLaunch(Commands & commands) +void registerClusterContentLauncher(Commands & commands) { - const char * clusterName = "ContentLaunch"; + const char * clusterName = "ContentLauncher"; commands_list clusterCommands = { - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands); @@ -21302,7 +21338,7 @@ void registerClusters(Commands & commands) registerClusterBinding(commands); registerClusterBridgedDeviceBasic(commands); registerClusterColorControl(commands); - registerClusterContentLaunch(commands); + registerClusterContentLauncher(commands); registerClusterDescriptor(commands); registerClusterDoorLock(commands); registerClusterEthernetNetworkDiagnostics(commands); diff --git a/examples/chip-tool/gen/IMClusterCommandHandler.cpp b/examples/chip-tool/gen/IMClusterCommandHandler.cpp index 82b295076c09c6..b1504c18959d73 100644 --- a/examples/chip-tool/gen/IMClusterCommandHandler.cpp +++ b/examples/chip-tool/gen/IMClusterCommandHandler.cpp @@ -336,8 +336,8 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfContentLaunchClusterLaunchContentResponseCallback(apCommandObj, const_cast(data), - contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchContentResponseCallback(apCommandObj, const_cast(data), + contentLaunchStatus); } break; } @@ -401,8 +401,8 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfContentLaunchClusterLaunchURLResponseCallback(apCommandObj, const_cast(data), - contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchURLResponseCallback(apCommandObj, const_cast(data), + contentLaunchStatus); } break; } diff --git a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp index 4b6ef59a1d0773..bd4b598e34dafe 100644 --- a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp +++ b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp @@ -17,11 +17,12 @@ */ #include "ApplicationBasicManager.h" - +#include #include #include #include #include +#include #include #include @@ -144,3 +145,19 @@ Application ApplicationBasicManager::getApplicationForEndpoint(chip::EndpointId return app; } + +bool ApplicationBasicManager::proxyChangeApplicationStatusRequest(EmberAfApplicationBasicStatus status, chip::EndpointId endpoint) +{ + // TODO: Insert code here + ChipLogProgress(Zcl, "Sent an application status change request %d for endpoint %d", status, endpoint); + return true; +} + +bool emberAfApplicationBasicClusterChangeStatusCallback(chip::app::Command * commandObj, uint8_t newApplicationStatus) +{ + bool success = ApplicationBasicManager().proxyChangeApplicationStatusRequest( + static_cast(newApplicationStatus), emberAfCurrentEndpoint()); + EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + emberAfSendImmediateDefaultResponse(status); + return true; +} diff --git a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h index 177cde404928c9..61131fa70492fe 100644 --- a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h +++ b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h @@ -30,6 +30,7 @@ class ApplicationBasicManager public: CHIP_ERROR Init(); void store(chip::EndpointId endpoint, Application * application); + bool proxyChangeApplicationStatusRequest(EmberAfApplicationBasicStatus status, chip::EndpointId endpoint); Application getApplicationForEndpoint(chip::EndpointId endpoint); static ApplicationBasicManager & GetInstance() diff --git a/examples/tv-app/linux/include/cluster-init.cpp b/examples/tv-app/linux/include/cluster-init.cpp index d523a5bbccd059..b1fba37f29bad1 100644 --- a/examples/tv-app/linux/include/cluster-init.cpp +++ b/examples/tv-app/linux/include/cluster-init.cpp @@ -136,7 +136,7 @@ void emberAfAudioOutputClusterInitCallback(EndpointId endpoint) * @param endpoint Ver.: always * */ -void emberAfContentLaunchClusterInitCallback(EndpointId endpoint) +void emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { ClusterManager().writeListAttribute(endpoint, ZCL_CONTENT_LAUNCH_CLUSTER_ID, ZCL_CONTENT_LAUNCHER_ACCEPTS_HEADER_ATTRIBUTE_ID, ContentLauncherManager().proxyGetAcceptsHeader()); diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index e6ac472d9eb0c0..f4ce8700ef7423 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -102,7 +102,7 @@ static void sendResponse(const char * responseName, ContentLaunchResponse launch } } -bool emberAfContentLaunchClusterLaunchContentCallback(chip::app::Command * command, unsigned char autoplay, unsigned char * data) +bool emberAfContentLauncherClusterLaunchContentCallback(chip::app::Command * command, unsigned char autoplay, unsigned char * data) { string dataString(reinterpret_cast(data)); @@ -112,8 +112,8 @@ bool emberAfContentLaunchClusterLaunchContentCallback(chip::app::Command * comma return true; } -bool emberAfContentLaunchClusterLaunchURLCallback(chip::app::Command * command, unsigned char * contentUrl, - unsigned char * displayString) +bool emberAfContentLauncherClusterLaunchURLCallback(chip::app::Command * command, unsigned char * contentUrl, + unsigned char * displayString) { string contentUrlString(reinterpret_cast(contentUrl)); string displayStringString(reinterpret_cast(displayString)); diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index ddf1211e6db2a2..6affc427227841 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -38,6 +38,114 @@ namespace app { namespace clusters { +namespace ApplicationBasic { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandId) + { + case ZCL_CHANGE_STATUS_COMMAND_ID: { + expectArgumentCount = 1; + uint8_t status; + bool argExists[1]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 1) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(status); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfApplicationBasicClusterChangeStatusCallback(apCommandObj, status); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_APPLICATION_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, + Protocols::InteractionModel::ProtocolCode::UnsupportedCommand); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_APPLICATION_BASIC_CLUSTER_ID); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_APPLICATION_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 + ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + } +} + +} // namespace ApplicationBasic + namespace AudioOutput { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) @@ -3006,6 +3114,9 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { + case ZCL_APPLICATION_BASIC_CLUSTER_ID: + clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; case ZCL_AUDIO_OUTPUT_CLUSTER_ID: clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; diff --git a/examples/tv-app/tv-common/gen/attribute-size.cpp b/examples/tv-app/tv-common/gen/attribute-size.cpp index 2932287eb9fe09..1a8c6cc4d78fd3 100644 --- a/examples/tv-app/tv-common/gen/attribute-size.cpp +++ b/examples/tv-app/tv-common/gen/attribute-size.cpp @@ -131,7 +131,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } - case 0x050A: // Content Launch Cluster + case 0x050A: // Content Launcher Cluster { uint16_t entryOffset = kSizeLengthInBytes; switch (am->attributeId) @@ -684,7 +684,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; - case 0x050A: // Content Launch Cluster + case 0x050A: // Content Launcher Cluster switch (attributeId) { case 0x0000: // accepts header list diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index 901a986a124176..1a29aa01a1bd30 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -48,7 +48,7 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) emberAfBindingClusterInitCallback(endpoint); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: - emberAfContentLaunchClusterInitCallback(endpoint); + emberAfContentLauncherClusterInitCallback(endpoint); break; case ZCL_DESCRIPTOR_CLUSTER_ID: emberAfDescriptorClusterInitCallback(endpoint); @@ -149,7 +149,7 @@ void __attribute__((weak)) emberAfBindingClusterInitCallback(EndpointId endpoint // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfContentLaunchClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index b685efb19f1afd..57d5b4dd21526e 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -88,13 +88,13 @@ void emberAfBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfBindingClusterInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Init +/** @brief Content Launcher Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterInitCallback(chip::EndpointId endpoint); /** @brief Descriptor Cluster Init * @@ -684,27 +684,27 @@ EmberAfStatus emberAfBindingClusterServerPreAttributeChangedCallback(chip::Endpo void emberAfBindingClusterServerTickCallback(chip::EndpointId endpoint); // -// Content Launch Cluster server +// Content Launcher Cluster server // -/** @brief Content Launch Cluster Server Init +/** @brief Content Launcher Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Server Attribute Changed +/** @brief Content Launcher Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfContentLauncherClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Content Launch Cluster Server Manufacturer Specific Attribute Changed +/** @brief Content Launcher Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -712,11 +712,11 @@ void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfContentLauncherClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Content Launch Cluster Server Message Sent +/** @brief Content Launcher Cluster Server Message Sent * * Server Message Sent * @@ -727,11 +727,11 @@ void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfContentLauncherClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Content Launch Cluster Server Pre Attribute Changed +/** @brief Content Launcher Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -741,17 +741,18 @@ void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSen * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfContentLaunchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint16_t size, - uint8_t * value); +EmberAfStatus emberAfContentLauncherClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); -/** @brief Content Launch Cluster Server Tick +/** @brief Content Launcher Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfContentLaunchClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterServerTickCallback(chip::EndpointId endpoint); // // Descriptor Cluster server @@ -2230,6 +2231,12 @@ void emberAfWiFiNetworkDiagnosticsClusterServerTickCallback(chip::EndpointId end // Cluster Commands Callback +/** + * @brief Application Basic Cluster ChangeStatus Command callback + */ + +bool emberAfApplicationBasicClusterChangeStatusCallback(chip::app::Command * commandObj, uint8_t status); + /** * @brief Audio Output Cluster RenameOutput Command callback */ diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h index 40090bb7048c4c..cf5087714cb78a 100644 --- a/examples/tv-app/tv-common/gen/endpoint_config.h +++ b/examples/tv-app/tv-common/gen/endpoint_config.h @@ -503,7 +503,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Content Launch (server), big-endian */ \ + /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ /* 4544 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -596,7 +596,7 @@ /* 5608 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 3, Cluster: Content Launch (server), big-endian */ \ + /* Endpoint: 3, Cluster: Content Launcher (server), big-endian */ \ \ /* 5616 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -644,7 +644,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 4, Cluster: Content Launch (server), big-endian */ \ + /* Endpoint: 4, Cluster: Content Launcher (server), big-endian */ \ \ /* 6220 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1187,7 +1187,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Content Launch (server), little-endian */ \ + /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ /* 4544 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1280,7 +1280,7 @@ /* 5608 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 3, Cluster: Content Launch (server), little-endian */ \ + /* Endpoint: 3, Cluster: Content Launcher (server), little-endian */ \ \ /* 5616 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1328,7 +1328,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 4, Cluster: Content Launch (server), little-endian */ \ + /* Endpoint: 4, Cluster: Content Launcher (server), little-endian */ \ \ /* 6220 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1605,7 +1605,7 @@ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 1, Cluster: Content Launch (server) */ \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4544) }, /* accepts header list */ \ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4798) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ @@ -1638,7 +1638,7 @@ { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5608) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 3, Cluster: Content Launch (server) */ \ + /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5616) }, /* accepts header list */ \ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5870) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ @@ -1656,7 +1656,7 @@ /* Endpoint: 3, Cluster: Account Login (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 4, Cluster: Content Launch (server) */ \ + /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6220) }, /* accepts header list */ \ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6474) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ @@ -1772,7 +1772,7 @@ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ 0x050A, ZAP_ATTRIBUTE_INDEX(130), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Content Launch (server) */ \ + }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ 0x050C, ZAP_ATTRIBUTE_INDEX(133), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ @@ -1796,7 +1796,7 @@ }, /* Endpoint: 3, Cluster: Media Playback (server) */ \ { \ 0x050A, ZAP_ATTRIBUTE_INDEX(151), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Content Launch (server) */ \ + }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { \ 0x050D, ZAP_ATTRIBUTE_INDEX(154), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ @@ -1805,7 +1805,7 @@ }, /* Endpoint: 3, Cluster: Account Login (server) */ \ { \ 0x050A, ZAP_ATTRIBUTE_INDEX(163), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 4, Cluster: Content Launch (server) */ \ + }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { \ 0x050D, ZAP_ATTRIBUTE_INDEX(166), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ @@ -1874,7 +1874,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (115) +#define EMBER_AF_GENERATED_COMMAND_COUNT (116) #define GENERATED_COMMANDS \ { \ \ @@ -1970,7 +1970,7 @@ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ \ - /* Endpoint: 1, Cluster: Content Launch (server) */ \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ @@ -2023,18 +2023,21 @@ { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipSeek */ \ { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipSeekResponse */ \ \ - /* Endpoint: 3, Cluster: Content Launch (server) */ \ + /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ \ + /* Endpoint: 3, Cluster: Application Basic (server) */ \ + { 0x050D, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeStatus */ \ + \ /* Endpoint: 3, Cluster: Account Login (server) */ \ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ \ - /* Endpoint: 4, Cluster: Content Launch (server) */ \ + /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ diff --git a/examples/tv-app/tv-common/gen/gen_config.h b/examples/tv-app/tv-common/gen/gen_config.h index 1ccf3d7131412c..2978fa01dbcea5 100644 --- a/examples/tv-app/tv-common/gen/gen_config.h +++ b/examples/tv-app/tv-common/gen/gen_config.h @@ -90,10 +90,10 @@ #define EMBER_AF_PLUGIN_BINDING_SERVER #define EMBER_AF_PLUGIN_BINDING -// Use this macro to check if the server side of the Content Launch cluster is included +// Use this macro to check if the server side of the Content Launcher cluster is included #define ZCL_USING_CONTENT_LAUNCH_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCH_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCH +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_SERVER +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER // Use this macro to check if the server side of the Descriptor cluster is included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 21c19192796158..5685c9c0959665 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 35, + "featureLevel": 39, "creator": "zap", "keyValuePairs": [ { @@ -6437,7 +6437,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -6480,7 +6480,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7327,7 +7327,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7370,7 +7370,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7449,7 +7449,16 @@ "define": "APPLICATION_BASIC_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "ChangeStatus", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "cluster revision", @@ -7686,7 +7695,7 @@ "deviceTypeProfileId": 2457, "clusters": [ { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7729,7 +7738,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 427b157340a2ca..e1b4679f0d9687 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -41,14 +41,14 @@ #include #include -bool emberAfContentLaunchClusterLaunchContentCallback(chip::app::Command * commandObj) +bool emberAfContentLauncherClusterLaunchContentCallback(chip::app::Command * commandObj) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfContentLaunchClusterLaunchURLCallback(chip::app::Command * commandObj) +bool emberAfContentLauncherClusterLaunchURLCallback(chip::app::Command * commandObj) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; emberAfSendImmediateDefaultResponse(status); diff --git a/src/app/common/gen/attribute-id.h b/src/app/common/gen/attribute-id.h index 7149700f424996..6e820f97c1fd63 100644 --- a/src/app/common/gen/attribute-id.h +++ b/src/app/common/gen/attribute-id.h @@ -1350,7 +1350,7 @@ // Server attributes -// Attribute ids for cluster: Content Launch +// Attribute ids for cluster: Content Launcher // Client attributes diff --git a/src/app/common/gen/client-command-macro.h b/src/app/common/gen/client-command-macro.h index 0dda6e070f3204..14082a486dbea1 100644 --- a/src/app/common/gen/client-command-macro.h +++ b/src/app/common/gen/client-command-macro.h @@ -5856,9 +5856,9 @@ * @param autoPlay BOOLEAN */ #define emberAfFillCommandContent \ - LaunchClusterLaunchContent(autoPlay) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchContent(autoPlay) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_CONTENT_COMMAND_ID, "u", autoPlay); + ZCL_LAUNCH_CONTENT_COMMAND_ID, "u", autoPlay); /** @brief Command description for LaunchContentResponse * @@ -5866,9 +5866,9 @@ * @param data CHAR_STRING */ #define emberAfFillCommandContent \ - LaunchClusterLaunchContentResponse(data) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchContentResponse(data) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_CONTENT_RESPONSE_COMMAND_ID, "u", data); + ZCL_LAUNCH_CONTENT_RESPONSE_COMMAND_ID, "u", data); /** @brief Command description for LaunchContent * @@ -5876,9 +5876,9 @@ * @param data CHAR_STRING */ #define emberAfFillCommandContent \ - LaunchClusterLaunchContent(data) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchContent(data) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_CONTENT_COMMAND_ID, "u", data); + ZCL_LAUNCH_CONTENT_COMMAND_ID, "u", data); /** @brief Command description for LaunchContentResponse * @@ -5886,7 +5886,7 @@ * @param contentLaunchStatus ContentLaunchStatus */ #define emberAfFillCommandContent \ - LaunchClusterLaunchContentResponse(contentLaunchStatus) \ + LauncherClusterLaunchContentResponse(contentLaunchStatus) \ emberAfFillExternalBuffer(mask, \ \ ZCL_LAUNCH_CONTENT_RESPONSE_COMMAND_ID, "u", contentLaunchStatus); @@ -5897,9 +5897,9 @@ * @param contentURL CHAR_STRING */ #define emberAfFillCommandContent \ - LaunchClusterLaunchURL(contentURL) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchURL(contentURL) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_URL_COMMAND_ID, "u", contentURL); + ZCL_LAUNCH_URL_COMMAND_ID, "u", contentURL); /** @brief Command description for LaunchURLResponse * @@ -5907,9 +5907,9 @@ * @param data CHAR_STRING */ #define emberAfFillCommandContent \ - LaunchClusterLaunchURLResponse(data) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchURLResponse(data) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_URL_RESPONSE_COMMAND_ID, "u", data); + ZCL_LAUNCH_URL_RESPONSE_COMMAND_ID, "u", data); /** @brief Command description for LaunchURL * @@ -5917,9 +5917,9 @@ * @param displayString CHAR_STRING */ #define emberAfFillCommandContent \ - LaunchClusterLaunchURL(displayString) emberAfFillExternalBuffer(mask, \ + LauncherClusterLaunchURL(displayString) emberAfFillExternalBuffer(mask, \ \ - ZCL_LAUNCH_URL_COMMAND_ID, "u", displayString); + ZCL_LAUNCH_URL_COMMAND_ID, "u", displayString); /** @brief Command description for LaunchURLResponse * @@ -5927,7 +5927,7 @@ * @param contentLaunchStatus ContentLaunchStatus */ #define emberAfFillCommandContent \ - LaunchClusterLaunchURLResponse(contentLaunchStatus) \ + LauncherClusterLaunchURLResponse(contentLaunchStatus) \ emberAfFillExternalBuffer(mask, \ \ ZCL_LAUNCH_URL_RESPONSE_COMMAND_ID, "u", contentLaunchStatus); @@ -5995,6 +5995,16 @@ \ ZCL_LAUNCH_APP_RESPONSE_COMMAND_ID, "u", data); +/** @brief Command description for ChangeStatus + * + * Command: ChangeStatus + * @param status ApplicationBasicStatus + */ +#define emberAfFillCommandApplication \ + BasicClusterChangeStatus(status) emberAfFillExternalBuffer(mask, \ + \ + ZCL_CHANGE_STATUS_COMMAND_ID, "u", status); + /** @brief Command description for GetSetupPIN * * Command: GetSetupPIN diff --git a/src/app/common/gen/cluster-id.h b/src/app/common/gen/cluster-id.h index e0af15f4c17aab..c94fb889d2acc7 100644 --- a/src/app/common/gen/cluster-id.h +++ b/src/app/common/gen/cluster-id.h @@ -301,7 +301,7 @@ static constexpr chip::ClusterId ZCL_LOW_POWER_CLUSTER_ID = 0x0508; // Definitions for cluster: Keypad Input static constexpr chip::ClusterId ZCL_KEYPAD_INPUT_CLUSTER_ID = 0x0509; -// Definitions for cluster: Content Launch +// Definitions for cluster: Content Launcher static constexpr chip::ClusterId ZCL_CONTENT_LAUNCH_CLUSTER_ID = 0x050A; // Definitions for cluster: Audio Output diff --git a/src/app/common/gen/command-id.h b/src/app/common/gen/command-id.h index 17869ad7e23d61..491fd977877cda 100644 --- a/src/app/common/gen/command-id.h +++ b/src/app/common/gen/command-id.h @@ -476,7 +476,7 @@ #define ZCL_SEND_KEY_COMMAND_ID (0x00) #define ZCL_SEND_KEY_RESPONSE_COMMAND_ID (0x00) -// Commands for cluster: Content Launch +// Commands for cluster: Content Launcher #define ZCL_LAUNCH_CONTENT_COMMAND_ID (0x00) #define ZCL_LAUNCH_CONTENT_RESPONSE_COMMAND_ID (0x00) #define ZCL_LAUNCH_URL_COMMAND_ID (0x01) @@ -490,6 +490,9 @@ #define ZCL_LAUNCH_APP_COMMAND_ID (0x00) #define ZCL_LAUNCH_APP_RESPONSE_COMMAND_ID (0x00) +// Commands for cluster: Application Basic +#define ZCL_CHANGE_STATUS_COMMAND_ID (0x00) + // Commands for cluster: Account Login #define ZCL_GET_SETUP_PIN_COMMAND_ID (0x00) #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) diff --git a/src/app/common/gen/print-cluster.h b/src/app/common/gen/print-cluster.h index 906c5a8121f5a8..0dd077c81b7b48 100644 --- a/src/app/common/gen/print-cluster.h +++ b/src/app/common/gen/print-cluster.h @@ -650,7 +650,7 @@ #endif #if defined(ZCL_USING_CONTENT_LAUNCH_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_LAUNCH_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER { ZCL_CONTENT_LAUNCH_CLUSTER_ID, 1290, "Content Launch" }, +#define CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER { ZCL_CONTENT_LAUNCH_CLUSTER_ID, 1290, "Content Launcher" }, #else #define CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER #endif diff --git a/src/app/zap-templates/zcl/account-login-cluster.xml b/src/app/zap-templates/zcl/account-login-cluster.xml index c668d5d3a4773f..2e76525bb84737 100644 --- a/src/app/zap-templates/zcl/account-login-cluster.xml +++ b/src/app/zap-templates/zcl/account-login-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Account Login 0x050e ACCOUNT_LOGIN_CLUSTER diff --git a/src/app/zap-templates/zcl/application-basic-cluster.xml b/src/app/zap-templates/zcl/application-basic-cluster.xml index 6a75b1d1e88eb8..44fd13b3e20a0b 100644 --- a/src/app/zap-templates/zcl/application-basic-cluster.xml +++ b/src/app/zap-templates/zcl/application-basic-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Application Basic 0x050d APPLICATION_BASIC_CLUSTER @@ -31,6 +31,11 @@ limitations under the License. application id catalog vendor id application satus + + + Upon receipt, this SHALL change the running status of the application. + + diff --git a/src/app/zap-templates/zcl/application-launcher-cluster.xml b/src/app/zap-templates/zcl/application-launcher-cluster.xml index 011455c4925de9..2a12dfe6e001ca 100644 --- a/src/app/zap-templates/zcl/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/application-launcher-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Application Launcher 0x050c APPLICATION_LAUNCHER_CLUSTER diff --git a/src/app/zap-templates/zcl/audio-output-cluster.xml b/src/app/zap-templates/zcl/audio-output-cluster.xml index 9e944f6978345b..e9bfe60f4da42e 100644 --- a/src/app/zap-templates/zcl/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/audio-output-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Audio Output 0x050b AUDIO_OUTPUT_CLUSTER diff --git a/src/app/zap-templates/zcl/content-launch-cluster.xml b/src/app/zap-templates/zcl/content-launch-cluster.xml index 6cfe7341674f00..5dc126b62e43e2 100644 --- a/src/app/zap-templates/zcl/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/content-launch-cluster.xml @@ -17,8 +17,8 @@ limitations under the License. - General - Content Launch + Media + Content Launcher 0x050a CONTENT_LAUNCH_CLUSTER true diff --git a/src/app/zap-templates/zcl/keypad-input-cluster.xml b/src/app/zap-templates/zcl/keypad-input-cluster.xml index ad90aa5cf139e1..4127c99ce3954b 100644 --- a/src/app/zap-templates/zcl/keypad-input-cluster.xml +++ b/src/app/zap-templates/zcl/keypad-input-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Keypad Input 0x0509 KEYPAD_INPUT_CLUSTER diff --git a/src/app/zap-templates/zcl/media-input-cluster.xml b/src/app/zap-templates/zcl/media-input-cluster.xml index acbf409c97286c..b3d295eda59e01 100644 --- a/src/app/zap-templates/zcl/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/media-input-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Media Input 0x0507 MEDIA_INPUT_CLUSTER diff --git a/src/app/zap-templates/zcl/media-playback-cluster.xml b/src/app/zap-templates/zcl/media-playback-cluster.xml index 88622ab4e4a1fb..bdb3b2400e64ff 100644 --- a/src/app/zap-templates/zcl/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/media-playback-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Media Playback 0x0506 MEDIA_PLAYBACK_CLUSTER diff --git a/src/app/zap-templates/zcl/target-navigator-cluster.xml b/src/app/zap-templates/zcl/target-navigator-cluster.xml index dad5a2c178451f..70aa60616d2007 100644 --- a/src/app/zap-templates/zcl/target-navigator-cluster.xml +++ b/src/app/zap-templates/zcl/target-navigator-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media Target Navigator 0x0505 TARGET_NAVIGATOR_CLUSTER diff --git a/src/app/zap-templates/zcl/tv-channel-cluster.xml b/src/app/zap-templates/zcl/tv-channel-cluster.xml index aa107adbe93a8f..8a059c76dd41f7 100644 --- a/src/app/zap-templates/zcl/tv-channel-cluster.xml +++ b/src/app/zap-templates/zcl/tv-channel-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - General + Media TV Channel 0x0504 TV_CHANNEL_CLUSTER diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 4372d3e57eb912..5081490f57e4bd 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -7302,7 +7302,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7345,7 +7345,7 @@ ] }, { - "name": "Content Launch", + "name": "Content Launcher", "code": 1290, "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", @@ -7593,7 +7593,16 @@ "define": "APPLICATION_BASIC_CLUSTER", "side": "client", "enabled": 1, - "commands": [], + "commands": [ + { + "name": "ChangeStatus", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], "attributes": [ { "name": "cluster revision", diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index cf5193e3d51280..49752b1f185c40 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -480,8 +480,8 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag message += entryLength; } - Callback::Callback * cb = - Callback::Callback::FromCancelable( + Callback::Callback * cb = + Callback::Callback::FromCancelable( onSuccessCallback); cb->mCall(cb->mContext, count, data); break; @@ -496,8 +496,8 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag message += 1; } - Callback::Callback * cb = - Callback::Callback::FromCancelable( + Callback::Callback * cb = + Callback::Callback::FromCancelable( onSuccessCallback); cb->mCall(cb->mContext, count, data); break; @@ -1441,34 +1441,34 @@ bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(chip::app::Comma return true; } -bool emberAfContentLaunchClusterLaunchContentResponseCallback(chip::app::Command * commandObj, uint8_t * data, - uint8_t contentLaunchStatus) +bool emberAfContentLauncherClusterLaunchContentResponseCallback(chip::app::Command * commandObj, uint8_t * data, + uint8_t contentLaunchStatus) { ChipLogProgress(Zcl, "LaunchContentResponse:"); // Currently the generated code emits `uint8_t *` for CHAR_STRING, it needs to emits chip::ByteSpan // ChipLogProgress(Zcl, " data: %.*s", data.size(), data.data()); ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); - GET_CLUSTER_RESPONSE_CALLBACKS("ContentLaunchClusterLaunchContentResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchContentResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, data, contentLaunchStatus); return true; } -bool emberAfContentLaunchClusterLaunchURLResponseCallback(chip::app::Command * commandObj, uint8_t * data, - uint8_t contentLaunchStatus) +bool emberAfContentLauncherClusterLaunchURLResponseCallback(chip::app::Command * commandObj, uint8_t * data, + uint8_t contentLaunchStatus) { ChipLogProgress(Zcl, "LaunchURLResponse:"); // Currently the generated code emits `uint8_t *` for CHAR_STRING, it needs to emits chip::ByteSpan // ChipLogProgress(Zcl, " data: %.*s", data.size(), data.data()); ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); - GET_CLUSTER_RESPONSE_CALLBACKS("ContentLaunchClusterLaunchURLResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchURLResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, data, contentLaunchStatus); return true; } diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.h b/src/controller/data_model/gen/CHIPClientCallbacks.h index 2714e2ceac64e6..963e578a8ededf 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.h +++ b/src/controller/data_model/gen/CHIPClientCallbacks.h @@ -49,8 +49,8 @@ typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint1 // Cluster Specific Response Callbacks typedef void (*AccountLoginClusterGetSetupPINResponseCallback)(void * context, uint8_t * setupPIN); typedef void (*ApplicationLauncherClusterLaunchAppResponseCallback)(void * context, uint8_t * data); -typedef void (*ContentLaunchClusterLaunchContentResponseCallback)(void * context, uint8_t * data, uint8_t contentLaunchStatus); -typedef void (*ContentLaunchClusterLaunchURLResponseCallback)(void * context, uint8_t * data, uint8_t contentLaunchStatus); +typedef void (*ContentLauncherClusterLaunchContentResponseCallback)(void * context, uint8_t * data, uint8_t contentLaunchStatus); +typedef void (*ContentLauncherClusterLaunchURLResponseCallback)(void * context, uint8_t * data, uint8_t contentLaunchStatus); typedef void (*DoorLockClusterClearAllPinsResponseCallback)(void * context); typedef void (*DoorLockClusterClearAllRfidsResponseCallback)(void * context); typedef void (*DoorLockClusterClearHolidayScheduleResponseCallback)(void * context); @@ -148,8 +148,8 @@ typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, u // List specific responses typedef void (*ApplicationLauncherApplicationLauncherListListAttributeCallback)(void * context, uint16_t count, uint16_t * entries); typedef void (*AudioOutputAudioOutputListListAttributeCallback)(void * context, uint16_t count, _AudioOutputInfo * entries); -typedef void (*ContentLaunchAcceptsHeaderListListAttributeCallback)(void * context, uint16_t count, chip::ByteSpan * entries); -typedef void (*ContentLaunchSupportedStreamingTypesListAttributeCallback)(void * context, uint16_t count, uint8_t * entries); +typedef void (*ContentLauncherAcceptsHeaderListListAttributeCallback)(void * context, uint16_t count, chip::ByteSpan * entries); +typedef void (*ContentLauncherSupportedStreamingTypesListAttributeCallback)(void * context, uint16_t count, uint8_t * entries); typedef void (*DescriptorDeviceListListAttributeCallback)(void * context, uint16_t count, _DeviceType * entries); typedef void (*DescriptorServerListListAttributeCallback)(void * context, uint16_t count, chip::ClusterId * entries); typedef void (*DescriptorClientListListAttributeCallback)(void * context, uint16_t count, chip::ClusterId * entries); diff --git a/src/controller/data_model/gen/CHIPClusters.cpp b/src/controller/data_model/gen/CHIPClusters.cpp index d70d7a19d641aa..9b7042a2670123 100644 --- a/src/controller/data_model/gen/CHIPClusters.cpp +++ b/src/controller/data_model/gen/CHIPClusters.cpp @@ -132,6 +132,47 @@ CHIP_ERROR AccountLoginCluster::ReadAttributeClusterRevision(Callback::Cancelabl } // ApplicationBasic Cluster Commands +CHIP_ERROR ApplicationBasicCluster::ChangeStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t status) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kChangeStatusCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // status: applicationBasicStatus + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), status)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + // ApplicationBasic Cluster Attributes CHIP_ERROR ApplicationBasicCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) @@ -2349,9 +2390,9 @@ CHIP_ERROR ColorControlCluster::ReadAttributeClusterRevision(Callback::Cancelabl return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -// ContentLaunch Cluster Commands -CHIP_ERROR ContentLaunchCluster::LaunchContent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t autoPlay, chip::ByteSpan data) +// ContentLauncher Cluster Commands +CHIP_ERROR ContentLauncherCluster::LaunchContent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t autoPlay, chip::ByteSpan data) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -2393,8 +2434,8 @@ CHIP_ERROR ContentLaunchCluster::LaunchContent(Callback::Cancelable * onSuccessC return err; } -CHIP_ERROR ContentLaunchCluster::LaunchURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan contentURL, chip::ByteSpan displayString) +CHIP_ERROR ContentLauncherCluster::LaunchURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan contentURL, chip::ByteSpan displayString) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -2436,35 +2477,35 @@ CHIP_ERROR ContentLaunchCluster::LaunchURL(Callback::Cancelable * onSuccessCallb return err; } -// ContentLaunch Cluster Attributes -CHIP_ERROR ContentLaunchCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +// ContentLauncher Cluster Attributes +CHIP_ERROR ContentLauncherCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeContentLaunchClusterDiscoverAttributes(seqNum, mEndpoint); + System::PacketBufferHandle encodedCommand = encodeContentLauncherClusterDiscoverAttributes(seqNum, mEndpoint); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -CHIP_ERROR ContentLaunchCluster::ReadAttributeAcceptsHeaderList(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR ContentLauncherCluster::ReadAttributeAcceptsHeaderList(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeContentLaunchClusterReadAcceptsHeaderListAttribute(seqNum, mEndpoint); + System::PacketBufferHandle encodedCommand = encodeContentLauncherClusterReadAcceptsHeaderListAttribute(seqNum, mEndpoint); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -CHIP_ERROR ContentLaunchCluster::ReadAttributeSupportedStreamingTypes(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR ContentLauncherCluster::ReadAttributeSupportedStreamingTypes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeContentLaunchClusterReadSupportedStreamingTypesAttribute(seqNum, mEndpoint); + System::PacketBufferHandle encodedCommand = encodeContentLauncherClusterReadSupportedStreamingTypesAttribute(seqNum, mEndpoint); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -CHIP_ERROR ContentLaunchCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR ContentLauncherCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeContentLaunchClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + System::PacketBufferHandle encodedCommand = encodeContentLauncherClusterReadClusterRevisionAttribute(seqNum, mEndpoint); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } diff --git a/src/controller/data_model/gen/CHIPClusters.h b/src/controller/data_model/gen/CHIPClusters.h index b7e2092239dcfa..c70d89e99c48fd 100644 --- a/src/controller/data_model/gen/CHIPClusters.h +++ b/src/controller/data_model/gen/CHIPClusters.h @@ -37,7 +37,7 @@ constexpr ClusterId kBinaryInputBasicClusterId = 0x000F; constexpr ClusterId kBindingClusterId = 0xF000; constexpr ClusterId kBridgedDeviceBasicClusterId = 0x0039; constexpr ClusterId kColorControlClusterId = 0x0300; -constexpr ClusterId kContentLaunchClusterId = 0x050A; +constexpr ClusterId kContentLauncherClusterId = 0x050A; constexpr ClusterId kDescriptorClusterId = 0x001D; constexpr ClusterId kDoorLockClusterId = 0x0101; constexpr ClusterId kEthernetNetworkDiagnosticsClusterId = 0x0037; @@ -97,6 +97,9 @@ class DLL_EXPORT ApplicationBasicCluster : public ClusterBase ApplicationBasicCluster() : ClusterBase(kApplicationBasicClusterId) {} ~ApplicationBasicCluster() {} + // Cluster Commands + CHIP_ERROR ChangeStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t status); + // Cluster Attributes CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); @@ -107,6 +110,9 @@ class DLL_EXPORT ApplicationBasicCluster : public ClusterBase CHIP_ERROR ReadAttributeCatalogVendorId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeApplicationSatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + +private: + static constexpr CommandId kChangeStatusCommandId = 0x00; }; class DLL_EXPORT ApplicationLauncherCluster : public ClusterBase @@ -452,11 +458,11 @@ class DLL_EXPORT ColorControlCluster : public ClusterBase static constexpr CommandId kStopMoveStepCommandId = 0x47; }; -class DLL_EXPORT ContentLaunchCluster : public ClusterBase +class DLL_EXPORT ContentLauncherCluster : public ClusterBase { public: - ContentLaunchCluster() : ClusterBase(kContentLaunchClusterId) {} - ~ContentLaunchCluster() {} + ContentLauncherCluster() : ClusterBase(kContentLauncherClusterId) {} + ~ContentLauncherCluster() {} // Cluster Commands CHIP_ERROR LaunchContent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t autoPlay, diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp index f2f0bdea10fb1e..72b99e739fa64d 100644 --- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp +++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp @@ -261,7 +261,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace ApplicationLauncher -namespace ContentLaunch { +namespace ContentLauncher { void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { @@ -338,8 +338,8 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfContentLaunchClusterLaunchContentResponseCallback(apCommandObj, const_cast(data), - contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchContentResponseCallback(apCommandObj, const_cast(data), + contentLaunchStatus); } break; } @@ -403,8 +403,8 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfContentLaunchClusterLaunchURLResponseCallback(apCommandObj, const_cast(data), - contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchURLResponseCallback(apCommandObj, const_cast(data), + contentLaunchStatus); } break; } @@ -438,7 +438,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } } -} // namespace ContentLaunch +} // namespace ContentLauncher namespace DoorLock { @@ -5323,7 +5323,7 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: - clusters::ContentLaunch::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + clusters::ContentLauncher::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_DOOR_LOCK_CLUSTER_ID: clusters::DoorLock::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); diff --git a/src/controller/data_model/gen/call-command-handler.cpp b/src/controller/data_model/gen/call-command-handler.cpp index f5d3c3b616c9c8..60e3b26efcabf5 100644 --- a/src/controller/data_model/gen/call-command-handler.cpp +++ b/src/controller/data_model/gen/call-command-handler.cpp @@ -37,7 +37,7 @@ EmberAfStatus emberAfBinaryInputBasicClusterClientCommandParse(EmberAfClusterCom EmberAfStatus emberAfBindingClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfBridgedDeviceBasicClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfColorControlClusterClientCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfContentLaunchClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfContentLauncherClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfDescriptorClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfDoorLockClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfEthernetNetworkDiagnosticsClusterClientCommandParse(EmberAfClusterCommand * cmd); @@ -137,7 +137,7 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: - result = emberAfContentLaunchClusterClientCommandParse(cmd); + result = emberAfContentLauncherClusterClientCommandParse(cmd); break; case ZCL_DESCRIPTOR_CLUSTER_ID: // No commands are enabled for cluster Descriptor @@ -331,7 +331,7 @@ EmberAfStatus emberAfApplicationLauncherClusterClientCommandParse(EmberAfCluster } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfContentLaunchClusterClientCommandParse(EmberAfClusterCommand * cmd) +EmberAfStatus emberAfContentLauncherClusterClientCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -356,7 +356,7 @@ EmberAfStatus emberAfContentLaunchClusterClientCommandParse(EmberAfClusterComman } contentLaunchStatus = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfContentLaunchClusterLaunchContentResponseCallback(nullptr, data, contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchContentResponseCallback(nullptr, data, contentLaunchStatus); break; } case ZCL_LAUNCH_URL_RESPONSE_COMMAND_ID: { @@ -376,7 +376,7 @@ EmberAfStatus emberAfContentLaunchClusterClientCommandParse(EmberAfClusterComman } contentLaunchStatus = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfContentLaunchClusterLaunchURLResponseCallback(nullptr, data, contentLaunchStatus); + wasHandled = emberAfContentLauncherClusterLaunchURLResponseCallback(nullptr, data, contentLaunchStatus); break; } default: { diff --git a/src/controller/data_model/gen/callback-stub.cpp b/src/controller/data_model/gen/callback-stub.cpp index 25e438f13ba77c..9b90d35af0f15f 100644 --- a/src/controller/data_model/gen/callback-stub.cpp +++ b/src/controller/data_model/gen/callback-stub.cpp @@ -60,7 +60,7 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) emberAfColorControlClusterInitCallback(endpoint); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: - emberAfContentLaunchClusterInitCallback(endpoint); + emberAfContentLauncherClusterInitCallback(endpoint); break; case ZCL_DESCRIPTOR_CLUSTER_ID: emberAfDescriptorClusterInitCallback(endpoint); @@ -211,7 +211,7 @@ void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId end // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfContentLaunchClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/src/controller/data_model/gen/callback.h b/src/controller/data_model/gen/callback.h index 3bd07cee5ff3c1..87f9ff158fb5df 100644 --- a/src/controller/data_model/gen/callback.h +++ b/src/controller/data_model/gen/callback.h @@ -120,13 +120,13 @@ void emberAfBridgedDeviceBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfColorControlClusterInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Init +/** @brief Content Launcher Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterInitCallback(chip::EndpointId endpoint); /** @brief Descriptor Cluster Init * @@ -1078,27 +1078,27 @@ EmberAfStatus emberAfColorControlClusterClientPreAttributeChangedCallback(chip:: void emberAfColorControlClusterClientTickCallback(chip::EndpointId endpoint); // -// Content Launch Cluster client +// Content Launcher Cluster client // -/** @brief Content Launch Cluster Client Init +/** @brief Content Launcher Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Client Attribute Changed +/** @brief Content Launcher Cluster Client Attribute Changed * * Client Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfContentLaunchClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfContentLauncherClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Content Launch Cluster Client Manufacturer Specific Attribute Changed +/** @brief Content Launcher Cluster Client Manufacturer Specific Attribute Changed * * Client Manufacturer Specific Attribute Changed * @@ -1106,11 +1106,11 @@ void emberAfContentLaunchClusterClientAttributeChangedCallback(chip::EndpointId * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfContentLaunchClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfContentLauncherClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Content Launch Cluster Client Message Sent +/** @brief Content Launcher Cluster Client Message Sent * * Client Message Sent * @@ -1121,11 +1121,11 @@ void emberAfContentLaunchClusterClientManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfContentLauncherClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Content Launch Cluster Client Pre Attribute Changed +/** @brief Content Launcher Cluster Client Pre Attribute Changed * * client Pre Attribute Changed * @@ -1135,17 +1135,18 @@ void emberAfContentLaunchClusterClientMessageSentCallback(const chip::MessageSen * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfContentLaunchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint16_t size, - uint8_t * value); +EmberAfStatus emberAfContentLauncherClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); -/** @brief Content Launch Cluster Client Tick +/** @brief Content Launcher Cluster Client Tick * * client Tick * * @param endpoint Endpoint that is being served */ -void emberAfContentLaunchClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfContentLauncherClusterClientTickCallback(chip::EndpointId endpoint); // // Descriptor Cluster client @@ -3332,18 +3333,18 @@ bool emberAfAccountLoginClusterGetSetupPINResponseCallback(chip::app::Command * bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(chip::app::Command * commandObj, uint8_t status, uint8_t * data); /** - * @brief Content Launch Cluster LaunchContentResponse Command callback + * @brief Content Launcher Cluster LaunchContentResponse Command callback */ -bool emberAfContentLaunchClusterLaunchContentResponseCallback(chip::app::Command * commandObj, uint8_t * data, - uint8_t contentLaunchStatus); +bool emberAfContentLauncherClusterLaunchContentResponseCallback(chip::app::Command * commandObj, uint8_t * data, + uint8_t contentLaunchStatus); /** - * @brief Content Launch Cluster LaunchURLResponse Command callback + * @brief Content Launcher Cluster LaunchURLResponse Command callback */ -bool emberAfContentLaunchClusterLaunchURLResponseCallback(chip::app::Command * commandObj, uint8_t * data, - uint8_t contentLaunchStatus); +bool emberAfContentLauncherClusterLaunchURLResponseCallback(chip::app::Command * commandObj, uint8_t * data, + uint8_t contentLaunchStatus); /** * @brief Door Lock Cluster ClearAllPinsResponse Command callback diff --git a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h index 210f9fa5135fd9..b40743debf84e2 100644 --- a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h +++ b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h @@ -38,7 +38,7 @@ | Binding | 0xF000 | | BridgedDeviceBasic | 0x0039 | | ColorControl | 0x0300 | -| ContentLaunch | 0x050A | +| ContentLauncher | 0x050A | | Descriptor | 0x001D | | DoorLock | 0x0101 | | EthernetNetworkDiagnostics | 0x0037 | @@ -100,6 +100,7 @@ chip::System::PacketBufferHandle encodeAccountLoginClusterReadClusterRevisionAtt | Cluster ApplicationBasic | 0x050D | |------------------------------------------------------------------------------| | Commands: | | +| * ChangeStatus | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * VendorName | 0x0000 | @@ -1298,7 +1299,7 @@ chip::System::PacketBufferHandle encodeColorControlClusterReadClusterRevisionAtt chip::EndpointId destinationEndpoint); /*----------------------------------------------------------------------------*\ -| Cluster ContentLaunch | 0x050A | +| Cluster ContentLauncher | 0x050A | |------------------------------------------------------------------------------| | Commands: | | | * LaunchContent | 0x00 | @@ -1312,30 +1313,31 @@ chip::System::PacketBufferHandle encodeColorControlClusterReadClusterRevisionAtt /** * @brief - * Encode a Content Launch server discover command into buffer including the APS frame + * Encode a Content Launcher server discover command into buffer including the APS frame */ -chip::System::PacketBufferHandle encodeContentLaunchClusterDiscoverAttributes(uint8_t seqNum, chip::EndpointId destinationEndpoint); +chip::System::PacketBufferHandle encodeContentLauncherClusterDiscoverAttributes(uint8_t seqNum, + chip::EndpointId destinationEndpoint); /** * @brief - * Encode a Content Launch server read command for the accepts header list attribute into buffer including the APS frame + * Encode a Content Launcher server read command for the accepts header list attribute into buffer including the APS frame */ -chip::System::PacketBufferHandle encodeContentLaunchClusterReadAcceptsHeaderListAttribute(uint8_t seqNum, - chip::EndpointId destinationEndpoint); +chip::System::PacketBufferHandle encodeContentLauncherClusterReadAcceptsHeaderListAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); /** * @brief - * Encode a Content Launch server read command for the supported streaming types attribute into buffer including the APS frame + * Encode a Content Launcher server read command for the supported streaming types attribute into buffer including the APS frame */ chip::System::PacketBufferHandle -encodeContentLaunchClusterReadSupportedStreamingTypesAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +encodeContentLauncherClusterReadSupportedStreamingTypesAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); /** * @brief - * Encode a Content Launch server read command for the cluster revision attribute into buffer including the APS frame + * Encode a Content Launcher server read command for the cluster revision attribute into buffer including the APS frame */ -chip::System::PacketBufferHandle encodeContentLaunchClusterReadClusterRevisionAttribute(uint8_t seqNum, - chip::EndpointId destinationEndpoint); +chip::System::PacketBufferHandle encodeContentLauncherClusterReadClusterRevisionAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); /*----------------------------------------------------------------------------*\ | Cluster Descriptor | 0x001D | diff --git a/src/controller/data_model/gen/encoder.cpp b/src/controller/data_model/gen/encoder.cpp index fec6e2752df526..d8dca4d9984e6a 100644 --- a/src/controller/data_model/gen/encoder.cpp +++ b/src/controller/data_model/gen/encoder.cpp @@ -64,7 +64,7 @@ using namespace chip::Encoding::LittleEndian; | Binding | 0xF000 | | BridgedDeviceBasic | 0x0039 | | ColorControl | 0x0300 | -| ContentLaunch | 0x050A | +| ContentLauncher | 0x050A | | Descriptor | 0x001D | | DoorLock | 0x0101 | | EthernetNetworkDiagnostics | 0x0037 | @@ -129,6 +129,7 @@ using namespace chip::Encoding::LittleEndian; #define ZCL_LOGIN_COMMAND_ID (0x01) #define APPLICATION_BASIC_CLUSTER_ID 0x050D +#define ZCL_CHANGE_STATUS_COMMAND_ID (0x00) #define APPLICATION_LAUNCHER_CLUSTER_ID 0x050C #define ZCL_LAUNCH_APP_COMMAND_ID (0x00) @@ -390,6 +391,7 @@ PacketBufferHandle encodeAccountLoginClusterReadClusterRevisionAttribute(uint8_t | Cluster ApplicationBasic | 0x050D | |------------------------------------------------------------------------------| | Commands: | | +| * ChangeStatus | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * VendorName | 0x0000 | @@ -2096,7 +2098,7 @@ PacketBufferHandle encodeColorControlClusterReadClusterRevisionAttribute(uint8_t } /*----------------------------------------------------------------------------*\ -| Cluster ContentLaunch | 0x050A | +| Cluster ContentLauncher | 0x050A | |------------------------------------------------------------------------------| | Commands: | | | * LaunchContent | 0x00 | @@ -2108,9 +2110,9 @@ PacketBufferHandle encodeColorControlClusterReadClusterRevisionAttribute(uint8_t | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -PacketBufferHandle encodeContentLaunchClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeContentLauncherClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("DiscoverContentLaunchAttributes", CONTENT_LAUNCH_CLUSTER_ID); + COMMAND_HEADER("DiscoverContentLauncherAttributes", CONTENT_LAUNCH_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); COMMAND_FOOTER(); } @@ -2118,9 +2120,9 @@ PacketBufferHandle encodeContentLaunchClusterDiscoverAttributes(uint8_t seqNum, /* * Attribute AcceptsHeaderList */ -PacketBufferHandle encodeContentLaunchClusterReadAcceptsHeaderListAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeContentLauncherClusterReadAcceptsHeaderListAttribute(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadContentLaunchAcceptsHeaderList", CONTENT_LAUNCH_CLUSTER_ID); + COMMAND_HEADER("ReadContentLauncherAcceptsHeaderList", CONTENT_LAUNCH_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); COMMAND_FOOTER(); } @@ -2128,9 +2130,9 @@ PacketBufferHandle encodeContentLaunchClusterReadAcceptsHeaderListAttribute(uint /* * Attribute SupportedStreamingTypes */ -PacketBufferHandle encodeContentLaunchClusterReadSupportedStreamingTypesAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeContentLauncherClusterReadSupportedStreamingTypesAttribute(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadContentLaunchSupportedStreamingTypes", CONTENT_LAUNCH_CLUSTER_ID); + COMMAND_HEADER("ReadContentLauncherSupportedStreamingTypes", CONTENT_LAUNCH_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0001); COMMAND_FOOTER(); } @@ -2138,9 +2140,9 @@ PacketBufferHandle encodeContentLaunchClusterReadSupportedStreamingTypesAttribut /* * Attribute ClusterRevision */ -PacketBufferHandle encodeContentLaunchClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeContentLauncherClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadContentLaunchClusterRevision", CONTENT_LAUNCH_CLUSTER_ID); + COMMAND_HEADER("ReadContentLauncherClusterRevision", CONTENT_LAUNCH_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); COMMAND_FOOTER(); } diff --git a/src/controller/data_model/gen/endpoint_config.h b/src/controller/data_model/gen/endpoint_config.h index 73b33b71410794..2b347c39ee1ef2 100644 --- a/src/controller/data_model/gen/endpoint_config.h +++ b/src/controller/data_model/gen/endpoint_config.h @@ -171,7 +171,7 @@ /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 1, Cluster: Content Launch (client) */ \ + /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Audio Output (client) */ \ @@ -298,7 +298,7 @@ }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ 0x050A, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Content Launch (client) */ \ + }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ 0x050B, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ @@ -381,7 +381,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (218) +#define EMBER_AF_GENERATED_COMMAND_COUNT (219) #define GENERATED_COMMANDS \ { \ \ @@ -646,7 +646,7 @@ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SendKey */ \ { 0x0509, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SendKeyResponse */ \ \ - /* Endpoint: 1, Cluster: Content Launch (client) */ \ + /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ @@ -660,6 +660,9 @@ { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchApp */ \ { 0x050C, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchAppResponse */ \ \ + /* Endpoint: 1, Cluster: Application Basic (client) */ \ + { 0x050D, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ChangeStatus */ \ + \ /* Endpoint: 1, Cluster: Account Login (client) */ \ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSetupPIN */ \ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ diff --git a/src/controller/data_model/gen/gen_config.h b/src/controller/data_model/gen/gen_config.h index 114b47f123c03b..4e1b51d50423fa 100644 --- a/src/controller/data_model/gen/gen_config.h +++ b/src/controller/data_model/gen/gen_config.h @@ -114,9 +114,9 @@ #define ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_COLOR_CONTROL_CLIENT -// Use this macro to check if the client side of the Content Launch cluster is included +// Use this macro to check if the client side of the Content Launcher cluster is included #define ZCL_USING_CONTENT_LAUNCH_CLUSTER_CLIENT -#define EMBER_AF_PLUGIN_CONTENT_LAUNCH_CLIENT +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_CLIENT // Use this macro to check if the client side of the Descriptor cluster is included #define ZCL_USING_DESCRIPTOR_CLUSTER_CLIENT diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 06ffe6b5a1e0cc..079daa2cb78bf8 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -78,22 +78,21 @@ static void OnAudioOutputAudioOutputListListAttributeResponse(void * context, ui chip::Callback::Callback gAudioOutputAudioOutputListListAttributeCallback{ OnAudioOutputAudioOutputListListAttributeResponse, nullptr }; -static void OnContentLaunchAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries) +static void OnContentLauncherAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries) { if (gSuccessResponseDelegate != nullptr) gSuccessResponseDelegate(); } -chip::Callback::Callback gContentLaunchAcceptsHeaderListListAttributeCallback{ - OnContentLaunchAcceptsHeaderListListAttributeResponse, nullptr -}; -static void OnContentLaunchSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries) +chip::Callback::Callback + gContentLauncherAcceptsHeaderListListAttributeCallback{ OnContentLauncherAcceptsHeaderListListAttributeResponse, nullptr }; +static void OnContentLauncherSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries) { if (gSuccessResponseDelegate != nullptr) gSuccessResponseDelegate(); } -chip::Callback::Callback - gContentLaunchSupportedStreamingTypesListAttributeCallback{ OnContentLaunchSupportedStreamingTypesListAttributeResponse, - nullptr }; +chip::Callback::Callback + gContentLauncherSupportedStreamingTypesListAttributeCallback{ OnContentLauncherSupportedStreamingTypesListAttributeResponse, + nullptr }; static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries) { if (gSuccessResponseDelegate != nullptr) @@ -322,6 +321,15 @@ CHIP_ERROR chip_ime_ReadAttribute_AccountLogin_ClusterRevision(chip::Controller: // End of Cluster AccountLogin // Cluster ApplicationBasic +CHIP_ERROR chip_ime_AppendCommand_ApplicationBasic_ChangeStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t status) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ChangeStatus(nullptr, nullptr, status); +} + CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_VendorName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) { @@ -1752,59 +1760,59 @@ CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ClusterRevision(chip::Controller: } // End of Cluster ColorControl -// Cluster ContentLaunch +// Cluster ContentLauncher -CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchContent(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, - chip::GroupId, uint8_t autoPlay, const uint8_t * data, - uint32_t data_Len) +CHIP_ERROR chip_ime_AppendCommand_ContentLauncher_LaunchContent(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t autoPlay, const uint8_t * data, + uint32_t data_Len) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.LaunchContent(nullptr, nullptr, autoPlay, chip::ByteSpan(data, data_Len)); } -CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, - chip::GroupId, const uint8_t * contentURL, uint32_t contentURL_Len, - const uint8_t * displayString, uint32_t displayString_Len) +CHIP_ERROR chip_ime_AppendCommand_ContentLauncher_LaunchURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, const uint8_t * contentURL, uint32_t contentURL_Len, + const uint8_t * displayString, uint32_t displayString_Len) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.LaunchURL(nullptr, nullptr, chip::ByteSpan(contentURL, contentURL_Len), chip::ByteSpan(displayString, displayString_Len)); } -CHIP_ERROR chip_ime_ReadAttribute_ContentLaunch_AcceptsHeaderList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, - chip::GroupId /* ZCLgroupId */) +CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, ZCLendpointId); - return cluster.ReadAttributeAcceptsHeaderList(gContentLaunchAcceptsHeaderListListAttributeCallback.Cancel(), + return cluster.ReadAttributeAcceptsHeaderList(gContentLauncherAcceptsHeaderListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); } -CHIP_ERROR chip_ime_ReadAttribute_ContentLaunch_SupportedStreamingTypes(chip::Controller::Device * device, - chip::EndpointId ZCLendpointId, - chip::GroupId /* ZCLgroupId */) +CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, ZCLendpointId); - return cluster.ReadAttributeSupportedStreamingTypes(gContentLaunchSupportedStreamingTypesListAttributeCallback.Cancel(), + return cluster.ReadAttributeSupportedStreamingTypes(gContentLauncherSupportedStreamingTypesListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); } -CHIP_ERROR chip_ime_ReadAttribute_ContentLaunch_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, - chip::GroupId /* ZCLgroupId */) +CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::ContentLaunchCluster cluster; + chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); } -// End of Cluster ContentLaunch +// End of Cluster ContentLauncher // Cluster Descriptor CHIP_ERROR chip_ime_ReadAttribute_Descriptor_DeviceList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 1ce3ead6930ca0..2e162e9fb92e04 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -48,6 +48,9 @@ def ListClusterCommands(self): }, }, "ApplicationBasic": { + "ChangeStatus": { + "status": "int", + }, }, "ApplicationLauncher": { "LaunchApp": { @@ -189,7 +192,7 @@ def ListClusterCommands(self): "optionsOverride": "int", }, }, - "ContentLaunch": { + "ContentLauncher": { "LaunchContent": { "autoPlay": "int", "data": "str", @@ -1141,7 +1144,7 @@ def ListClusterAttributes(self): "type": "int", }, }, - "ContentLaunch": { + "ContentLauncher": { "AcceptsHeaderList": { "attributeId": 0x0000, "type": "bytes", @@ -2021,6 +2024,10 @@ def ClusterAccountLogin_CommandLogin(self, device: ctypes.c_void_p, ZCLendpoint: return self._chipLib.chip_ime_AppendCommand_AccountLogin_Login( device, ZCLendpoint, ZCLgroupid, tempAccountIdentifier, len(tempAccountIdentifier), setupPIN, len(setupPIN) ) + def ClusterApplicationBasic_CommandChangeStatus(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, status: int): + return self._chipLib.chip_ime_AppendCommand_ApplicationBasic_ChangeStatus( + device, ZCLendpoint, ZCLgroupid, status + ) def ClusterApplicationLauncher_CommandLaunchApp(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, data: bytes, catalogVendorId: int, applicationId: bytes): data = data.encode("utf-8") + b'\x00' applicationId = applicationId.encode("utf-8") + b'\x00' @@ -2112,15 +2119,15 @@ def ClusterColorControl_CommandStopMoveStep(self, device: ctypes.c_void_p, ZCLen return self._chipLib.chip_ime_AppendCommand_ColorControl_StopMoveStep( device, ZCLendpoint, ZCLgroupid, optionsMask, optionsOverride ) - def ClusterContentLaunch_CommandLaunchContent(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, autoPlay: int, data: bytes): + def ClusterContentLauncher_CommandLaunchContent(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, autoPlay: int, data: bytes): data = data.encode("utf-8") + b'\x00' - return self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchContent( + return self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchContent( device, ZCLendpoint, ZCLgroupid, autoPlay, data, len(data) ) - def ClusterContentLaunch_CommandLaunchURL(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, contentURL: bytes, displayString: bytes): + def ClusterContentLauncher_CommandLaunchURL(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, contentURL: bytes, displayString: bytes): contentURL = contentURL.encode("utf-8") + b'\x00' displayString = displayString.encode("utf-8") + b'\x00' - return self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchURL( + return self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchURL( device, ZCLendpoint, ZCLgroupid, contentURL, len(contentURL), displayString, len(displayString) ) def ClusterDoorLock_CommandClearAllPins(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): @@ -2857,12 +2864,12 @@ def ClusterColorControl_WriteAttributeStartUpColorTemperatureMireds(self, device return self._chipLib.chip_ime_WriteAttribute_ColorControl_StartUpColorTemperatureMireds(device, ZCLendpoint, ZCLgroupid, value) def ClusterColorControl_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_ColorControl_ClusterRevision(device, ZCLendpoint, ZCLgroupid) - def ClusterContentLaunch_ReadAttributeAcceptsHeaderList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): - return self._chipLib.chip_ime_ReadAttribute_ContentLaunch_AcceptsHeaderList(device, ZCLendpoint, ZCLgroupid) - def ClusterContentLaunch_ReadAttributeSupportedStreamingTypes(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): - return self._chipLib.chip_ime_ReadAttribute_ContentLaunch_SupportedStreamingTypes(device, ZCLendpoint, ZCLgroupid) - def ClusterContentLaunch_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): - return self._chipLib.chip_ime_ReadAttribute_ContentLaunch_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterContentLauncher_ReadAttributeAcceptsHeaderList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList(device, ZCLendpoint, ZCLgroupid) + def ClusterContentLauncher_ReadAttributeSupportedStreamingTypes(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes(device, ZCLendpoint, ZCLgroupid) + def ClusterContentLauncher_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_ContentLauncher_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterDescriptor_ReadAttributeDeviceList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_Descriptor_DeviceList(device, ZCLendpoint, ZCLgroupid) def ClusterDescriptor_ReadAttributeServerList(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): @@ -3322,6 +3329,9 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_AccountLogin_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_AccountLogin_ClusterRevision.restype = ctypes.c_uint32 # Cluster ApplicationBasic + # Cluster ApplicationBasic Command ChangeStatus + self._chipLib.chip_ime_AppendCommand_ApplicationBasic_ChangeStatus.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8] + self._chipLib.chip_ime_AppendCommand_ApplicationBasic_ChangeStatus.restype = ctypes.c_uint32 # Cluster ApplicationBasic ReadAttribute VendorName self._chipLib.chip_ime_ReadAttribute_ApplicationBasic_VendorName.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_ApplicationBasic_VendorName.restype = ctypes.c_uint32 @@ -3792,22 +3802,22 @@ def InitLib(self, chipLib): # Cluster ColorControl ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_ColorControl_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_ColorControl_ClusterRevision.restype = ctypes.c_uint32 - # Cluster ContentLaunch - # Cluster ContentLaunch Command LaunchContent - self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchContent.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32] - self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchContent.restype = ctypes.c_uint32 - # Cluster ContentLaunch Command LaunchURL - self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchURL.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_uint32] - self._chipLib.chip_ime_AppendCommand_ContentLaunch_LaunchURL.restype = ctypes.c_uint32 - # Cluster ContentLaunch ReadAttribute AcceptsHeaderList - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_AcceptsHeaderList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_AcceptsHeaderList.restype = ctypes.c_uint32 - # Cluster ContentLaunch ReadAttribute SupportedStreamingTypes - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_SupportedStreamingTypes.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_SupportedStreamingTypes.restype = ctypes.c_uint32 - # Cluster ContentLaunch ReadAttribute ClusterRevision - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] - self._chipLib.chip_ime_ReadAttribute_ContentLaunch_ClusterRevision.restype = ctypes.c_uint32 + # Cluster ContentLauncher + # Cluster ContentLauncher Command LaunchContent + self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchContent.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32] + self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchContent.restype = ctypes.c_uint32 + # Cluster ContentLauncher Command LaunchURL + self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchURL.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_uint32] + self._chipLib.chip_ime_AppendCommand_ContentLauncher_LaunchURL.restype = ctypes.c_uint32 + # Cluster ContentLauncher ReadAttribute AcceptsHeaderList + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList.restype = ctypes.c_uint32 + # Cluster ContentLauncher ReadAttribute SupportedStreamingTypes + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes.restype = ctypes.c_uint32 + # Cluster ContentLauncher ReadAttribute ClusterRevision + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_ContentLauncher_ClusterRevision.restype = ctypes.c_uint32 # Cluster Descriptor # Cluster Descriptor ReadAttribute DeviceList self._chipLib.chip_ime_ReadAttribute_Descriptor_DeviceList.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 449c2733808773..0dfaa4e3d6d73f 100755 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -254,7 +254,7 @@ class ChipDN * * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise **/ - CHIP_ERROR GetCertChipId(uint64_t & chipId) const; + CHIP_ERROR GetCertChipId(uint64_t & certId) const; bool IsEqual(const ChipDN & other) const; @@ -646,7 +646,7 @@ CHIP_ERROR ConvertX509CertToChipCert(const uint8_t * x509Cert, uint32_t x509Cert * @param x509ICAC Intermediate CA certificate in X.509 DER encoding. * @param chipCertArrayBuf Buffer to store converted certificates in CHIP format. * @param chipCertArrayBufSize The size of the buffer to store converted certificates. - * @param chipCertBufLen[out] The length of the converted certificates. + * @param chipCertBufLen The length of the converted certificates. * * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise **/ diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index 364e6aea95078f..6f3e9fb08fe147 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -61,6 +61,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationBasic : CHIPCluster +- (void)changeStatus:(uint8_t)status responseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; - (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler; - (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler; @@ -397,10 +399,10 @@ NS_ASSUME_NONNULL_BEGIN @end /** - * Cluster Content Launch + * Cluster Content Launcher * */ -@interface CHIPContentLaunch : CHIPCluster +@interface CHIPContentLauncher : CHIPCluster - (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler; - (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 9e853171d19a40..89e0641e5d630c 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -483,22 +483,22 @@ static void CallbackFn(void * context, uint8_t * data) dispatch_queue_t mQueue; }; -class CHIPContentLaunchClusterLaunchContentResponseCallbackBridge - : public Callback::Callback { +class CHIPContentLauncherClusterLaunchContentResponseCallbackBridge + : public Callback::Callback { public: - CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPContentLauncherClusterLaunchContentResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPContentLaunchClusterLaunchContentResponseCallbackBridge() {}; + ~CHIPContentLauncherClusterLaunchContentResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t * data, uint8_t contentLaunchStatus) { - CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPContentLauncherClusterLaunchContentResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -516,22 +516,22 @@ static void CallbackFn(void * context, uint8_t * data, uint8_t contentLaunchStat dispatch_queue_t mQueue; }; -class CHIPContentLaunchClusterLaunchURLResponseCallbackBridge - : public Callback::Callback { +class CHIPContentLauncherClusterLaunchURLResponseCallbackBridge + : public Callback::Callback { public: - CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPContentLauncherClusterLaunchURLResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPContentLaunchClusterLaunchURLResponseCallbackBridge() {}; + ~CHIPContentLauncherClusterLaunchURLResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t * data, uint8_t contentLaunchStatus) { - CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPContentLauncherClusterLaunchURLResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2733,22 +2733,22 @@ static void CallbackFn(void * context, uint16_t count, _AudioOutputInfo * entrie dispatch_queue_t mQueue; }; -class CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge - : public Callback::Callback { +class CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge + : public Callback::Callback { public: - CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge() {}; + ~CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge() {}; static void CallbackFn(void * context, uint16_t count, chip::ByteSpan * entries) { - CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge * callback - = reinterpret_cast(context); + CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { id values[count]; for (uint16_t i = 0; i < count; i++) { @@ -2769,22 +2769,22 @@ static void CallbackFn(void * context, uint16_t count, chip::ByteSpan * entries) dispatch_queue_t mQueue; }; -class CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge - : public Callback::Callback { +class CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge + : public Callback::Callback { public: - CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge() {}; + ~CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge() {}; static void CallbackFn(void * context, uint16_t count, uint8_t * entries) { - CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge * callback - = reinterpret_cast(context); + CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { id values[count]; for (uint16_t i = 0; i < count; i++) { @@ -3742,6 +3742,33 @@ @implementation CHIPApplicationBasic return &_cppCluster; } +- (void)changeStatus:(uint8_t)status responseHandler:(ResponseHandler)responseHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); + if (!onSuccess) { + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ChangeStatus(onSuccess->Cancel(), onFailure->Cancel(), status); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + - (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess @@ -8274,11 +8301,11 @@ - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)respons @end -@interface CHIPContentLaunch () -@property (readonly) Controller::ContentLaunchCluster cppCluster; +@interface CHIPContentLauncher () +@property (readonly) Controller::ContentLauncherCluster cppCluster; @end -@implementation CHIPContentLaunch +@implementation CHIPContentLauncher - (Controller::ClusterBase *)getCluster { @@ -8287,8 +8314,8 @@ @implementation CHIPContentLaunch - (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler { - CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPContentLauncherClusterLaunchContentResponseCallbackBridge * onSuccess + = new CHIPContentLauncherClusterLaunchContentResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -8316,8 +8343,8 @@ - (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(R } - (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler { - CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPContentLauncherClusterLaunchURLResponseCallbackBridge * onSuccess + = new CHIPContentLauncherClusterLaunchURLResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -8348,8 +8375,8 @@ - (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString - (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)responseHandler { - CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge * onSuccess - = new CHIPContentLaunchAcceptsHeaderListAttributeCallbackBridge(responseHandler, [self callbackQueue]); + CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge * onSuccess + = new CHIPContentLauncherAcceptsHeaderListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -8376,8 +8403,8 @@ - (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)respo - (void)readAttributeSupportedStreamingTypesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge * onSuccess - = new CHIPContentLaunchSupportedStreamingTypesAttributeCallbackBridge(responseHandler, [self callbackQueue]); + CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge * onSuccess + = new CHIPContentLauncherSupportedStreamingTypesAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 3aac48dc1bc970..bf0fa4859e0171 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -4629,18 +4629,18 @@ - (void)testSendClusterColorControlReadAttributeClusterRevisionWithResponseHandl [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterContentLaunchReadAttributeAcceptsHeaderListWithResponseHandler +- (void)testSendClusterContentLauncherReadAttributeAcceptsHeaderListWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLaunchReadAttributeAcceptsHeaderListWithResponseHandler"]; + [self expectationWithDescription:@"ContentLauncherReadAttributeAcceptsHeaderListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPContentLaunch * cluster = [[CHIPContentLaunch alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeAcceptsHeaderListWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ContentLaunch AcceptsHeaderList Error: %@", err); + NSLog(@"ContentLauncher AcceptsHeaderList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -4648,18 +4648,18 @@ - (void)testSendClusterContentLaunchReadAttributeAcceptsHeaderListWithResponseHa [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterContentLaunchReadAttributeSupportedStreamingTypesWithResponseHandler +- (void)testSendClusterContentLauncherReadAttributeSupportedStreamingTypesWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLaunchReadAttributeSupportedStreamingTypesWithResponseHandler"]; + [self expectationWithDescription:@"ContentLauncherReadAttributeSupportedStreamingTypesWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPContentLaunch * cluster = [[CHIPContentLaunch alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeSupportedStreamingTypesWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ContentLaunch SupportedStreamingTypes Error: %@", err); + NSLog(@"ContentLauncher SupportedStreamingTypes Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -4667,18 +4667,18 @@ - (void)testSendClusterContentLaunchReadAttributeSupportedStreamingTypesWithResp [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterContentLaunchReadAttributeClusterRevisionWithResponseHandler +- (void)testSendClusterContentLauncherReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLaunchReadAttributeClusterRevisionWithResponseHandler"]; + [self expectationWithDescription:@"ContentLauncherReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPContentLaunch * cluster = [[CHIPContentLaunch alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ContentLaunch ClusterRevision Error: %@", err); + NSLog(@"ContentLauncher ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }];