diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2017-07-25 11:17:06 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2017-07-25 11:17:06 -0400 |
commit | 64bfd2c583784a7239b0cb641b5c9d448169675c (patch) | |
tree | 84233af9c784f7f029afa3e34b31c5df13a86f39 /src/components/config_profile | |
parent | 67966b50aa3a1ab95ea6d6fd591ddfdff5977ef7 (diff) | |
download | sdl_core-64bfd2c583784a7239b0cb641b5c9d448169675c.tar.gz |
Add protocol version 5 with service-specific MTU
Diffstat (limited to 'src/components/config_profile')
-rw-r--r-- | src/components/config_profile/include/config_profile/profile.h | 18 | ||||
-rw-r--r-- | src/components/config_profile/src/profile.cc | 79 |
2 files changed, 97 insertions, 0 deletions
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 42b0d10ceb..b9b162bcb1 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -130,6 +130,19 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, const uint32_t& app_icons_amount_to_remove() const OVERRIDE; /** + * @brief Returns true, if SDL protocol v5 is enabled + */ + bool enable_protocol_5() const OVERRIDE; + + size_t maximum_control_payload_size() const OVERRIDE; + + size_t maximum_rpc_payload_size() const OVERRIDE; + + size_t maximum_audio_payload_size() const OVERRIDE; + + size_t maximum_video_payload_size() const OVERRIDE; + + /** * @brief Returns the path to the config file */ const std::string& config_file_name() const; @@ -763,6 +776,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, std::string app_icons_folder_; uint32_t app_icons_folder_max_size_; uint32_t app_icons_amount_to_remove_; + bool enable_protocol_5_; + size_t maximum_control_payload_size_; + size_t maximum_rpc_payload_size_; + size_t maximum_audio_payload_size_; + size_t maximum_video_payload_size_; std::string config_file_name_; std::string server_address_; uint16_t server_port_; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index beabc6afa8..09af180f2d 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -85,6 +85,7 @@ const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS"; const char* kIAPSection = "IAP"; const char* kProtocolHandlerSection = "ProtocolHandler"; const char* kSDL4Section = "SDL4"; +const char* kSDL5Section = "SDL5"; const char* kResumptionSection = "Resumption"; const char* kAppLaunchSection = "AppLaunch"; @@ -104,6 +105,11 @@ const char* kEnableProtocol4Key = "EnableProtocol4"; const char* kAppIconsFolderKey = "AppIconsFolder"; const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize"; const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove"; +const char* kEnableProtocol5Key = "EnableProtocol5"; +const char* kMaximumControlPayloadSizeKey = "MaximumControlPayloadSize"; +const char* kMaximumRpcPayloadSizeKey = "MaximumRpcPayloadSize"; +const char* kMaximumAudioPayloadSizeKey = "MaximumAudioPayloadSize"; +const char* kMaximumVideoPayloadSizeKey = "MaximumVideoPayloadSize"; const char* kLaunchHMIKey = "LaunchHMI"; const char* kDefaultSDLVersion = ""; #ifdef WEB_HMI @@ -286,6 +292,10 @@ const uint16_t kDefaultOpenAttemptTimeoutMs = 500; const uint32_t kDefaultAppIconsFolderMaxSize = 104857600; const uint32_t kDefaultAppIconsAmountToRemove = 1; const uint16_t kDefaultAttemptsToOpenResumptionDB = 5; +const size_t kDefaultMaximumControlPayloadSize = 0; +const size_t kDefaultMaximumRpcPayloadSize = 0; +const size_t kDefaultMaximumAudioPayloadSize = 0; +const size_t kDefaultMaximumVideoPayloadSize = 0; const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500; const uint16_t kDefaultAppLaunchWaitTime = 5000; const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3; @@ -317,6 +327,11 @@ Profile::Profile() , app_icons_folder_() , app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize) , app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove) + , enable_protocol_5_(false) + , maximum_control_payload_size_(kDefaultMaximumControlPayloadSize) + , maximum_rpc_payload_size_(kDefaultMaximumRpcPayloadSize) + , maximum_audio_payload_size_(kDefaultMaximumAudioPayloadSize) + , maximum_video_payload_size_(kDefaultMaximumVideoPayloadSize) , config_file_name_(kDefaultConfigFileName) , server_address_(kDefaultServerAddress) , server_port_(kDefaultServerPort) @@ -454,6 +469,26 @@ const uint32_t& Profile::app_icons_amount_to_remove() const { return app_icons_amount_to_remove_; } +bool Profile::enable_protocol_5() const { + return enable_protocol_5_; +} + +size_t Profile::maximum_control_payload_size() const { + return maximum_control_payload_size_; +} + +size_t Profile::maximum_rpc_payload_size() const { + return maximum_rpc_payload_size_; +} + +size_t Profile::maximum_audio_payload_size() const { + return maximum_audio_payload_size_; +} + +size_t Profile::maximum_video_payload_size() const { + return maximum_video_payload_size_; +} + const std::string& Profile::hmi_capabilities_file_name() const { return hmi_capabilities_file_name_; } @@ -1053,6 +1088,50 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE( app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section); + // Enable protocol ver.4 parameter + std::string enable_protocol_5_value; + if (ReadValue(&enable_protocol_5_value, kSDL5Section, kEnableProtocol5Key) && + 0 == strcmp("true", enable_protocol_5_value.c_str())) { + enable_protocol_5_ = true; + } else { + enable_protocol_5_ = false; + } + + LOG_UPDATED_BOOL_VALUE(enable_protocol_5_, kEnableProtocol5Key, kSDL5Section); + + ReadUIntValue(&maximum_control_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumControlPayloadSizeKey); + + LOG_UPDATED_VALUE(maximum_control_payload_size_, + kMaximumControlPayloadSizeKey, + kSDL5Section); + + ReadUIntValue(&maximum_rpc_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumRpcPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_rpc_payload_size_, kMaximumRpcPayloadSizeKey, kSDL5Section); + + ReadUIntValue(&maximum_audio_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumAudioPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_audio_payload_size_, kMaximumAudioPayloadSizeKey, kSDL5Section); + + ReadUIntValue(&maximum_video_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumVideoPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_video_payload_size_, kMaximumVideoPayloadSizeKey, kSDL5Section); + // Application info file name ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName, |