diff options
Diffstat (limited to 'src/components/config_profile/src/profile.cc')
-rw-r--r-- | src/components/config_profile/src/profile.cc | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 38afdbf35b..e5a32f4560 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -96,6 +96,7 @@ const char* kTransportRequiredForResumptionSection = "TransportRequiredForResumption"; const char* kLowBandwidthTransportResumptionLevelSection = "LowBandwidthTransportResumptionLevel"; +const char* kAppServicesSection = "AppServices"; const char* kSDLVersionKey = "SDLVersion"; const char* kHmiCapabilitiesKey = "HMICapabilities"; @@ -238,6 +239,7 @@ const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB"; const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi"; const char* kAudioServiceTransportsKey = "AudioServiceTransports"; const char* kVideoServiceTransportsKey = "VideoServiceTransports"; +const char* kRpcPassThroughTimeoutKey = "RpcPassThroughTimeout"; const char* kDefaultTransportRequiredForResumptionKey = "DefaultTransportRequiredForResumption"; @@ -284,6 +286,8 @@ const char* kProjectionLowBandwidthResumptionLevelKey = "ProjectionLowBandwidthResumptionLevel"; const char* kMediaLowBandwidthResumptionLevelKey = "MediaLowBandwidthResumptionLevel"; +const char* kHMIOriginIDKey = "HMIOriginID"; +const char* kEmbeddedServicesKey = "EmbeddedServices"; #ifdef WEB_HMI const char* kDefaultLinkToWebHMI = "HMI/index.html"; @@ -391,6 +395,8 @@ const std::string kAllowedSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"; const bool kDefaultMultipleTransportsEnabled = false; const char* kDefaultLowBandwidthResumptionLevel = "NONE"; +const uint32_t kDefaultRpcPassThroughTimeout = 10000; +const char* kDefaultHMIOriginId = "HMI_ID"; } // namespace namespace profile { @@ -506,7 +512,8 @@ Profile::Profile() , error_description_() , low_voltage_signal_offset_(kDefaultLowVoltageSignalOffset) , wake_up_signal_offset_(kDefaultWakeUpSignalOffset) - , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) { + , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) + , rpc_pass_through_timeout_(kDefaultRpcPassThroughTimeout) { // SDL version ReadStringValue( &sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey); @@ -1078,6 +1085,10 @@ const bool Profile::multiple_transports_enabled() const { return multiple_transports_enabled_; } +uint32_t Profile::rpc_pass_through_timeout() const { + return rpc_pass_through_timeout_; +} + const std::vector<std::string>& Profile::secondary_transports_for_bluetooth() const { return secondary_transports_for_bluetooth_; @@ -1114,6 +1125,14 @@ bool Profile::IsFileNamePortable(const std::string& file_name) const { return true; } +const std::vector<std::string>& Profile::embedded_services() const { + return embedded_services_; +} + +const std::string Profile::hmi_origin_id() const { + return hmi_origin_id_; +} + void Profile::UpdateValues() { LOG4CXX_AUTO_TRACE(logger_); @@ -2235,6 +2254,15 @@ void Profile::UpdateValues() { kMultipleTransportsEnabledKey, kMultipleTransportsSection); + ReadUIntValue(&rpc_pass_through_timeout_, + kDefaultRpcPassThroughTimeout, + kAppServicesSection, + kRpcPassThroughTimeoutKey); + + LOG_UPDATED_VALUE(rpc_pass_through_timeout_, + kRpcPassThroughTimeoutKey, + kAppServicesSection); + { // Secondary Transports and ServicesMap struct KeyPair { std::vector<std::string>* ini_vector; @@ -2278,6 +2306,44 @@ void Profile::UpdateValues() { entry++; } } + + ReadStringValue(&hmi_origin_id_, + kDefaultHMIOriginId, + kAppServicesSection, + kHMIOriginIDKey); + + LOG_UPDATED_VALUE(hmi_origin_id_, kHMIOriginIDKey, kAppServicesSection); + + { // App Services map + struct KeyPair { + std::vector<std::string>* ini_vector; + const char* ini_section_name; + const char* ini_key_name; + } keys[] = { + {&embedded_services_, kAppServicesSection, kEmbeddedServicesKey}, + {NULL, NULL, NULL}}; + struct KeyPair* entry = keys; + + while (entry->ini_vector != NULL) { + bool exist = false; + std::vector<std::string> profile_entry = ReadStringContainer( + entry->ini_section_name, entry->ini_key_name, &exist, true); + if (exist) { + *entry->ini_vector = profile_entry; + + const std::string list_with_comma = std::accumulate( + profile_entry.begin(), + profile_entry.end(), + std::string(""), + [](std::string& first, std::string& second) { + return first.empty() ? second : first + ", " + second; + }); + LOG_UPDATED_VALUE( + list_with_comma, entry->ini_key_name, entry->ini_section_name); + } + entry++; + } + } } bool Profile::ReadValue(bool* value, |