diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c465f8d350b3b5..630661d8f4cd85 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3583,9 +3583,9 @@ server cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } - struct Application { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute INT16U catalogList[] = 0; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 55c4fc3a4174cc..f78714be1c9ea4 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -19181,7 +19181,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "ApplicationEP", + "type": "ApplicationEPStruct", "included": 0, "storageOption": "External", "singleton": 0, diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 4465d1dd13e8a4..6980d7afb3f3f6 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2928,30 +2928,30 @@ server cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } - struct Application { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; request struct LaunchAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; optional OCTET_STRING data = 1; } request struct StopAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } request struct HideAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } response struct LauncherResponse = 3 { ApplicationLauncherStatusEnum status = 0; - OCTET_STRING data = 1; + optional OCTET_STRING data = 1; } command LaunchApp(LaunchAppRequest): LauncherResponse = 0; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 5d194ad1dc9e01..e82b98e527c6b0 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -18717,7 +18717,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "ApplicationEP", + "type": "ApplicationEPStruct", "included": 0, "storageOption": "External", "singleton": 0, diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h index 073c20c9831eb3..ffdd89ca8731e9 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h @@ -25,7 +25,7 @@ using chip::ByteSpan; using chip::app::AttributeValueEncoder; using chip::app::CommandResponseHelper; using ApplicationLauncherDelegate = chip::app::Clusters::ApplicationLauncher::Delegate; -using ApplicationType = chip::app::Clusters::ApplicationLauncher::Structs::Application::Type; +using ApplicationType = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type; using LauncherResponseType = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type; class ApplicationLauncherManager : public ApplicationLauncherDelegate diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp index b1ef1d11c36a2c..cfc840ce1c83d3 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp @@ -44,8 +44,8 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper(catalogVendorId); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = static_cast(catalogVendorId); const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationId = CharSpan::fromCharString(nativeApplicationId); + application.applicationID = CharSpan::fromCharString(nativeApplicationId); JniByteArray dataByteArray(env, data); TargetEndpointInfo endpoint; @@ -1377,10 +1377,10 @@ JNI_METHOD(jboolean, applicationLauncher_1stopApp) ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_stopApp called"); - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; - application.catalogVendorId = static_cast(catalogVendorId); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = static_cast(catalogVendorId); const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationId = CharSpan::fromCharString(nativeApplicationId); + application.applicationID = CharSpan::fromCharString(nativeApplicationId); TargetEndpointInfo endpoint; CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); @@ -1415,10 +1415,10 @@ JNI_METHOD(jboolean, applicationLauncher_1hideApp) ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_hideApp called"); - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; - application.catalogVendorId = static_cast(catalogVendorId); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = static_cast(catalogVendorId); const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationId = CharSpan::fromCharString(nativeApplicationId); + application.applicationID = CharSpan::fromCharString(nativeApplicationId); TargetEndpointInfo endpoint; CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index 9aa1efac725ca9..72bcb8c9e706ac 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -1493,9 +1493,9 @@ - (void)applicationLauncher_launchApp:(ContentApp * _Nonnull)contentApp [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_launchApp"]; - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; - application.catalogVendorId = catalogVendorId; - application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = catalogVendorId; + application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); dispatch_async(_chipWorkQueue, ^{ TargetEndpointInfo endpoint; @@ -1525,9 +1525,9 @@ - (void)applicationLauncher_stopApp:(ContentApp * _Nonnull)contentApp [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_stopApp"]; - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; - application.catalogVendorId = catalogVendorId; - application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = catalogVendorId; + application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); dispatch_async(_chipWorkQueue, ^{ TargetEndpointInfo endpoint; @@ -1556,9 +1556,9 @@ - (void)applicationLauncher_hideApp:(ContentApp * _Nonnull)contentApp [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_hideApp"]; - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; - application.catalogVendorId = catalogVendorId; - application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; + application.catalogVendorID = catalogVendorId; + application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); dispatch_async(_chipWorkQueue, ^{ TargetEndpointInfo endpoint; diff --git a/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h b/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h index 3444955958b6d2..a6c95c0c699839 100644 --- a/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h +++ b/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h @@ -30,7 +30,7 @@ class LaunchAppCommand public: LaunchAppCommand() : MediaCommandBase(chip::app::Clusters::ApplicationLauncher::Id) {} - CHIP_ERROR Invoke(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + CHIP_ERROR Invoke(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, chip::Optional data, std::function responseCallback); }; @@ -40,7 +40,7 @@ class StopAppCommand : public MediaCommandBase responseCallback); }; @@ -50,7 +50,7 @@ class HideAppCommand : public MediaCommandBase responseCallback); }; diff --git a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h index 979f48bf59348c..fc0c49556c6cd6 100644 --- a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h +++ b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h @@ -246,13 +246,13 @@ class CastingServer * @brief Application Launcher cluster */ CHIP_ERROR ApplicationLauncher_LaunchApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, chip::Optional data, std::function responseCallback); CHIP_ERROR ApplicationLauncher_StopApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback); CHIP_ERROR ApplicationLauncher_HideApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback); CHIP_ERROR diff --git a/examples/tv-casting-app/tv-casting-common/src/ApplicationLauncher.cpp b/examples/tv-casting-app/tv-casting-common/src/ApplicationLauncher.cpp index a218bae336bbf9..cfda9eb165cdc4 100644 --- a/examples/tv-casting-app/tv-casting-common/src/ApplicationLauncher.cpp +++ b/examples/tv-casting-app/tv-casting-common/src/ApplicationLauncher.cpp @@ -21,27 +21,27 @@ using namespace chip; using namespace chip::app::Clusters; -CHIP_ERROR LaunchAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, +CHIP_ERROR LaunchAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, chip::Optional data, std::function responseCallback) { ApplicationLauncher::Commands::LaunchApp::Type request; - request.application = application; - request.data = data; + request.application.SetValue(application); + request.data = data; return MediaCommandBase::Invoke(request, responseCallback); } -CHIP_ERROR StopAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, +CHIP_ERROR StopAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback) { ApplicationLauncher::Commands::StopApp::Type request; - request.application = application; + request.application.SetValue(application); return MediaCommandBase::Invoke(request, responseCallback); } -CHIP_ERROR HideAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, +CHIP_ERROR HideAppCommand::Invoke(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback) { ApplicationLauncher::Commands::HideApp::Type request; - request.application = application; + request.application.SetValue(application); return MediaCommandBase::Invoke(request, responseCallback); } diff --git a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp index de27288bccd190..786a62b86df22c 100644 --- a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp +++ b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp @@ -778,7 +778,7 @@ CHIP_ERROR CastingServer::MediaPlayback_SubscribeToSeekRangeStart( */ CHIP_ERROR CastingServer::ApplicationLauncher_LaunchApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, chip::Optional data, std::function responseCallback) { ReturnErrorOnFailure(mLaunchAppCommand.SetTarget(mActiveTargetVideoPlayerInfo, endpoint->GetEndpointId())); @@ -787,7 +787,7 @@ CastingServer::ApplicationLauncher_LaunchApp(TargetEndpointInfo * endpoint, CHIP_ERROR CastingServer::ApplicationLauncher_StopApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback) { ReturnErrorOnFailure(mStopAppCommand.SetTarget(mActiveTargetVideoPlayerInfo, endpoint->GetEndpointId())); @@ -796,7 +796,7 @@ CastingServer::ApplicationLauncher_StopApp(TargetEndpointInfo * endpoint, CHIP_ERROR CastingServer::ApplicationLauncher_HideApp(TargetEndpointInfo * endpoint, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application, std::function responseCallback) { ReturnErrorOnFailure(mHideAppCommand.SetTarget(mActiveTargetVideoPlayerInfo, endpoint->GetEndpointId())); diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 33e13245f8cc82..313ef0dece7880 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2094,25 +2094,25 @@ client cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } - struct Application { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute INT16U catalogList[] = 0; readonly attribute int16u clusterRevision = 65533; request struct LaunchAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; optional OCTET_STRING data = 1; } request struct StopAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } request struct HideAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } command LaunchApp(LaunchAppRequest): LauncherResponse = 0; diff --git a/src/app/clusters/application-launcher-server/application-launcher-delegate.h b/src/app/clusters/application-launcher-server/application-launcher-delegate.h index fba8a994eef8de..d8b15c4673d4f9 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-delegate.h +++ b/src/app/clusters/application-launcher-server/application-launcher-delegate.h @@ -30,8 +30,8 @@ namespace app { namespace Clusters { namespace ApplicationLauncher { -using Application = chip::app::Clusters::ApplicationLauncher::Structs::Application::Type; -using ApplicationEPType = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type; +using Application = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type; +using ApplicationEPType = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type; using LauncherResponseType = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type; /** @brief diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 775d8a6210b6f8..874ad78d013812 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -133,8 +133,8 @@ CHIP_ERROR Delegate::HandleGetCurrentApp(app::AttributeValueEncoder & aEncoder) { ApplicationEPType currentApp; CatalogVendorApp * vendorApp = app->GetApplicationBasicDelegate()->GetCatalogVendorApp(); - currentApp.application.catalogVendorId = vendorApp->catalogVendorId; - currentApp.application.applicationId = CharSpan(vendorApp->applicationId, strlen(vendorApp->applicationId)); + currentApp.application.catalogVendorID = vendorApp->catalogVendorId; + currentApp.application.applicationID = CharSpan(vendorApp->applicationId, strlen(vendorApp->applicationId)); currentApp.endpoint = Optional(app->GetEndpointId()); return aEncoder.Encode(currentApp); } @@ -224,8 +224,15 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co auto & application = commandData.application; app::CommandResponseHelper responder(command, commandPath); - std::string appId(application.applicationId.data(), application.applicationId.size()); - CatalogVendorApp vendorApp(application.catalogVendorId, appId.c_str()); + // TODO: We should be able to not have an `application` if the AP feature is + // off: https://github.com/project-chip/connectedhomeip/issues/24595 + if (!application.HasValue()) + { + command->AddStatus(commandPath, Protocols::InteractionModel::Status::InvalidCommand); + return true; + } + std::string appId(application.Value().applicationID.data(), application.Value().applicationID.size()); + CatalogVendorApp vendorApp(application.Value().catalogVendorID, appId.c_str()); Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); @@ -245,9 +252,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co { ChipLogError(Zcl, "ApplicationLauncher target app not found"); LauncherResponseType response; - const char * buf = "data"; - response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } @@ -256,7 +261,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co ChipLogError(Zcl, "ApplicationLauncher handling launch on ContentApp"); app->GetApplicationLauncherDelegate()->HandleLaunchApp(responder, data.HasValue() ? data.Value() : ByteSpan(), - application); + application.Value()); return true; } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED @@ -282,16 +287,14 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co { ChipLogError(Zcl, "ApplicationLauncher target app not found"); LauncherResponseType response; - const char * buf = "data"; - response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED ChipLogError(Zcl, "ApplicationLauncher handling launch"); - delegate->HandleLaunchApp(responder, data.HasValue() ? data.Value() : ByteSpan(), application); + delegate->HandleLaunchApp(responder, data.HasValue() ? data.Value() : ByteSpan(), application.Value()); } exit: @@ -315,8 +318,15 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm auto & application = commandData.application; app::CommandResponseHelper responder(command, commandPath); - std::string appId(application.applicationId.data(), application.applicationId.size()); - CatalogVendorApp vendorApp(application.catalogVendorId, appId.c_str()); + // TODO: We should be able to not have an `application` if the AP feature is + // off: https://github.com/project-chip/connectedhomeip/issues/24595 + if (!application.HasValue()) + { + command->AddStatus(commandPath, Protocols::InteractionModel::Status::InvalidCommand); + return true; + } + std::string appId(application.Value().applicationID.data(), application.Value().applicationID.size()); + CatalogVendorApp vendorApp(application.Value().catalogVendorID, appId.c_str()); Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); @@ -336,9 +346,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm { ChipLogError(Zcl, "ApplicationLauncher target app not loaded"); LauncherResponseType response; - const char * buf = "data"; - response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } @@ -349,7 +357,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm app->GetApplicationBasicDelegate()->SetApplicationStatus(ApplicationStatusEnum::kStopped); ChipLogError(Zcl, "ApplicationLauncher handling stop on ContentApp"); - app->GetApplicationLauncherDelegate()->HandleStopApp(responder, application); + app->GetApplicationLauncherDelegate()->HandleStopApp(responder, application.Value()); return true; } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED @@ -375,7 +383,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm appBasic->SetApplicationStatus(ApplicationStatusEnum::kStopped); } - delegate->HandleStopApp(responder, application); + delegate->HandleStopApp(responder, application.Value()); } exit: @@ -399,8 +407,15 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm auto & application = commandData.application; app::CommandResponseHelper responder(command, commandPath); - std::string appId(application.applicationId.data(), application.applicationId.size()); - CatalogVendorApp vendorApp(application.catalogVendorId, appId.c_str()); + // TODO: We should be able to not have an `application` if the AP feature is + // off: https://github.com/project-chip/connectedhomeip/issues/24595 + if (!application.HasValue()) + { + command->AddStatus(commandPath, Protocols::InteractionModel::Status::InvalidCommand); + return true; + } + std::string appId(application.Value().applicationID.data(), application.Value().applicationID.size()); + CatalogVendorApp vendorApp(application.Value().catalogVendorID, appId.c_str()); Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); @@ -420,9 +435,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm { ChipLogError(Zcl, "ApplicationLauncher target app not loaded"); LauncherResponseType response; - const char * buf = "data"; - response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } @@ -430,7 +443,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm ContentAppPlatform::GetInstance().UnsetIfCurrentApp(app); ChipLogError(Zcl, "ApplicationLauncher handling stop on ContentApp"); - app->GetApplicationLauncherDelegate()->HandleHideApp(responder, application); + app->GetApplicationLauncherDelegate()->HandleHideApp(responder, application.Value()); return true; } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED @@ -455,7 +468,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm appBasic->SetApplicationStatus(ApplicationStatusEnum::kActiveHidden); } - delegate->HandleHideApp(responder, application); + delegate->HandleHideApp(responder, application.Value()); } exit: diff --git a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml index 394c8b8c85b274..d32c0e354e504d 100644 --- a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml @@ -44,39 +44,39 @@ tests: command: "launchApp" arguments: values: - - name: "data" + - name: "Data" value: "data" - - name: "application" - value: { catalogVendorId: 123, applicationId: "applicationId" } + - name: "Application" + value: { CatalogVendorID: 123, ApplicationID: "applicationId" } response: values: - - name: "data" + - name: "Data" value: "data" - - name: "status" + - name: "Status" value: 0 - label: "Stop App Command" command: "stopApp" arguments: values: - - name: "application" - value: { catalogVendorId: 123, applicationId: "applicationId" } + - name: "Application" + value: { CatalogVendorID: 123, ApplicationID: "applicationId" } response: values: - - name: "data" + - name: "Data" value: "data" - - name: "status" + - name: "Status" value: 0 - label: "Hide App Command" command: "hideApp" arguments: values: - - name: "application" - value: { catalogVendorId: 123, applicationId: "applicationId" } + - name: "Application" + value: { CatalogVendorID: 123, ApplicationID: "applicationId" } response: values: - - name: "data" + - name: "Data" value: "data" - - name: "status" + - name: "Status" value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml index a8db9508dd8fe9..0f1efeedc26ee4 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml @@ -49,15 +49,15 @@ tests: values: - name: "data" value: "Hello World" - - name: "application" + - name: "Application" value: { - catalogVendorId: catalogVendorId, - applicationId: applicationId, + CatalogVendorID: catalogVendorId, + ApplicationID: applicationId, } response: values: - - name: "status" + - name: "Status" value: 0 - label: diff --git a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_7.yaml b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_7.yaml index 5e18ef884d3c9a..9dc638ce8568ef 100644 --- a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_7.yaml @@ -44,15 +44,15 @@ tests: values: - name: "data" value: "Hello World" - - name: "application" + - name: "Application" value: { - catalogVendorId: catalogVendorId, - applicationId: applicationId, + CatalogVendorID: catalogVendorId, + ApplicationID: applicationId, } response: values: - - name: "status" + - name: "Status" value: 0 - label: @@ -62,15 +62,15 @@ tests: command: "LaunchApp" arguments: values: - - name: "data" + - name: "Data" value: "Hello World" - - name: "application" + - name: "Application" value: { - catalogVendorId: catalogVendorId, - applicationId: "NonAvailableApp", + CatalogVendorID: catalogVendorId, + ApplicationID: "NonAvailableApp", } response: values: - - name: "status" + - name: "Status" value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_8.yaml b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_8.yaml index 893cc48e7e1431..d1633f30f81291 100644 --- a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_8.yaml @@ -42,15 +42,15 @@ tests: command: "StopApp" arguments: values: - - name: "application" + - name: "Application" value: { - catalogVendorId: catalogVendorId, - applicationId: applicationId, + CatalogVendorID: catalogVendorId, + ApplicationID: applicationId, } response: values: - - name: "status" + - name: "Status" value: 0 #Endpoint configuration is not supported in YAML diff --git a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_9.yaml b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_9.yaml index 74ba8f3be5ee82..8f7b49346d779c 100644 --- a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_3_9.yaml @@ -42,11 +42,11 @@ tests: command: "HideApp" arguments: values: - - name: "application" + - name: "Application" value: { - catalogVendorId: catalogVendorId, - applicationId: applicationId, + CatalogVendorID: catalogVendorId, + ApplicationID: applicationId, } #Expected status attribute response ACTIVE_HIDDEN or STOPPED 'OR' condition is not supported in YAML diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index f2c857dfa2d227..0577790159d904 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -26,42 +26,42 @@ limitations under the License. This cluster provides an interface for launching content on a media player device such as a TV or Speaker. CatalogList - CurrentApp + CurrentApp Upon receipt, this SHALL launch the specified app with optional data. The TV Device SHALL launch and bring to foreground the identified application in the command if the application is not already launched and in foreground. The TV Device SHALL update state attribute on the Application Basic cluster of the Endpoint corresponding to the launched application. This command returns a Launch Response. - - + + Upon receipt on a Video Player endpoint this SHALL stop the specified application if it is running. - + Upon receipt on a Video Player endpoint this SHALL hide the specified application if it is running and visible. - + This command SHALL be generated in response to LaunchApp commands. - - + + - + - - + + - + - - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 68ea4c464f03a0..aa8ac48901b021 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4011,18 +4011,18 @@ client cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } - struct ApplicationEP { - Application application = 0; + struct ApplicationEPStruct { + ApplicationStruct application = 0; optional endpoint_no endpoint = 1; } - struct Application { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute INT16U catalogList[] = 0; - attribute nullable ApplicationEP currentApp = 1; + attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; @@ -4030,21 +4030,21 @@ client cluster ApplicationLauncher = 1292 { readonly attribute int16u clusterRevision = 65533; request struct LaunchAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; optional OCTET_STRING data = 1; } request struct StopAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } request struct HideAppRequest { - Application application = 0; + optional ApplicationStruct application = 0; } response struct LauncherResponse = 3 { ApplicationLauncherStatusEnum status = 0; - OCTET_STRING data = 1; + optional OCTET_STRING data = 1; } command LaunchApp(LaunchAppRequest): LauncherResponse = 0; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index e6c618f2b64f29..b183913a61f64b 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16949,7 +16949,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "ApplicationEP", + "type": "ApplicationEPStruct", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 51d3c59e6894ef..5e811283489618 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -16274,35 +16274,36 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_application; - jobject value_application_catalogVendorId; - std::string value_application_catalogVendorIdClassName = "java/lang/Integer"; - std::string value_application_catalogVendorIdCtorSignature = "(I)V"; + jobject value_application_catalogVendorID; + std::string value_application_catalogVendorIDClassName = "java/lang/Integer"; + std::string value_application_catalogVendorIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( - value_application_catalogVendorIdClassName.c_str(), value_application_catalogVendorIdCtorSignature.c_str(), - cppValue.Value().application.catalogVendorId, value_application_catalogVendorId); - jobject value_application_applicationId; - value_application_applicationId = env->NewStringUTF(std::string(cppValue.Value().application.applicationId.data(), - cppValue.Value().application.applicationId.size()) + value_application_catalogVendorIDClassName.c_str(), value_application_catalogVendorIDCtorSignature.c_str(), + cppValue.Value().application.catalogVendorID, value_application_catalogVendorID); + jobject value_application_applicationID; + value_application_applicationID = env->NewStringUTF(std::string(cppValue.Value().application.applicationID.data(), + cppValue.Value().application.applicationID.size()) .c_str()); - jclass applicationStructClass_2; + jclass applicationStructStructClass_2; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication", applicationStructClass_2); + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct", + applicationStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplication"); + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationStruct"); return nullptr; } - jmethodID applicationStructCtor_2 = - env->GetMethodID(applicationStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (applicationStructCtor_2 == nullptr) + jmethodID applicationStructStructCtor_2 = + env->GetMethodID(applicationStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (applicationStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplication constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationStruct constructor"); return nullptr; } - value_application = env->NewObject(applicationStructClass_2, applicationStructCtor_2, - value_application_catalogVendorId, value_application_applicationId); + value_application = env->NewObject(applicationStructStructClass_2, applicationStructStructCtor_2, + value_application_catalogVendorID, value_application_applicationID); jobject value_endpoint; if (!cppValue.Value().endpoint.HasValue()) { @@ -16319,24 +16320,26 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endpointInsideOptional, value_endpoint); } - jclass applicationEPStructClass_1; + jclass applicationEPStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEP", applicationEPStructClass_1); + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEPStruct", + applicationEPStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEP"); + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEPStruct"); return nullptr; } - jmethodID applicationEPStructCtor_1 = env->GetMethodID( - applicationEPStructClass_1, "", - "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication;Ljava/util/Optional;)V"); - if (applicationEPStructCtor_1 == nullptr) + jmethodID applicationEPStructStructCtor_1 = env->GetMethodID( + applicationEPStructStructClass_1, "", + "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct;Ljava/util/Optional;)V"); + if (applicationEPStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEP constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEPStruct constructor"); return nullptr; } - value = env->NewObject(applicationEPStructClass_1, applicationEPStructCtor_1, value_application, value_endpoint); + value = env->NewObject(applicationEPStructStructClass_1, applicationEPStructStructCtor_1, value_application, + value_endpoint); } return value; } diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 5feb3d40023799..c008c2928d6635 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3651,21 +3651,31 @@ void CHIPApplicationLauncherClusterLauncherResponseCallback::CallbackFn( // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;[B)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject status; - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), - static_cast(dataResponse.status), status); - jobject data; - jbyteArray dataByteArray = env->NewByteArray(static_cast(dataResponse.data.size())); - env->SetByteArrayRegion(dataByteArray, 0, static_cast(dataResponse.data.size()), - reinterpret_cast(dataResponse.data.data())); - data = dataByteArray; - - env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + static_cast(dataResponse.status), Status); + jobject Data; + if (!dataResponse.data.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); + } + else + { + jobject DataInsideOptional; + jbyteArray DataInsideOptionalByteArray = env->NewByteArray(static_cast(dataResponse.data.Value().size())); + env->SetByteArrayRegion(DataInsideOptionalByteArray, 0, static_cast(dataResponse.data.Value().size()), + reinterpret_cast(dataResponse.data.Value().data())); + DataInsideOptional = DataInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } CHIPAccountLoginClusterGetSetupPINResponseCallback::CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index c63bec1f373636..3d091494df2d02 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -21016,14 +21016,14 @@ public ApplicationLauncherCluster(long devicePtr, int endpointId) { public void launchApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, Optional data) { launchApp(chipClusterPtr, callback, application, data, null); } public void launchApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, Optional data, int timedInvokeTimeoutMs) { launchApp(chipClusterPtr, callback, application, data, timedInvokeTimeoutMs); @@ -21031,26 +21031,26 @@ public void launchApp( public void stopApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application) { + Optional application) { stopApp(chipClusterPtr, callback, application, null); } public void stopApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, int timedInvokeTimeoutMs) { stopApp(chipClusterPtr, callback, application, timedInvokeTimeoutMs); } public void hideApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application) { + Optional application) { hideApp(chipClusterPtr, callback, application, null); } public void hideApp( LauncherResponseCallback callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, int timedInvokeTimeoutMs) { hideApp(chipClusterPtr, callback, application, timedInvokeTimeoutMs); } @@ -21058,24 +21058,24 @@ public void hideApp( private native void launchApp( long chipClusterPtr, LauncherResponseCallback Callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, Optional data, @Nullable Integer timedInvokeTimeoutMs); private native void stopApp( long chipClusterPtr, LauncherResponseCallback Callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, @Nullable Integer timedInvokeTimeoutMs); private native void hideApp( long chipClusterPtr, LauncherResponseCallback Callback, - ChipStructs.ApplicationLauncherClusterApplication application, + Optional application, @Nullable Integer timedInvokeTimeoutMs); public interface LauncherResponseCallback { - void onSuccess(Integer status, byte[] data); + void onSuccess(Integer status, Optional data); void onError(Exception error); } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 8a0b02f2d33d16..8aced0eeec990d 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1755,36 +1755,38 @@ public String toString() { } } - public static class ApplicationLauncherClusterApplication { - public Integer catalogVendorId; - public String applicationId; + public static class ApplicationLauncherClusterApplicationStruct { + public Integer catalogVendorID; + public String applicationID; - public ApplicationLauncherClusterApplication(Integer catalogVendorId, String applicationId) { - this.catalogVendorId = catalogVendorId; - this.applicationId = applicationId; + public ApplicationLauncherClusterApplicationStruct( + Integer catalogVendorID, String applicationID) { + this.catalogVendorID = catalogVendorID; + this.applicationID = applicationID; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ApplicationLauncherClusterApplication {\n"); - output.append("\tcatalogVendorId: "); - output.append(catalogVendorId); + output.append("ApplicationLauncherClusterApplicationStruct {\n"); + output.append("\tcatalogVendorID: "); + output.append(catalogVendorID); output.append("\n"); - output.append("\tapplicationId: "); - output.append(applicationId); + output.append("\tapplicationID: "); + output.append(applicationID); output.append("\n"); output.append("}\n"); return output.toString(); } } - public static class ApplicationLauncherClusterApplicationEP { - public ChipStructs.ApplicationLauncherClusterApplication application; + public static class ApplicationLauncherClusterApplicationEPStruct { + public ChipStructs.ApplicationLauncherClusterApplicationStruct application; public Optional endpoint; - public ApplicationLauncherClusterApplicationEP( - ChipStructs.ApplicationLauncherClusterApplication application, Optional endpoint) { + public ApplicationLauncherClusterApplicationEPStruct( + ChipStructs.ApplicationLauncherClusterApplicationStruct application, + Optional endpoint) { this.application = application; this.endpoint = endpoint; } @@ -1792,7 +1794,7 @@ public ApplicationLauncherClusterApplicationEP( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ApplicationLauncherClusterApplicationEP {\n"); + output.append("ApplicationLauncherClusterApplicationEPStruct {\n"); output.append("\tapplication: "); output.append(application); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 20b3fd2a8d4248..2a2b85e1ccca50 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -6331,12 +6331,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer status, byte[] data) { + public void onSuccess(Integer Status, Optional Data) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "Integer"); - responseValues.put(statusResponseValue, status); - CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "byte[]"); - responseValues.put(dataResponseValue, data); + CommandResponseInfo StatusResponseValue = new CommandResponseInfo("Status", "Integer"); + responseValues.put(StatusResponseValue, Status); + CommandResponseInfo DataResponseValue = new CommandResponseInfo("Data", "Optional"); + responseValues.put(DataResponseValue, Data); callback.onSuccess(responseValues); } @@ -11714,7 +11714,7 @@ public Map> getCommandMap() { ((ChipClusters.ApplicationLauncherCluster) cluster) .launchApp( (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, - (ChipStructs.ApplicationLauncherClusterApplication) + (Optional) commandArguments.get("application"), (Optional) commandArguments.get("data")); }, @@ -11730,7 +11730,7 @@ public Map> getCommandMap() { ((ChipClusters.ApplicationLauncherCluster) cluster) .stopApp( (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, - (ChipStructs.ApplicationLauncherClusterApplication) + (Optional) commandArguments.get("application")); }, () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), @@ -11745,7 +11745,7 @@ public Map> getCommandMap() { ((ChipClusters.ApplicationLauncherCluster) cluster) .hideApp( (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, - (ChipStructs.ApplicationLauncherClusterApplication) + (Optional) commandArguments.get("application")); }, () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index e5d920f8722c44..08278978018e50 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6420,8 +6420,8 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "LaunchApp", "args": { - "catalogVendorId": "int", - "applicationId": "str", + "catalogVendorID": "int", + "applicationID": "str", "data": "bytes", }, }, @@ -6429,16 +6429,16 @@ class ChipClusters: "commandId": 0x00000001, "commandName": "StopApp", "args": { - "catalogVendorId": "int", - "applicationId": "str", + "catalogVendorID": "int", + "applicationID": "str", }, }, 0x00000002: { "commandId": 0x00000002, "commandName": "HideApp", "args": { - "catalogVendorId": "int", - "applicationId": "str", + "catalogVendorID": "int", + "applicationID": "str", }, }, }, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cbbd3c8467d112..2559e05ecdab26 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24691,7 +24691,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="catalogList", Tag=0x00000000, Type=typing.Optional[typing.List[uint]]), - ClusterObjectFieldDescriptor(Label="currentApp", Tag=0x00000001, Type=typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEP]), + ClusterObjectFieldDescriptor(Label="currentApp", Tag=0x00000001, Type=typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEPStruct]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -24700,7 +24700,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) catalogList: 'typing.Optional[typing.List[uint]]' = None - currentApp: 'typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEP]' = None + currentApp: 'typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEPStruct]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -24726,29 +24726,29 @@ class ApplicationLauncherFeature(IntFlag): class Structs: @dataclass - class Application(ClusterObject): + class ApplicationStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationId", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="catalogVendorID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="applicationID", Tag=1, Type=str), ]) - catalogVendorId: 'uint' = 0 - applicationId: 'str' = "" + catalogVendorID: 'uint' = 0 + applicationID: 'str' = "" @dataclass - class ApplicationEP(ClusterObject): + class ApplicationEPStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.ApplicationStruct), ClusterObjectFieldDescriptor(Label="endpoint", Tag=1, Type=typing.Optional[uint]), ]) - application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) + application: 'ApplicationLauncher.Structs.ApplicationStruct' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationStruct()) endpoint: 'typing.Optional[uint]' = None @@ -24765,11 +24765,11 @@ class LaunchApp(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[bytes]), ]) - application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) + application: 'typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]' = None data: 'typing.Optional[bytes]' = None @dataclass @@ -24783,10 +24783,10 @@ class StopApp(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]), ]) - application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) + application: 'typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]' = None @dataclass class HideApp(ClusterCommand): @@ -24799,10 +24799,10 @@ class HideApp(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]), ]) - application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) + application: 'typing.Optional[ApplicationLauncher.Structs.ApplicationStruct]' = None @dataclass class LauncherResponse(ClusterCommand): @@ -24816,11 +24816,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatusEnum), - ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=bytes), + ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[bytes]), ]) status: 'ApplicationLauncher.Enums.ApplicationLauncherStatusEnum' = 0 - data: 'bytes' = b"" + data: 'typing.Optional[bytes]' = None class Attributes: @@ -24852,9 +24852,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEP]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEPStruct]) - value: 'typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEP]' = None + value: 'typing.Union[None, Nullable, ApplicationLauncher.Structs.ApplicationEPStruct]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 48c8e27d455d65..5752ce6ad5d190 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5086,6 +5086,9 @@ - ContentSearchStruct - StyleInformationStruct - BrandingInformationStruct + ApplicationLauncher: + - ApplicationStruct + - ApplicationEPStruct struct fields: UnitTesting: SimpleStruct: @@ -5260,6 +5263,17 @@ - progressBar - splash - waterMark + ApplicationLauncher: + ApplicationStruct: + - catalogVendorID + - applicationID + # Values that are actually deprecated, but we effectively + # introduced them in this release. + - catalogVendorId + - applicationId + ApplicationEPStruct: + - application + - endpoint events: OTASoftwareUpdateRequestor: - StateTransition @@ -5792,6 +5806,9 @@ - ContentSearch - StyleInformation - BrandingInformation + ApplicationLauncher: + - Application + - ApplicationEP struct fields: Descriptor: DeviceTypeStruct: @@ -5804,6 +5821,10 @@ ContentLauncher: StyleInformationStruct: - imageUrl + ApplicationLauncher: + ApplicationStruct: + - catalogVendorId + - applicationId event fields: Switch: MultiPressComplete: @@ -6085,6 +6106,9 @@ ContentSearchStruct: ContentSearch StyleInformationStruct: StyleInformation BrandingInformationStruct: BrandingInformation + ApplicationLauncher: + ApplicationStruct: Application + ApplicationEPStruct: ApplicationEP struct fields: Descriptor: DeviceTypeStruct: @@ -6097,6 +6121,10 @@ ContentLauncher: StyleInformationStruct: imageURL: imageUrl + ApplicationLauncher: + ApplicationStruct: + catalogVendorID: catalogVendorId + applicationID: applicationId event fields: Switch: MultiPressComplete: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index e796c95ab2bd3d..095d73fa19c2c4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -14116,15 +14116,15 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & if (*aError != CHIP_NO_ERROR) { return nil; } - MTRApplicationLauncherClusterApplicationEP * _Nullable value; + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRApplicationLauncherClusterApplicationEP new]; - value.application = [MTRApplicationLauncherClusterApplication new]; - value.application.catalogVendorId = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorId]; - value.application.applicationId = [[NSString alloc] initWithBytes:cppValue.Value().application.applicationId.data() - length:cppValue.Value().application.applicationId.size() + value = [MTRApplicationLauncherClusterApplicationEPStruct new]; + value.application = [MTRApplicationLauncherClusterApplicationStruct new]; + value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorID]; + value.application.applicationID = [[NSString alloc] initWithBytes:cppValue.Value().application.applicationID.data() + length:cppValue.Value().application.applicationID.size() encoding:NSUTF8StringEncoding]; if (cppValue.Value().endpoint.HasValue()) { value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint.Value()]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 92ba3b37009c35..6cfe17c47d1795 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13206,7 +13206,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * state attribute on the Application Basic cluster of the Endpoint corresponding to the launched application. This command returns * a Launch Response. */ -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** @@ -13214,7 +13214,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * * Upon receipt on a Video Player endpoint this SHALL stop the specified application if it is running. */ -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** @@ -13222,7 +13222,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * * Upon receipt on a Video Player endpoint this SHALL hide the specified application if it is running and visible. */ -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; @@ -13238,21 +13238,21 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, +- (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value +- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value +- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeCurrentAppWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, + reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; + (void)readAttributeCurrentAppWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue - completion:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, + completion:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -39875,19 +39875,19 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { queue:(dispatch_queue_t)queue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use initWithDevice:endpointID:queue:"); -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler NS_SWIFT_UNAVAILABLE("Unavailable to avoid ambiguity in trailing closure or async calls") API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use launchAppWithParams:completion:"); -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler NS_SWIFT_UNAVAILABLE("Unavailable to avoid ambiguity in trailing closure or async calls") API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use stopAppWithParams:completion:"); -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler NS_SWIFT_UNAVAILABLE("Unavailable to avoid ambiguity in trailing closure or async calls") diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index d5facf0800aadd..5e02ba9e64f6b0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -90359,7 +90359,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en return self; } -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { @@ -90386,11 +90386,16 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; - if (params.data != nil) { - auto & definedValue_0 = request.data.Emplace(); - definedValue_0 = [self asByteSpan:params.data]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + if (params.data != nil) { + auto & definedValue_0 = request.data.Emplace(); + definedValue_0 = [self asByteSpan:params.data]; + } } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, @@ -90399,7 +90404,7 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para std::move(*bridge).DispatchAction(self.device); } -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { @@ -90426,8 +90431,13 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); @@ -90435,7 +90445,7 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params std::move(*bridge).DispatchAction(self.device); } -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion { @@ -90462,8 +90472,13 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); @@ -90514,24 +90529,24 @@ + (void)readAttributeCatalogListWithClusterStateCache:(MTRClusterStateCacheConta }); } -- (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, +- (void)readAttributeCurrentAppWithCompletion:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; using TypeInfo = ApplicationLauncher::Attributes::CurrentApp::TypeInfo; return MTRReadAttribute( + MTRApplicationLauncherClusterApplicationEPStruct, TypeInfo::DecodableType>( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value +- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value completion:(MTRStatusCompletion)completion { - [self writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable) value + [self writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable) value params:nil completion:completion]; } -- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEP * _Nullable)value +- (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { @@ -90560,8 +90575,8 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.application.catalogVendorId = value.application.catalogVendorId.unsignedShortValue; - nonNullValue_0.application.applicationId = [self asCharSpan:value.application.applicationId]; + nonNullValue_0.application.catalogVendorID = value.application.catalogVendorID.unsignedShortValue; + nonNullValue_0.application.applicationID = [self asCharSpan:value.application.applicationID]; if (value.endpoint != nil) { auto & definedValue_2 = nonNullValue_0.endpoint.Emplace(); definedValue_2 = value.endpoint.unsignedShortValue; @@ -90576,19 +90591,19 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat - (void)subscribeAttributeCurrentAppWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, + reportHandler:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = ApplicationLauncher::Attributes::CurrentApp::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, + MTRApplicationLauncherClusterApplicationEPStruct, TypeInfo::DecodableType>(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } + (void)readAttributeCurrentAppWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue - completion:(void (^)(MTRApplicationLauncherClusterApplicationEP * _Nullable value, + completion:(void (^)(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherCurrentAppStructAttributeCallbackBridge(queue, completion); @@ -90836,7 +90851,7 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @implementation MTRBaseClusterApplicationLauncher (Deprecated) -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { @@ -90846,7 +90861,7 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para completionHandler(static_cast(data), error); }]; } -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { @@ -90856,7 +90871,7 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params completionHandler(static_cast(data), error); }]; } -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { @@ -90913,7 +90928,7 @@ - (void)readAttributeCurrentAppWithCompletionHandler:(void (^)(MTRApplicationLau NSError * _Nullable error))completionHandler { [self readAttributeCurrentAppWithCompletion:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. completionHandler(static_cast(value), error); }]; @@ -90945,8 +90960,8 @@ - (void)subscribeAttributeCurrentAppWithMinInterval:(NSNumber * _Nonnull)minInte } [self subscribeAttributeCurrentAppWithParams:subscribeParams subscriptionEstablished:subscriptionEstablishedHandler - reportHandler:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error) { + reportHandler:^(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, + NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. reportHandler(static_cast(value), error); }]; @@ -90960,7 +90975,7 @@ + (void)readAttributeCurrentAppWithAttributeCache:(MTRAttributeCacheContainer *) [self readAttributeCurrentAppWithClusterStateCache:attributeCacheContainer.realContainer endpoint:endpoint queue:queue - completion:^(MTRApplicationLauncherClusterApplicationEP * _Nullable value, + completion:^(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. completionHandler( diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 760646ec1a0886..936886fb99dff3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -1046,7 +1046,7 @@ typedef void (*ApplicationLauncherCatalogListListAttributeCallback)(void * conte const chip::app::DataModel::DecodableList & data); typedef void (*ApplicationLauncherCurrentAppStructAttributeCallback)( void *, - const chip::app::DataModel::Nullable &); + const chip::app::DataModel::Nullable &); typedef void (*ApplicationLauncherGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ApplicationLauncherAcceptedCommandListListAttributeCallback)( @@ -9755,10 +9755,9 @@ class MTRApplicationLauncherCurrentAppStructAttributeCallbackBridge MTRActionBlock action) : MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn( - void * context, - const chip::app::DataModel::Nullable & - value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> & value); }; class MTRApplicationLauncherCurrentAppStructAttributeCallbackSubscriptionBridge diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 5e8b7a4f02bf19..9e524f6b19655f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -9858,17 +9858,18 @@ } void MTRApplicationLauncherCurrentAppStructAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) + const chip::app::DataModel::Nullable & + value) { - MTRApplicationLauncherClusterApplicationEP * _Nullable objCValue; + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable objCValue; if (value.IsNull()) { objCValue = nil; } else { - objCValue = [MTRApplicationLauncherClusterApplicationEP new]; - objCValue.application = [MTRApplicationLauncherClusterApplication new]; - objCValue.application.catalogVendorId = [NSNumber numberWithUnsignedShort:value.Value().application.catalogVendorId]; - objCValue.application.applicationId = [[NSString alloc] initWithBytes:value.Value().application.applicationId.data() - length:value.Value().application.applicationId.size() + objCValue = [MTRApplicationLauncherClusterApplicationEPStruct new]; + objCValue.application = [MTRApplicationLauncherClusterApplicationStruct new]; + objCValue.application.catalogVendorID = [NSNumber numberWithUnsignedShort:value.Value().application.catalogVendorID]; + objCValue.application.applicationID = [[NSString alloc] initWithBytes:value.Value().application.applicationID.data() + length:value.Value().application.applicationID.size() encoding:NSUTF8StringEncoding]; if (value.Value().endpoint.HasValue()) { objCValue.endpoint = [NSNumber numberWithUnsignedShort:value.Value().endpoint.Value()]; @@ -12469,7 +12470,11 @@ response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; } { - response.data = [NSData dataWithBytes:data.data.data() length:data.data.size()]; + if (data.data.HasValue()) { + response.data = [NSData dataWithBytes:data.data.Value().data() length:data.data.Value().size()]; + } else { + response.data = nil; + } } DispatchSuccess(context, response); }; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 12f84c7355d797..a679d44dca2716 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5206,17 +5206,17 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -8580,7 +8580,7 @@ MTR_NEWLY_DEPRECATED("Please use MTRClusterUnitTesting") queue:(dispatch_queue_t)queue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use initWithDevice:endpoindID:queue:"); -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -8588,7 +8588,7 @@ MTR_NEWLY_DEPRECATED("Please use MTRClusterUnitTesting") NS_SWIFT_UNAVAILABLE("Unavailable to avoid ambiguity in trailing closure or async calls") API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use launchAppWithParams:expectedValues:expectedValueInterval:completion:"); -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -8596,7 +8596,7 @@ MTR_NEWLY_DEPRECATED("Please use MTRClusterUnitTesting") NS_SWIFT_UNAVAILABLE("Unavailable to avoid ambiguity in trailing closure or async calls") API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use stopAppWithParams:expectedValues:expectedValueInterval:completion:"); -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index f2f731745a93f5..06c3f450b4c15c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -25184,7 +25184,7 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpoi return self; } -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -25233,11 +25233,16 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; - if (params.data != nil) { - auto & definedValue_0 = request.data.Emplace(); - definedValue_0 = [self asByteSpan:params.data]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + if (params.data != nil) { + auto & definedValue_0 = request.data.Emplace(); + definedValue_0 = [self asByteSpan:params.data]; + } } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, @@ -25259,7 +25264,7 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para } } -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -25308,8 +25313,13 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); @@ -25330,7 +25340,7 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params } } -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -25379,8 +25389,13 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; - request.application.applicationId = [self asCharSpan:params.application.applicationId]; + if (params != nil) { + if (params.application != nil) { + auto & definedValue_0 = request.application.Emplace(); + definedValue_0.catalogVendorID = params.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = [self asCharSpan:params.application.applicationID]; + } + } return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); @@ -25485,7 +25500,7 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint q return [self initWithDevice:device endpointID:@(endpoint) queue:queue]; } -- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -25499,7 +25514,7 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para completionHandler(static_cast(data), error); }]; } -- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -25513,7 +25528,7 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params completionHandler(static_cast(data), error); }]; } -- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 23a862fa7e59fb..d01abc49e50d15 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -6349,8 +6349,8 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRApplicationLauncherClusterLaunchAppParams : NSObject -@property (nonatomic, copy) - MTRApplicationLauncherClusterApplication * _Nonnull application API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) MTRApplicationLauncherClusterApplicationStruct * _Nullable application API_AVAILABLE( + ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSData * _Nullable data API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); /** @@ -6382,8 +6382,8 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRApplicationLauncherClusterStopAppParams : NSObject -@property (nonatomic, copy) - MTRApplicationLauncherClusterApplication * _Nonnull application API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) MTRApplicationLauncherClusterApplicationStruct * _Nullable application API_AVAILABLE( + ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -6413,8 +6413,8 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRApplicationLauncherClusterHideAppParams : NSObject -@property (nonatomic, copy) - MTRApplicationLauncherClusterApplication * _Nonnull application API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) MTRApplicationLauncherClusterApplicationStruct * _Nullable application API_AVAILABLE( + ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -6446,7 +6446,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull status API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSData * _Nonnull data API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) NSData * _Nullable data API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 8f2146cfd44e6c..3426f9172a390f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -7191,7 +7191,7 @@ - (instancetype)init { if (self = [super init]) { - _application = [MTRApplicationLauncherClusterApplication new]; + _application = nil; _data = nil; _timedInvokeTimeoutMs = nil; @@ -7225,7 +7225,7 @@ - (instancetype)init { if (self = [super init]) { - _application = [MTRApplicationLauncherClusterApplication new]; + _application = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -7256,7 +7256,7 @@ - (instancetype)init { if (self = [super init]) { - _application = [MTRApplicationLauncherClusterApplication new]; + _application = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -7289,7 +7289,7 @@ - (instancetype)init _status = @(0); - _data = [NSData data]; + _data = nil; _timedInvokeTimeoutMs = nil; } return self; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index fd75353c45bda5..50b52a10d9efc5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -914,17 +914,27 @@ MTR_NEWLY_DEPRECATED("Please use MTRAudioOutputClusterOutputInfoStruct") @interface MTRAudioOutputClusterOutputInfo : MTRAudioOutputClusterOutputInfoStruct @end +MTR_NEWLY_AVAILABLE +@interface MTRApplicationLauncherClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull applicationID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull applicationId MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) -@interface MTRApplicationLauncherClusterApplication : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSString * _Nonnull applicationId API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_NEWLY_DEPRECATED("Please use MTRApplicationLauncherClusterApplicationStruct") +@interface MTRApplicationLauncherClusterApplication : MTRApplicationLauncherClusterApplicationStruct +@end +MTR_NEWLY_AVAILABLE +@interface MTRApplicationLauncherClusterApplicationEPStruct : NSObject +@property (nonatomic, copy) MTRApplicationLauncherClusterApplicationStruct * _Nonnull application MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endpoint MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) -@interface MTRApplicationLauncherClusterApplicationEP : NSObject -@property (nonatomic, copy) - MTRApplicationLauncherClusterApplication * _Nonnull application API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSNumber * _Nullable endpoint API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_NEWLY_DEPRECATED("Please use MTRApplicationLauncherClusterApplicationEPStruct") +@interface MTRApplicationLauncherClusterApplicationEP : MTRApplicationLauncherClusterApplicationEPStruct @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index b1f83fabd0e5f0..2ed5f682094daf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3696,43 +3696,66 @@ - (NSString *)description @implementation MTRAudioOutputClusterOutputInfo : MTRAudioOutputClusterOutputInfoStruct @end -@implementation MTRApplicationLauncherClusterApplication +@implementation MTRApplicationLauncherClusterApplicationStruct - (instancetype)init { if (self = [super init]) { - _catalogVendorId = @(0); + _catalogVendorID = @(0); - _applicationId = @""; + _applicationID = @""; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRApplicationLauncherClusterApplication alloc] init]; + auto other = [[MTRApplicationLauncherClusterApplicationStruct alloc] init]; - other.catalogVendorId = self.catalogVendorId; - other.applicationId = self.applicationId; + other.catalogVendorID = self.catalogVendorID; + other.applicationID = self.applicationID; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: catalogVendorId:%@; applicationId:%@; >", - NSStringFromClass([self class]), _catalogVendorId, _applicationId]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: catalogVendorID:%@; applicationID:%@; >", + NSStringFromClass([self class]), _catalogVendorID, _applicationID]; return descriptionString; } +- (void)setCatalogVendorId:(NSNumber * _Nonnull)catalogVendorId +{ + self.catalogVendorID = catalogVendorId; +} + +- (NSNumber * _Nonnull)catalogVendorId +{ + return self.catalogVendorID; +} + +- (void)setApplicationId:(NSString * _Nonnull)applicationId +{ + self.applicationID = applicationId; +} + +- (NSString * _Nonnull)applicationId +{ + return self.applicationID; +} + +@end + +@implementation MTRApplicationLauncherClusterApplication : MTRApplicationLauncherClusterApplicationStruct @end -@implementation MTRApplicationLauncherClusterApplicationEP +@implementation MTRApplicationLauncherClusterApplicationEPStruct - (instancetype)init { if (self = [super init]) { - _application = [MTRApplicationLauncherClusterApplication new]; + _application = [MTRApplicationLauncherClusterApplicationStruct new]; _endpoint = nil; } @@ -3741,7 +3764,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRApplicationLauncherClusterApplicationEP alloc] init]; + auto other = [[MTRApplicationLauncherClusterApplicationEPStruct alloc] init]; other.application = self.application; other.endpoint = self.endpoint; @@ -3758,6 +3781,9 @@ - (NSString *)description @end +@implementation MTRApplicationLauncherClusterApplicationEP : MTRApplicationLauncherClusterApplicationEPStruct +@end + @implementation MTRApplicationBasicClusterApplicationBasicApplication - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 4ce8009b89a0c5..bd91719cd0f2a6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -8756,7 +8756,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback( * @brief Application Launcher Cluster LauncherResponse Command callback (from server) */ bool emberAfApplicationLauncherClusterLauncherResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t status, chip::ByteSpan data); + uint8_t Status, chip::ByteSpan Data); /** * @brief Account Login Cluster GetSetupPIN Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index a715ea0599925a..afe1586d8a736e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -17407,13 +17407,13 @@ namespace Events {} // namespace Events } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace Application { +namespace ApplicationStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorId)), catalogVendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationId)), applicationId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorID)), catalogVendorID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationID)), applicationID)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -17433,11 +17433,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kCatalogVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorId)); + case to_underlying(Fields::kCatalogVendorID): + ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorID)); break; - case to_underlying(Fields::kApplicationId): - ReturnErrorOnFailure(DataModel::Decode(reader, applicationId)); + case to_underlying(Fields::kApplicationID): + ReturnErrorOnFailure(DataModel::Decode(reader, applicationID)); break; default: break; @@ -17450,8 +17450,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace Application -namespace ApplicationEP { +} // namespace ApplicationStruct +namespace ApplicationEPStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -17494,7 +17494,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ApplicationEP +} // namespace ApplicationEPStruct } // namespace Structs namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 98082544acbb23..2117cbbbf24fbe 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -22706,18 +22706,18 @@ struct TypeInfo } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace Application { +namespace ApplicationStruct { enum class Fields { - kCatalogVendorId = 0, - kApplicationId = 1, + kCatalogVendorID = 0, + kApplicationID = 1, }; struct Type { public: - uint16_t catalogVendorId = static_cast(0); - chip::CharSpan applicationId; + uint16_t catalogVendorID = static_cast(0); + chip::CharSpan applicationID; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22728,8 +22728,8 @@ struct Type using DecodableType = Type; -} // namespace Application -namespace ApplicationEP { +} // namespace ApplicationStruct +namespace ApplicationEPStruct { enum class Fields { kApplication = 0, @@ -22739,7 +22739,7 @@ enum class Fields struct Type { public: - Structs::Application::Type application; + Structs::ApplicationStruct::Type application; Optional endpoint; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22751,7 +22751,7 @@ struct Type using DecodableType = Type; -} // namespace ApplicationEP +} // namespace ApplicationEPStruct } // namespace Structs namespace Commands { @@ -22794,7 +22794,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::Type application; + Optional application; Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22810,7 +22810,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::DecodableType application; + Optional application; Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22828,7 +22828,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StopApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::Type application; + Optional application; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22843,7 +22843,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StopApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::DecodableType application; + Optional application; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StopApp @@ -22860,7 +22860,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::HideApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::Type application; + Optional application; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22875,7 +22875,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::HideApp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::Application::DecodableType application; + Optional application; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace HideApp @@ -22894,7 +22894,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } ApplicationLauncherStatusEnum status = static_cast(0); - chip::ByteSpan data; + Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22910,7 +22910,7 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } ApplicationLauncherStatusEnum status = static_cast(0); - chip::ByteSpan data; + Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace LauncherResponse @@ -22933,11 +22933,11 @@ struct TypeInfo namespace CurrentApp { struct TypeInfo { - using Type = chip::app::DataModel::Nullable; + using Type = chip::app::DataModel::Nullable; using DecodableType = - chip::app::DataModel::Nullable; - using DecodableArgType = - const chip::app::DataModel::Nullable &; + chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentApp::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 9b0ef2a23d5ac5..ca80c9e90c8145 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6895,7 +6895,8 @@ class ApplicationLauncherLaunchApp : public ClusterCommand private: chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /* @@ -6927,7 +6928,8 @@ class ApplicationLauncherStopApp : public ClusterCommand private: chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /* @@ -6959,7 +6961,8 @@ class ApplicationLauncherHideApp : public ClusterCommand private: chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /*----------------------------------------------------------------------------*\ @@ -12537,7 +12540,7 @@ void registerClusterApplicationLauncher(Commands & commands, CredentialIssuerCom make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // make_unique>>( + chip::app::DataModel::Nullable>>( Id, "current-app", Attributes::CurrentApp::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "catalog-list", Attributes::CatalogList::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index e7e282ba2aa46d..84ca3fdd6c8c4e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -160,32 +160,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentLauncher::Struc ComplexArgumentParser::Finalize(request.name); ComplexArgumentParser::Finalize(request.value); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("Application.catalogVendorId", "catalogVendorId", - value.isMember("catalogVendorId"))); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("Application.applicationId", "applicationId", value.isMember("applicationId"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorId"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorId, value["catalogVendorId"])); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationId"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationId, value["applicationId"])); - - return CHIP_NO_ERROR; -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & request) -{ - ComplexArgumentParser::Finalize(request.catalogVendorId); - ComplexArgumentParser::Finalize(request.applicationId); -} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request, Json::Value & value) @@ -213,13 +187,13 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationBasic::Stru ComplexArgumentParser::Finalize(request.applicationId); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type & request, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ApplicationEP.application", "application", value.isMember("application"))); + ComplexArgumentParser::EnsureMemberExist("ApplicationEPStruct.application", "application", value.isMember("application"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "application"); @@ -234,11 +208,37 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return CHIP_NO_ERROR; } -void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request) { ComplexArgumentParser::Finalize(request.application); ComplexArgumentParser::Finalize(request.endpoint); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID", + value.isMember("catalogVendorID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID", + value.isMember("applicationID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"])); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"])); + + return CHIP_NO_ERROR; +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.catalogVendorID); + ComplexArgumentParser::Finalize(request.applicationID); +} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 869e45bf7d13eb..fa38afafbced6f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -39,19 +39,19 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher Json::Value & value); static void Finalize(chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type & request); +static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8a54494c5140e2..d811b7a504cd33 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -178,8 +178,9 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -204,22 +205,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("CatalogVendorId", indent + 1, value.catalogVendorId); + CHIP_ERROR err = LogValue("Application", indent + 1, value.application); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorId'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Application'"); return err; } } { - CHIP_ERROR err = LogValue("ApplicationId", indent + 1, value.applicationId); + CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationId'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Endpoint'"); return err; } } @@ -227,23 +228,24 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("Application", indent + 1, value.application); + CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Application'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'"); return err; } } { - CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); + CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Endpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'"); return err; } } @@ -8881,7 +8883,8 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("CatalogList", 1, value); } case ApplicationLauncher::Attributes::CurrentApp::Id: { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentApp", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index d1adb75145fe63..fe650c8154a921 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -28,13 +28,13 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Actions::Structs::ActionStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value); + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 20a7f1aa805102..0c2ea2750e50f7 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -30874,9 +30874,10 @@ class Test_TC_ALOGIN_12_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); value.data.Emplace(); @@ -31543,7 +31544,8 @@ class Test_TC_APPLAUNCHER_3_6Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable + chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } @@ -31692,9 +31694,10 @@ class Test_TC_APPLAUNCHER_3_7Suite : public TestCommand VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); value.data.Emplace(); @@ -31709,9 +31712,11 @@ class Test_TC_APPLAUNCHER_3_7Suite : public TestCommand VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = chip::Span("NonAvailableAppgarbage: not in length on purpose", 15); + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = + chip::Span("NonAvailableAppgarbage: not in length on purpose", 15); value.data.Emplace(); value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); @@ -31823,9 +31828,10 @@ class Test_TC_APPLAUNCHER_3_8Suite : public TestCommand VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, @@ -31945,9 +31951,10 @@ class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = + value.application.Value().catalogVendorID = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.Value().applicationID = mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, @@ -54459,7 +54466,8 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable + chip::app::DataModel::Nullable< + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNull("currentApp", value)); @@ -54471,7 +54479,9 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueAsString("data", value.data, chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); } break; case 4: @@ -54480,7 +54490,9 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueAsString("data", value.data, chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); } break; case 5: @@ -54489,7 +54501,9 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueAsString("data", value.data, chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("data"), 4))); } break; default: @@ -54534,9 +54548,10 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand LogStep(3, "Launch App Command"); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = 123U; - value.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); value.data.Emplace(); value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("datagarbage: not in length on purpose"), 4); @@ -54549,9 +54564,10 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand LogStep(4, "Stop App Command"); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = 123U; - value.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, value, chip::NullOptional @@ -54562,9 +54578,10 @@ class TV_ApplicationLauncherClusterSuite : public TestCommand LogStep(5, "Hide App Command"); ListFreer listFreer; chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; + value.application.Emplace(); - value.application.catalogVendorId = 123U; - value.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); + value.application.Value().catalogVendorID = 123U; + value.application.Value().applicationID = chip::Span("applicationIdgarbage: not in length on purpose", 13); return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, value, chip::NullOptional diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 5c1a0baefe529e..df076cdad399d6 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -74020,11 +74020,15 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { __auto_type * params = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.application = [MTRApplicationLauncherClusterApplication new]; - params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; - params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() - length:mRequest.application.applicationId.size() - encoding:NSUTF8StringEncoding]; + if (mRequest.application.HasValue()) { + params.application = [MTRApplicationLauncherClusterApplicationStruct new]; + params.application.catalogVendorID = [NSNumber numberWithUnsignedShort:mRequest.application.Value().catalogVendorID]; + params.application.applicationID = [[NSString alloc] initWithBytes:mRequest.application.Value().applicationID.data() + length:mRequest.application.Value().applicationID.size() + encoding:NSUTF8StringEncoding]; + } else { + params.application = nil; + } if (mRequest.data.HasValue()) { params.data = [NSData dataWithBytes:mRequest.data.Value().data() length:mRequest.data.Value().size()]; } else { @@ -74052,7 +74056,8 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { private: chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /* @@ -74079,11 +74084,15 @@ class ApplicationLauncherStopApp : public ClusterCommand { __auto_type * params = [[MTRApplicationLauncherClusterStopAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.application = [MTRApplicationLauncherClusterApplication new]; - params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; - params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() - length:mRequest.application.applicationId.size() - encoding:NSUTF8StringEncoding]; + if (mRequest.application.HasValue()) { + params.application = [MTRApplicationLauncherClusterApplicationStruct new]; + params.application.catalogVendorID = [NSNumber numberWithUnsignedShort:mRequest.application.Value().catalogVendorID]; + params.application.applicationID = [[NSString alloc] initWithBytes:mRequest.application.Value().applicationID.data() + length:mRequest.application.Value().applicationID.size() + encoding:NSUTF8StringEncoding]; + } else { + params.application = nil; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -74106,7 +74115,8 @@ class ApplicationLauncherStopApp : public ClusterCommand { private: chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /* @@ -74133,11 +74143,15 @@ class ApplicationLauncherHideApp : public ClusterCommand { __auto_type * params = [[MTRApplicationLauncherClusterHideAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.application = [MTRApplicationLauncherClusterApplication new]; - params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; - params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() - length:mRequest.application.applicationId.size() - encoding:NSUTF8StringEncoding]; + if (mRequest.application.HasValue()) { + params.application = [MTRApplicationLauncherClusterApplicationStruct new]; + params.application.catalogVendorID = [NSNumber numberWithUnsignedShort:mRequest.application.Value().catalogVendorID]; + params.application.applicationID = [[NSString alloc] initWithBytes:mRequest.application.Value().applicationID.data() + length:mRequest.application.Value().applicationID.size() + encoding:NSUTF8StringEncoding]; + } else { + params.application = nil; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -74160,7 +74174,8 @@ class ApplicationLauncherHideApp : public ClusterCommand { private: chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; - TypedComplexArgument mComplex_Application; + TypedComplexArgument> + mComplex_Application; }; /* @@ -74254,7 +74269,7 @@ class ReadApplicationLauncherCurrentApp : public ReadAttribute { endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentAppWithCompletion:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); if (error != nil) { LogNSError("ApplicationLauncher CurrentApp read Error", error); @@ -74289,15 +74304,15 @@ class WriteApplicationLauncherCurrentApp : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - MTRApplicationLauncherClusterApplicationEP * _Nullable value; + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; if (mValue.IsNull()) { value = nil; } else { - value = [MTRApplicationLauncherClusterApplicationEP new]; - value.application = [MTRApplicationLauncherClusterApplication new]; - value.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mValue.Value().application.catalogVendorId]; - value.application.applicationId = [[NSString alloc] initWithBytes:mValue.Value().application.applicationId.data() - length:mValue.Value().application.applicationId.size() + value = [MTRApplicationLauncherClusterApplicationEPStruct new]; + value.application = [MTRApplicationLauncherClusterApplicationStruct new]; + value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:mValue.Value().application.catalogVendorID]; + value.application.applicationID = [[NSString alloc] initWithBytes:mValue.Value().application.applicationID.data() + length:mValue.Value().application.applicationID.size() encoding:NSUTF8StringEncoding]; if (mValue.Value().endpoint.HasValue()) { value.endpoint = [NSNumber numberWithUnsignedShort:mValue.Value().endpoint.Value()]; @@ -74318,8 +74333,9 @@ class WriteApplicationLauncherCurrentApp : public WriteAttribute { } private: - chip::app::DataModel::Nullable mValue; - TypedComplexArgument> + chip::app::DataModel::Nullable mValue; + TypedComplexArgument< + chip::app::DataModel::Nullable> mComplex; }; @@ -74353,7 +74369,7 @@ class SubscribeAttributeApplicationLauncherCurrentApp : public SubscribeAttribut subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error) { + reportHandler:^(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); SetCommandExitStatus(error); }]; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index ff2f91facc4c13..d3dedf286e8655 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -40912,11 +40912,11 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; - params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; - ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = mCatalogVendorId.HasValue() + params.application = [[MTRApplicationLauncherClusterApplicationStruct alloc] init]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).catalogVendorID = mCatalogVendorId.HasValue() ? [NSNumber numberWithUnsignedShort:mCatalogVendorId.Value()] : [NSNumber numberWithUnsignedShort:123U]; - ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = mApplicationId.HasValue() + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).applicationID = mApplicationId.HasValue() ? [[NSString alloc] initWithBytes:mApplicationId.Value().data() length:mApplicationId.Value().size() encoding:NSUTF8StringEncoding] @@ -40932,7 +40932,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); } NextTest(); @@ -41993,7 +41993,7 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentAppWithCompletion:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable err) { NSLog(@"TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, which should " @"include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is no current " @"in-focus application Error: %@", @@ -73593,7 +73593,7 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentAppWithCompletion:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable err) { NSLog(@"Read attribute application launcher app Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -73620,9 +73620,10 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; - params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; - ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = [NSNumber numberWithUnsignedShort:123U]; - ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + params.application = [[MTRApplicationLauncherClusterApplicationStruct alloc] init]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).catalogVendorID = + [NSNumber numberWithUnsignedShort:123U]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).applicationID = @"applicationId"; params.data = [[NSData alloc] initWithBytes:"data" length:4]; [cluster @@ -73634,13 +73635,13 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); } { id actualValue = values.data; VerifyOrReturn( - CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + CheckValueAsString("Data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); } NextTest(); @@ -73660,9 +73661,10 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRApplicationLauncherClusterStopAppParams alloc] init]; - params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; - ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = [NSNumber numberWithUnsignedShort:123U]; - ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + params.application = [[MTRApplicationLauncherClusterApplicationStruct alloc] init]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).catalogVendorID = + [NSNumber numberWithUnsignedShort:123U]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).applicationID = @"applicationId"; [cluster stopAppWithParams:params @@ -73673,12 +73675,12 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); } { id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + VerifyOrReturn(CheckValueAsString("Data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); } NextTest(); @@ -73698,9 +73700,10 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRApplicationLauncherClusterHideAppParams alloc] init]; - params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; - ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = [NSNumber numberWithUnsignedShort:123U]; - ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + params.application = [[MTRApplicationLauncherClusterApplicationStruct alloc] init]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).catalogVendorID = + [NSNumber numberWithUnsignedShort:123U]; + ((MTRApplicationLauncherClusterApplicationStruct *) params.application).applicationID = @"applicationId"; [cluster hideAppWithParams:params @@ -73711,12 +73714,12 @@ class TV_ApplicationLauncherCluster : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); } { id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + VerifyOrReturn(CheckValueAsString("Data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); } NextTest();