summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-10-15 15:46:17 -0400
committerGitHub <noreply@github.com>2018-10-15 15:46:17 -0400
commita79f04439de495787f660019859d46eede5b07e2 (patch)
tree68b1530373ba66cc6d924fad23183cf03a303f79
parent1ef06f5ad10ab978358a68153075748b8c78062c (diff)
parentc751be354395d109c2d1105d290e92ae8b29ec3d (diff)
downloadsdl_core-a79f04439de495787f660019859d46eede5b07e2.tar.gz
Merge pull request #2680 from smartdevicelink/fix/update_rpc_versioning_logic
Update versioning logic to check for < version 5.0.0
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc2
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc2
-rw-r--r--src/components/include/utils/semantic_version.h1
-rw-r--r--src/components/utils/src/semantic_version.cc1
9 files changed, 10 insertions, 8 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
index 911d7faaff..79fb1f4272 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
@@ -166,7 +166,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][hmi_response::button_name].asInt());
if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
- app->msg_version() <= utils::base_rpc_version) {
+ app->msg_version() < utils::rpc_version_5) {
btn_id = mobile_apis::ButtonName::OK;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
index 9ca662389d..c73f2b4b98 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
@@ -174,7 +174,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][hmi_response::button_name].asInt());
if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
- app->msg_version() <= utils::base_rpc_version) {
+ app->msg_version() < utils::rpc_version_5) {
btn_id = mobile_apis::ButtonName::OK;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
index bc36b85db3..7957d9e055 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -334,9 +334,9 @@ void RegisterAppInterfaceRequest::Run() {
// Version negotiation
utils::SemanticVersion module_version(
major_version, minor_version, patch_version);
- if (mobile_version <= utils::base_rpc_version) {
+ if (mobile_version < utils::rpc_version_5) {
// Mobile versioning did not exist for
- // versions 4.5 and prior.
+ // versions before 5.0
application->set_msg_version(utils::base_rpc_version);
} else if (mobile_version < module_version) {
// Use mobile RPC version as negotiated version
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
index 3972aab3a8..584d7db075 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
@@ -63,7 +63,7 @@ void RegisterAppInterfaceResponse::Run() {
application_manager::ApplicationSharedPtr app =
application_manager_.application(connection_key());
- if (app && app->msg_version() <= utils::base_rpc_version &&
+ if (app && app->msg_version() < utils::rpc_version_5 &&
app->is_media_application() &&
(*message_)[strings::msg_params].keyExists(
hmi_response::button_capabilities)) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
index 7ee15d9119..f76b6ab210 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
@@ -77,7 +77,7 @@ void SubscribeButtonRequest::Run() {
return;
}
- if (app->msg_version() <= utils::base_rpc_version &&
+ if (app->msg_version() < utils::rpc_version_5 &&
btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
bool play_pause_supported =
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
index f914182e5b..0c30f567b4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
@@ -72,7 +72,7 @@ void UnsubscribeButtonRequest::Run() {
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[str::msg_params][str::button_name].asInt());
- if (app->msg_version() <= utils::base_rpc_version &&
+ if (app->msg_version() < utils::rpc_version_5 &&
btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
bool play_pause_supported =
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index a33da0708f..939b3d1ce6 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -219,7 +219,7 @@ void RPCHandlerImpl::GetMessageVersion(
}
utils::SemanticVersion temp_version(major, minor, patch);
if (temp_version.isValid()) {
- message_version = (temp_version > utils::base_rpc_version)
+ message_version = (temp_version >= utils::rpc_version_5)
? temp_version
: utils::base_rpc_version;
}
diff --git a/src/components/include/utils/semantic_version.h b/src/components/include/utils/semantic_version.h
index ecd7a98de2..5fe7ce1deb 100644
--- a/src/components/include/utils/semantic_version.h
+++ b/src/components/include/utils/semantic_version.h
@@ -119,6 +119,7 @@ struct SemanticVersion {
};
extern const SemanticVersion base_rpc_version;
+extern const SemanticVersion rpc_version_5;
}
#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H \ No newline at end of file
diff --git a/src/components/utils/src/semantic_version.cc b/src/components/utils/src/semantic_version.cc
index b7cf818791..9f0991e991 100644
--- a/src/components/utils/src/semantic_version.cc
+++ b/src/components/utils/src/semantic_version.cc
@@ -34,5 +34,6 @@
namespace utils {
const SemanticVersion base_rpc_version(4, 5, 1);
+const SemanticVersion rpc_version_5(5, 0, 0);
} // namespace utils \ No newline at end of file