summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
diff options
context:
space:
mode:
authorConlain Kelly <conlain.k@gmail.com>2018-07-30 17:43:29 -0400
committerConlain Kelly <conlain.k@gmail.com>2018-07-30 17:43:29 -0400
commitdfcf5aecebd93a8b8e99d1f4e631f6a7eb47c74d (patch)
treeefbb22da93fc039926a61d54cd8749fe4092c6bd /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
parent1dc7bf3e56f927915c440ced3d102a2a53fb22db (diff)
downloadsdl_core-dfcf5aecebd93a8b8e99d1f4e631f6a7eb47c74d.tar.gz
general cleanup on vr commands checks
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc10
1 files changed, 5 insertions, 5 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 0d6114cc50..92c15afd6d 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
@@ -123,17 +123,16 @@ void CreateInteractionChoiceSetRequest::Run() {
SendResponse(false, result);
return;
}
- int vr_status = MessageHelper::CheckChoiceSet_VRCommands(
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(
(*message_)[strings::msg_params][strings::choice_set]);
- if (vr_status == -1) {
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::MIXED) {
// 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) {
+ } else if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
// everyone had a vr command, setup the grammar
uint32_t grammar_id = application_manager_.GenerateGrammarID();
(*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
@@ -141,10 +140,11 @@ void CreateInteractionChoiceSetRequest::Run() {
// continue on as usual
app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
- if (vr_status == 0) {
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
// we have VR commands
SendVRAddCommandRequests(app);
} else {
+ // we have none, just return with success
SendResponse(true, Result::SUCCESS);
}
}