summaryrefslogtreecommitdiff
path: root/src/components/config_profile
diff options
context:
space:
mode:
authorFrank Ronneburg <fronneburg@xevo.com>2018-04-05 02:23:53 +0900
committerfronneburg <fronneburg@xevo.com>2018-04-04 14:21:54 -0700
commit926e8db70ceae88a4b11a028d9c37abbee9208e9 (patch)
treefb39df593691eb6638f5dbd8f3880326803b902b /src/components/config_profile
parent7c88e20d4a6183e035a475def655c2aa0242187b (diff)
downloadsdl_core-926e8db70ceae88a4b11a028d9c37abbee9208e9.tar.gz
Merge pull request #231 in NAR/sdl-core from feat/config_for_secondary_transports to feature/Ford-WiFi
* commit '85f353fb31d336661fd34358f9e56d426626212a': configuration for secondary transports provide access to the connection device_type through the connection_handler
Diffstat (limited to 'src/components/config_profile')
-rw-r--r--src/components/config_profile/include/config_profile/profile.h48
-rw-r--r--src/components/config_profile/src/profile.cc51
2 files changed, 88 insertions, 11 deletions
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 7baa5d992f..e3f65b5a0f 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -472,17 +472,37 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
size_t update_before_hours() const;
#endif // ENABLE_SECURITY
- /**
- * @brief Reads a string value from the profile
- *
- * @param value Result value
- * @param default_value Value to use key wasn't found
- * @param pSection The section to read the value in
- * @param pKey The key whose value needs to be read out
- *
- * @return FALSE if could not read the value out of the profile
- * (then the value is equal \c default_value)
- */
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ const bool multiple_transports_enabled() const;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ const std::vector<std::string>& secondary_transports_for_bluetooth() const;
+ const std::vector<std::string>& secondary_transports_for_usb() const;
+ const std::vector<std::string>& secondary_transports_for_wifi() const;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ const std::vector<std::string>& audio_service_transports() const;
+ const std::vector<std::string>& video_service_transports() const;
+
+ /**
+ * @brief Reads a string value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
bool ReadStringValue(std::string* value,
const char* default_value,
const char* const pSection,
@@ -935,6 +955,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool enable_app_launch_ios_;
uint32_t app_tranport_change_timer_;
uint32_t app_tranport_change_timer_addition_;
+ bool multiple_transports_enabled_;
+ std::vector<std::string> secondary_transports_for_bluetooth_;
+ std::vector<std::string> secondary_transports_for_usb_;
+ std::vector<std::string> secondary_transports_for_wifi_;
+ std::vector<std::string> audio_service_transports_;
+ std::vector<std::string> video_service_transports_;
bool error_occured_;
std::string error_description_;
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 44e4548674..95ec94510f 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -88,6 +88,8 @@ const char* kSDL4Section = "SDL4";
const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
+const char* kMultipleTransportsSection = "MultipleTransports";
+const char* kServicesMapSection = "ServicesMap";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -215,6 +217,12 @@ const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
const char* kAppTransportChangeTimerKey = "AppTransportChangeTimer";
const char* kAppTransportChangeTimerAdditionKey =
"AppTransportChangeTimerAddition";
+const char* kMultipleTransportsEnabledKey = "MultipleTransportsEnabled";
+const char* kSecondaryTransportForBluetoothKey = "SecondaryTransportForBluetooth";
+const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB";
+const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi";
+const char* kAudioServiceTransportsKey = "AudioServiceTransports";
+const char* kVideoServiceTransportsKey = "VideoServiceTransports";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -313,6 +321,7 @@ const uint32_t kDefaultAppTransportChangeTimer = 500u;
const uint32_t kDefaultAppTransportChangeTimerAddition = 0u;
const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
+const bool kDefaultMultipleTransportsEnabled = true;
} // namespace
namespace profile {
@@ -942,6 +951,30 @@ const uint16_t Profile::wait_time_between_apps() const {
return wait_time_between_apps_;
}
+const bool Profile::multiple_transports_enabled() const {
+ return multiple_transports_enabled_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_bluetooth() const {
+ return secondary_transports_for_bluetooth_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_usb() const {
+ return secondary_transports_for_usb_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_wifi() const {
+ return secondary_transports_for_wifi_;
+}
+
+const std::vector<std::string>& Profile::audio_service_transports() const {
+ return audio_service_transports_;
+}
+
+const std::vector<std::string>& Profile::video_service_transports() const {
+ return video_service_transports_;
+}
+
const bool Profile::ErrorOccured() const {
return error_occured_;
}
@@ -1934,6 +1967,23 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(app_tranport_change_timer_addition_,
kAppTransportChangeTimerAdditionKey,
kMainSection);
+
+ ReadBoolValue(&multiple_transports_enabled_,
+ kDefaultMultipleTransportsEnabled,
+ kMultipleTransportsSection,
+ kMultipleTransportsEnabledKey);
+
+ LOG_UPDATED_BOOL_VALUE(
+ multiple_transports_enabled_, kMultipleTransportsEnabledKey, kMultipleTransportsSection);
+
+ // Secondary Transports
+ secondary_transports_for_bluetooth_ = ReadStringContainer(kMultipleTransportsSection, kSecondaryTransportForBluetoothKey, NULL);
+ secondary_transports_for_usb_ = ReadStringContainer(kMultipleTransportsSection, kSecondaryTransportForUSBKey, NULL);
+ secondary_transports_for_wifi_ = ReadStringContainer(kMultipleTransportsSection, kSecondaryTransportForWiFiKey, NULL);
+
+ // Services Map
+ audio_service_transports_ = ReadStringContainer(kServicesMapSection, kAudioServiceTransportsKey, NULL);
+ video_service_transports_ = ReadStringContainer(kServicesMapSection, kVideoServiceTransportsKey, NULL);
}
bool Profile::ReadValue(bool* value,
@@ -2061,6 +2111,7 @@ std::vector<std::string> Profile::ReadStringContainer(
if (!getline(iss, temp_str, ','))
break;
value_container.push_back(temp_str);
+ LOG_UPDATED_VALUE(temp_str, pKey, pSection);
}
}
return value_container;