diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index a610cd5e5f66b5..62ac56334bc2b0 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -822,18 +822,27 @@ Once the Casting Client has selected an `Endpoint`, it is ready to [issue commands](#issuing-commands) to it, [read](#read-operations) current playback state, and [subscribe](#subscriptions) to playback events. -Refer to the following platform specific files for a list of clusters, command -and attributes supported by the Matter TV Casting library: +On Linux refer to the following platform specific files: -1. Linux: +1. For list of clusters, command and attributes supported by the Matter TV + Casting library: [tv-casting-common/clusters/Clusters.h](tv-casting-common/clusters/Clusters.h) - -Refer to the following platform specific files for the IDs and request / -response types to use with these APIs: - -1. Linux: +2. For the IDs and request / response types to use with these APIs: [/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h](/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h) +On iOS refer to the following platform specific files: + +1. For list of clusters, command and attributes supported by the Matter TV + Casting library: + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h) +2. For the IDs and request / response types to use with these APIs: + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h) + and + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h) +3. For attribute [read operations](#read-operations) and + [subscriptions](#subscriptions): + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h) + ### Issuing Commands _{Complete Command invocation examples: [Linux](linux/simple-app-helper.cpp) | diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt index 60d63d5fb6fe12..612522a7ab4f65 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt @@ -71,10 +71,9 @@ {{>command_response_type command=.}} * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[{{>command_response_type command=.}} alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command getObjCResponseFromCpp() failed")); } return objCResponse; diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt index 51b6428d5ba67d..a3ed2bbb8ad2b5 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt @@ -107,8 +107,11 @@ NS_ASSUME_NONNULL_BEGIN {{/if}} {{#if (isStrEqual source "server")}} -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType cppDecodableStruct = *responseSharedPtr; + {{#zcl_command_arguments}} { {{>decode_value target=(concat "self." (asStructPropertyName label)) source=(concat "cppDecodableStruct." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="return err;" depth=0}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm index 7e70238fcb5c16..7c259ca8b49817 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm @@ -81,11 +81,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -134,11 +133,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -187,11 +185,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterToggleCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -240,11 +237,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffWithEffectCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -293,11 +289,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithRecallGlobalSceneCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -346,11 +341,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithTimedOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -401,11 +395,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -454,11 +447,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -507,11 +499,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -560,11 +551,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -613,11 +603,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelWithOnOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -666,11 +655,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveWithOnOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -719,11 +707,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepWithOnOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -772,11 +759,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopWithOnOffCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -825,11 +811,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToClosestFrequencyCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -882,11 +867,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCTargetNavigatorClusterNavigateTargetResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCTargetNavigatorClusterNavigateTargetResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCTargetNavigatorClusterNavigateTargetCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -937,11 +921,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPlayCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -990,11 +973,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPauseCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1043,11 +1025,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStopCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1096,11 +1077,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStartOverCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1149,11 +1129,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPreviousCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1202,11 +1181,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterNextCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1255,11 +1233,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterRewindCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1308,11 +1285,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterFastForwardCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1361,11 +1337,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipForwardCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1414,11 +1389,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipBackwardCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1467,11 +1441,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSeekCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1520,11 +1493,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateAudioTrackCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1573,11 +1545,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateTextTrackCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1626,11 +1597,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCNullObjectType * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCNullObjectType alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterDeactivateTextTrackCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1681,11 +1651,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCKeypadInputClusterSendKeyResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCKeypadInputClusterSendKeyResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCKeypadInputClusterSendKeyCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1736,11 +1705,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCContentLauncherClusterLauncherResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchContentCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1789,11 +1757,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCContentLauncherClusterLauncherResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchURLCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1844,11 +1811,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterLaunchAppCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1897,11 +1863,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterStopAppCommand getObjCResponseFromCpp() failed")); } return objCResponse; @@ -1950,11 +1915,10 @@ - (id)getObjCResponseFromCpp:(std::any)cppResponse MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; CHIP_ERROR err = CHIP_NO_ERROR; if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init]; // Set the ObjC response fields using the given cpp Response - err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterHideAppCommand getObjCResponseFromCpp() failed")); } return objCResponse; diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm index a5029e2b3b2a1c..a097ddb7b141c7 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm @@ -943,8 +943,11 @@ - (NSString *)description return CHIP_NO_ERROR; } -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + { self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; } @@ -1393,8 +1396,11 @@ - (NSString *)description return CHIP_NO_ERROR; } -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + { self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; } @@ -1660,8 +1666,11 @@ - (NSString *)description return CHIP_NO_ERROR; } -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + { self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; } @@ -1713,157 +1722,156 @@ - (NSString *)description chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type cppStruct; ListFreer listFreer; { - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (self.search.parameterList.count != 0) { - auto * listHolder_1 = new ListHolder(self.search.parameterList.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) { - if (![self.search.parameterList[i_1] isKindOfClass:[MCContentLauncherClusterParameterStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (MCContentLauncherClusterParameterStruct *) self.search.parameterList[i_1]; - listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); - listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); - if (element_1.externalIDList != nil) { - auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); - { - using ListType_4 = std::remove_reference_t; - using ListMemberType_4 = ListMemberTypeGetter::Type; - if (element_1.externalIDList.count != 0) { - auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); - if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { - if (![element_1.externalIDList[i_4] isKindOfClass:[MCContentLauncherClusterAdditionalInfoStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_4 = (MCContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; - listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); - listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); - } - definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); - } else { - definedValue_3 = ListType_4(); - } - } - } - } - cppStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); - } else { - cppStruct.search.parameterList = ListType_1(); - } + { using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.search.parameterList.count != 0) { + auto * listHolder_1 = new ListHolder(self.search.parameterList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; } - } - { - cppStruct.autoPlay = self.autoPlay.boolValue; - } - { - if (self.data != nil) { - auto & definedValue_0 = cppStruct.data.Emplace(); - definedValue_0 = AsCharSpan(self.data); - } - } - { - if (self.playbackPreferences != nil) { - auto & definedValue_0 = cppStruct.playbackPreferences.Emplace(); - definedValue_0.playbackPosition = self.playbackPreferences.playbackPosition.unsignedLongLongValue; - definedValue_0.textTrack.languageCode = AsCharSpan(self.playbackPreferences.textTrack.languageCode); - if (self.playbackPreferences.textTrack.characteristics != nil) { - auto & definedValue_3 = definedValue_0.textTrack.characteristics.Emplace(); + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) { + if (![self.search.parameterList[i_1] isKindOfClass:[MCContentLauncherClusterParameterStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MCContentLauncherClusterParameterStruct *) self.search.parameterList[i_1]; + listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); + listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); + if (element_1.externalIDList != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); { using ListType_4 = std::remove_reference_t; using ListMemberType_4 = ListMemberTypeGetter::Type; - if (self.playbackPreferences.textTrack.characteristics.count != 0) { - auto * listHolder_4 = new ListHolder(self.playbackPreferences.textTrack.characteristics.count); + if (element_1.externalIDList.count != 0) { + auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < self.playbackPreferences.textTrack.characteristics.count; ++i_4) { - if (![self.playbackPreferences.textTrack.characteristics[i_4] isKindOfClass:[NSNumber class]]) { + for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { + if (![element_1.externalIDList[i_4] isKindOfClass:[MCContentLauncherClusterAdditionalInfoStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_4 = (NSNumber *) self.playbackPreferences.textTrack.characteristics[i_4]; - listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + auto element_4 = (MCContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; + listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); + listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); } - definedValue_3 = ListType_4(listHolder_4->mList, self.playbackPreferences.textTrack.characteristics.count); + definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); } else { definedValue_3 = ListType_4(); } } } - definedValue_0.textTrack.audioOutputIndex = self.playbackPreferences.textTrack.audioOutputIndex.unsignedCharValue; - if (self.playbackPreferences.audioTracks != nil) { - auto & definedValue_2 = definedValue_0.audioTracks.Emplace(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (self.playbackPreferences.audioTracks.count != 0) { - auto * listHolder_3 = new ListHolder(self.playbackPreferences.audioTracks.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + } + cppStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); + } else { + cppStruct.search.parameterList = ListType_1(); + } +} +} +{ + cppStruct.autoPlay = self.autoPlay.boolValue; +} +{ + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } +} +{ + if (self.playbackPreferences != nil) { + auto & definedValue_0 = cppStruct.playbackPreferences.Emplace(); + definedValue_0.playbackPosition = self.playbackPreferences.playbackPosition.unsignedLongLongValue; + definedValue_0.textTrack.languageCode = AsCharSpan(self.playbackPreferences.textTrack.languageCode); + if (self.playbackPreferences.textTrack.characteristics != nil) { + auto & definedValue_3 = definedValue_0.textTrack.characteristics.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.textTrack.characteristics.count != 0) { + auto * listHolder_4 = new ListHolder(self.playbackPreferences.textTrack.characteristics.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < self.playbackPreferences.textTrack.characteristics.count; ++i_4) { + if (![self.playbackPreferences.textTrack.characteristics[i_4] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < self.playbackPreferences.audioTracks.count; ++i_3) { - if (![self.playbackPreferences.audioTracks[i_3] isKindOfClass:[MCContentLauncherClusterTrackPreferenceStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_3 = (MCContentLauncherClusterTrackPreferenceStruct *) self.playbackPreferences.audioTracks[i_3]; - listHolder_3->mList[i_3].languageCode = AsCharSpan(element_3.languageCode); - if (element_3.characteristics != nil) { - auto & definedValue_5 = listHolder_3->mList[i_3].characteristics.Emplace(); - { - using ListType_6 = std::remove_reference_t; - using ListMemberType_6 = ListMemberTypeGetter::Type; - if (element_3.characteristics.count != 0) { - auto * listHolder_6 = new ListHolder(element_3.characteristics.count); - if (listHolder_6 == nullptr || listHolder_6->mList == nullptr) { + auto element_4 = (NSNumber *) self.playbackPreferences.textTrack.characteristics[i_4]; + listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + } + definedValue_3 = ListType_4(listHolder_4->mList, self.playbackPreferences.textTrack.characteristics.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + definedValue_0.textTrack.audioOutputIndex = self.playbackPreferences.textTrack.audioOutputIndex.unsignedCharValue; + if (self.playbackPreferences.audioTracks != nil) { + auto & definedValue_2 = definedValue_0.audioTracks.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.audioTracks.count != 0) { + auto * listHolder_3 = new ListHolder(self.playbackPreferences.audioTracks.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < self.playbackPreferences.audioTracks.count; ++i_3) { + if (![self.playbackPreferences.audioTracks[i_3] isKindOfClass:[MCContentLauncherClusterTrackPreferenceStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MCContentLauncherClusterTrackPreferenceStruct *) self.playbackPreferences.audioTracks[i_3]; + listHolder_3->mList[i_3].languageCode = AsCharSpan(element_3.languageCode); + if (element_3.characteristics != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].characteristics.Emplace(); + { + using ListType_6 = std::remove_reference_t; + using ListMemberType_6 = ListMemberTypeGetter::Type; + if (element_3.characteristics.count != 0) { + auto * listHolder_6 = new ListHolder(element_3.characteristics.count); + if (listHolder_6 == nullptr || listHolder_6->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_6); + for (size_t i_6 = 0; i_6 < element_3.characteristics.count; ++i_6) { + if (![element_3.characteristics[i_6] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_6); - for (size_t i_6 = 0; i_6 < element_3.characteristics.count; ++i_6) { - if (![element_3.characteristics[i_6] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_6 = (NSNumber *) element_3.characteristics[i_6]; - listHolder_6->mList[i_6] = static_castmList[i_6])>>(element_6.unsignedCharValue); - } - definedValue_5 = ListType_6(listHolder_6->mList, element_3.characteristics.count); - } else { - definedValue_5 = ListType_6(); + auto element_6 = (NSNumber *) element_3.characteristics[i_6]; + listHolder_6->mList[i_6] = static_castmList[i_6])>>(element_6.unsignedCharValue); } + definedValue_5 = ListType_6(listHolder_6->mList, element_3.characteristics.count); + } else { + definedValue_5 = ListType_6(); } } - listHolder_3->mList[i_3].audioOutputIndex = element_3.audioOutputIndex.unsignedCharValue; } - definedValue_2 = ListType_3(listHolder_3->mList, self.playbackPreferences.audioTracks.count); - } else { - definedValue_2 = ListType_3(); + listHolder_3->mList[i_3].audioOutputIndex = element_3.audioOutputIndex.unsignedCharValue; } + definedValue_2 = ListType_3(listHolder_3->mList, self.playbackPreferences.audioTracks.count); + } else { + definedValue_2 = ListType_3(); } } } } - { - if (self.useCurrentContext != nil) { - auto & definedValue_0 = cppStruct.useCurrentContext.Emplace(); - definedValue_0 = self.useCurrentContext.boolValue; - } +} +{ + if (self.useCurrentContext != nil) { + auto & definedValue_0 = cppStruct.useCurrentContext.Emplace(); + definedValue_0 = self.useCurrentContext.boolValue; } +} - return std::any(cppStruct); +return std::any(cppStruct); } - (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct @@ -2053,8 +2061,11 @@ - (NSString *)description return CHIP_NO_ERROR; } -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + { self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; } @@ -2259,8 +2270,11 @@ - (NSString *)description return CHIP_NO_ERROR; } -- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)cppDecodableStruct +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + { self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; }