diff options
author | Conlain Kelly <conlain.k@gmail.com> | 2018-07-24 15:00:02 -0400 |
---|---|---|
committer | Conlain Kelly <conlain.k@gmail.com> | 2018-07-24 15:00:02 -0400 |
commit | 0ed004d9a7f961ccb964851dff1266949ebea1ee (patch) | |
tree | 4d7c3f870b718d4c04e7ecc00c1e11bb0e2d3ba7 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src | |
parent | 28246b04368088a1ebd11e3c1b6885cace6e643b (diff) | |
download | sdl_core-0ed004d9a7f961ccb964851dff1266949ebea1ee.tar.gz |
Cleanup, remove some typos
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src')
2 files changed, 16 insertions, 32 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index 48f15aafda..91ef7c3bbd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -120,41 +120,30 @@ void CreateInteractionChoiceSetRequest::Run() { } + Result::eType result = CheckChoiceSet(app); + if (Result::SUCCESS != result) { + SendResponse(false, result); + return; + } int vr_status = MessageHelper::CheckChoiceSet_VRCommands((*message_)[strings::msg_params][strings::choice_set]); if (vr_status == -1) { - std::cerr << "choice set has invalid MIXED set of VR parameters" << '\n'; // this is an error SendResponse(false, Result::INVALID_DATA, "Some choices don't contain VR commands. Either all or none must have voice commands."); return; // exit now, this is a bad set } else if (vr_status == 0) { - std::cerr << "choice set has valid FULL set of VR parameters" << '\n'; - } else { - std::cerr << "choice set has valid EMPTY set of VR parameters" << '\n'; - } - - Result::eType result = CheckChoiceSet(app); - if (Result::SUCCESS != result) { - SendResponse(false, result); - return; - } - if (vr_status == 0) { - std::cerr << "creating grammar\n"; // everyone had a vr command, setup the grammar uint32_t grammar_id = application_manager_.GenerateGrammarID(); (*message_)[strings::msg_params][strings::grammar_id] = grammar_id; } // continue on as usual - std::cerr << "adding choice set\n"; app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]); - std::cerr << "added! choice set\n"; if (vr_status == 0) { + // we have VR commands SendVRAddCommandRequests(app); - std::cerr << "requests sent!!!!\n"; } else { SendResponse(true, Result::SUCCESS); - } } @@ -204,7 +193,6 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms( // only compare if they both have vr commands if (!(choice1.keyExists(strings::vr_commands) && choice2.keyExists(strings::vr_commands))) { - std::cerr << "someone is empty!\n"; return false; // clearly there isn't a duplicate if one of them is null } smart_objects::SmartArray* vr_cmds_1 = choice1[strings::vr_commands].asArray(); 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 6a55936bcc..98b5d96bb5 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 @@ -354,15 +354,15 @@ bool PerformInteractionRequest::ProcessVRResponse( const SmartObject& hmi_msg_params = message[strings::msg_params]; if (hmi_msg_params.keyExists(strings::choice_id)) { - const int choise_id = hmi_msg_params[strings::choice_id].asInt(); - if (!CheckChoiceIDFromResponse(app, choise_id)) { + const int choice_id = hmi_msg_params[strings::choice_id].asInt(); + if (!CheckChoiceIDFromResponse(app, choice_id)) { LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI"); TerminatePerformInteraction(); SendResponse( false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI"); return true; } - msg_params[strings::choice_id] = choise_id; + msg_params[strings::choice_id] = choice_id; } return false; } @@ -538,7 +538,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_list[i].asInt()); if (!choice_set) { - LOG4CXX_WARN(logger_, "Couldn't found choiset"); + LOG4CXX_WARN(logger_, "Couldn't found choiceset"); continue; } msg_params[strings::grammar_id][grammar_id_index++] = @@ -962,27 +962,23 @@ bool PerformInteractionRequest::CheckChoiceSetList_VRCommands( smart_objects::SmartObject* choice_set = nullptr; 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 + // this should never ever happen since this was already checked if (choice_set == nullptr) { - std::cerr << "bad choice set list!\n"; + LOG4CXX_ERROR( + logger_, + "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); 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"; // if not all choices have vr commands if (vr_status != 0) { - std::cerr << "choice set has member missing vr commands\n"; LOG4CXX_ERROR(logger_, "PerformInteraction has choice sets with " "missing vrCommands, not in MANUAL_ONLY mode"); @@ -1011,7 +1007,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( if (!choice_set) { LOG4CXX_ERROR( logger_, - "Couldn't find choiset_id = " << choice_set_id_list[i].asInt()); + "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); return false; } @@ -1024,7 +1020,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( choice_id_set.insert(choices_list[k][strings::choice_id].asInt()); if (!ins_res.second) { LOG4CXX_ERROR(logger_, - "Choise with ID " + "choice with ID " << choices_list[k][strings::choice_id].asInt() << " already exists"); return false; |