summaryrefslogtreecommitdiff
path: root/src/components/config_profile
diff options
context:
space:
mode:
authorDmitriy Klimenko <dklimenko@luxoft.com>2015-06-08 14:48:11 -0700
committerAndrey Oleynik <aoleynik@luxoft.com>2015-08-31 12:05:14 +0300
commit66c7aba6abd5c6f23ba3bff146cb1820fb32d624 (patch)
treeadc8d50586a4b3c640d94b7f37a450f5b9c219e5 /src/components/config_profile
parentfeb79e262c6355a6a7d5b44e301a18bedf2d4160 (diff)
downloadsdl_core-66c7aba6abd5c6f23ba3bff146cb1820fb32d624.tar.gz
APPLINK--11284 Return SDL & System Software Version In RAI
Conflicts: src/appMain/smartDeviceLink.ini src/components/application_manager/include/application_manager/hmi_capabilities.h src/components/application_manager/src/commands/hmi/get_system_info_response.cc src/components/application_manager/src/hmi_capabilities.cc src/components/config_profile/src/profile.cc
Diffstat (limited to 'src/components/config_profile')
-rw-r--r--src/components/config_profile/include/config_profile/profile.h7
-rw-r--r--src/components/config_profile/src/profile.cc19
2 files changed, 25 insertions, 1 deletions
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index c372109c29..6a43cafdd3 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -58,6 +58,12 @@ class Profile : public utils::Singleton<Profile> {
virtual ~Profile();
/**
+ * @brief Returns sdl version represented
+ * by git commit or value specified by user
+ */
+ const std::string& sdl_version() const;
+
+ /**
* @brief Returns true if HMI should be started, otherwise false
*/
bool launch_hmi() const;
@@ -618,6 +624,7 @@ class Profile : public utils::Singleton<Profile> {
bool StringToNumber(const std::string& input, uint64_t& output) const;
private:
+ std::string sdl_version_;
bool launch_hmi_;
#ifdef WEB_HMI
std::string link_to_web_hmi_;
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 4b6c2b4809..a1f8b43561 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -73,6 +73,7 @@ const char* kProtocolHandlerSection = "ProtocolHandler";
const char* kSDL4Section = "SDL4";
const char* kResumptionSection = "Resumption";
+const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
const char* kPathToSnapshotKey = "PathToSnapshot";
const char* kPreloadedPTKey = "PreloadedPT";
@@ -165,6 +166,7 @@ const char* kHashStringSizeKey = "HashStringSize";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
+const char* kDefaultSDLVersion = "";
const char* kDefaultPoliciesSnapshotFileName = "sdl_snapshot.json";
const char* kDefaultHmiCapabilitiesFileName = "hmi_capabilities.json";
const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json";
@@ -243,6 +245,7 @@ Profile::Profile()
#ifdef WEB_HMI
link_to_web_hmi_(kDefaultLinkToWebHMI),
#endif // WEB_HMI
+ sdl_version_(kDefaultSDLVersion),
app_config_folder_(),
app_storage_folder_(),
app_resourse_folder_(),
@@ -306,8 +309,12 @@ Profile::Profile()
attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB),
open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB),
hash_string_size_(kDefaultHashStringSize) {
+ ReadStringValue(&sdl_version_, kDefaultSDLVersion,
+ kMainSection, kSDLVersionKey);
}
+
+
Profile::~Profile() {
}
@@ -322,6 +329,10 @@ const std::string& Profile::config_file_name() const {
return config_file_name_;
}
+const std::string& Profile::sdl_version() const {
+ return sdl_version_;
+}
+
bool Profile::launch_hmi() const {
return launch_hmi_;
}
@@ -685,6 +696,12 @@ uint16_t Profile::tts_global_properties_timeout() const {
void Profile::UpdateValues() {
LOG4CXX_AUTO_TRACE(logger_);
+ // SDL version
+ ReadStringValue(&sdl_version_, kDefaultSDLVersion,
+ kMainSection, kSDLVersionKey);
+
+ LOG_UPDATED_VALUE(sdl_version_, kSDLVersionKey, kMainSection);
+
// Launch HMI parameter
std::string launch_value;
if (ReadValue(&launch_value, kHmiSection, kLaunchHMIKey) &&
@@ -1374,7 +1391,7 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(iap_hub_connection_wait_timeout_,
kIAPHubConnectionWaitTimeoutKey, kIAPSection);
-
+
ReadUIntValue(&default_hub_protocol_index_, kDefaultHubProtocolIndex, kIAPSection, kDefaultHubProtocolIndexKey);
LOG_UPDATED_VALUE(default_hub_protocol_index_, kDefaultHubProtocolIndexKey, kIAPSection);