diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2019-04-08 20:17:13 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2019-04-08 20:17:13 -0400 |
commit | d73107ab5e6aff946532f18998f8f258861d2d08 (patch) | |
tree | e1e5bf4351370c68ac36753f776fe8895c4a237b | |
parent | 16b6f5c3424f6f303ffcc3c1c6661637e2385018 (diff) | |
download | sdl_core-d73107ab5e6aff946532f18998f8f258861d2d08.tar.gz |
Fix incorrectly sending enum value for resultCode if function ID is unknown
-rw-r--r-- | src/components/application_manager/src/rpc_service_impl.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index e88679b087..c55a16bc5f 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -138,9 +138,17 @@ bool RPCServiceImpl::ManageMobileCommand( connection_key, static_cast<int32_t>(function_id), correlation_id, - static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_REQUEST)); + 0); + + // Since we are dealing with an unknown RPC, there is no schema attached + // to the message, so we have to convert the result to string directly + std::string result_code; + smart_objects::EnumConversionHelper<mobile_apis::Result::eType>:: + EnumToString(mobile_apis::Result::UNSUPPORTED_REQUEST, &result_code); + (*response)[strings::msg_params][strings::result_code] = result_code; (*response)[strings::msg_params][strings::info] = "Module does not recognize this function id"; + SendMessageToMobile(response); } return false; |