diff options
author | Conlain Kelly <conlain.k@gmail.com> | 2018-07-24 10:49:24 -0400 |
---|---|---|
committer | Conlain Kelly <conlain.k@gmail.com> | 2018-07-24 10:49:24 -0400 |
commit | b5043f977fc861c581e7b912923847b0d85aea7c (patch) | |
tree | 7348276f75283e3e013ff7c1467b2d645e68cb3e | |
parent | 78e99ab9190fc62f34656e55ba29ff3ed7290877 (diff) | |
download | sdl_core-b5043f977fc861c581e7b912923847b0d85aea7c.tar.gz |
add perform interaction modifications
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 7753c16acf..5a614b73c4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -163,18 +163,18 @@ void PerformInteractionRequest::Run() { SendResponse(false, mobile_apis::Result::INVALID_ID); return; } - // if (!CheckChoiceSetList_VRCommands( - // app, - // choice_set_id_list_length, - // msg_params[strings::interaction_choice_set_id_list])) { - // LOG4CXX_ERROR(logger_, - // "PerformInteraction has choice sets with " - // "missing vrCommands"); - // SendResponse(false, - // mobile_apis::Result::INVALID_DATA, - // "Some choices don't contain VR commands."); - // return; - // } + if (!CheckChoiceSetList_VRCommands( + app, + choice_set_id_list_length, + msg_params[strings::interaction_choice_set_id_list])) { + LOG4CXX_ERROR(logger_, + "PerformInteraction has choice sets with " + "missing vrCommands"); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Some choices don't contain VR commands."); + return; + } if (msg_params.keyExists(strings::vr_help)) { if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems( @@ -964,17 +964,24 @@ bool PerformInteractionRequest::CheckChoiceSetList_VRCommands( std::pair<std::set<uint32_t>::iterator, bool> ins_res; for (size_t i = 0; i < choice_set_id_list_length; ++i) { + // std::cerr << "loop entered!\n"; choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt()); + // std::cerr << "set found!!\n"; + // this should never ever happen - // if (!choice_set) { - // LOG4CXX_ERROR( - // logger_, - // "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); - // return false; - // } + if (choice_set == nullptr) { + std::cerr << "bad choice set list!\n"; + return false; + } + // std::cerr<< "SMARTTYPE is " << choice_set->getType() << std::endl; + + // std::cerr << "checking status!!!\n"; + const smart_objects::SmartObject& choices_list = + (*choice_set)[strings::choice_set]; + int vr_status = MessageHelper::CheckChoiceSet_VRCommands(choices_list); + // std::cerr << "status checked!!!!\n"; - int vr_status = MessageHelper::CheckChoiceSet_VRCommands(*choice_set); // if not all choices have vr commands if (vr_status != 0) { std::cerr << "choice set has member missing vr commands\n"; @@ -1005,11 +1012,6 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( } - int vr_status = MessageHelper::CheckChoiceSet_VRCommands(*choice_set); - // if not all choices have vr commands - if (vr_status != 0) { - - } choice_list_length = (*choice_set)[strings::choice_set].length(); const smart_objects::SmartObject& choices_list = (*choice_set)[strings::choice_set]; |