summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Mamykin (GitHub) <33784535+YarikMamykin@users.noreply.github.com>2020-08-07 23:55:44 +0300
committerGitHub <noreply@github.com>2020-08-07 16:55:44 -0400
commitb46921b8b185b710f4ec5778b55c4b5055e9ca62 (patch)
treeea94270f01b44db9f1910af3cec0089f0bb7d3bf
parente3970a01836b6e2d2d4926cd18345b32bc788794 (diff)
downloadsdl_core-b46921b8b185b710f4ec5778b55c4b5055e9ca62.tar.gz
SDL Core implementation of feature - 0261 New vehicle data WindowStatus (#3391)
* Add window status related data types to HMI API * Update rpc_spec url to fork * Update MOBILE API in rpc_spec with WindowStatus data * Update SDL core with WindowState related data * Add/Update unit tests * Update preloaded json file * Add window status section to sdl_preloaded_pt.json * fixup! Update MOBILE API in rpc_spec with WindowStatus data * fixup! Add window status section to sdl_preloaded_pt.json * fixup! Add/Update unit tests * Update src/appMain/sdl_preloaded_pt.json Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com> * Update src/appMain/sdl_preloaded_pt.json Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com> * Update submodules Co-authored-by: YarikMamykin <ymamykin@gmail.com> Co-authored-by: LitvinenkoIra <ilytvynenko@luxoft.com> Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com> Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com>
-rw-r--r--src/appMain/sdl_preloaded_pt.json108
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h1
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc344
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc7
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc1
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc34
-rw-r--r--src/components/interfaces/HMI_API.xml37
7 files changed, 525 insertions, 7 deletions
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 0d42fdd8a3..860c83d2fc 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -592,7 +592,8 @@
"tirePressure",
"vin",
"wiperStatus",
- "stabilityControlsStatus"
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"OnVehicleData": {
@@ -618,7 +619,8 @@
"tirePressure",
"vin",
"wiperStatus",
- "stabilityControlsStatus"
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"SubscribeVehicleData": {
@@ -643,7 +645,8 @@
"odometer",
"tirePressure",
"wiperStatus",
- "stabilityControlsStatus"
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"UnsubscribeVehicleData": {
@@ -668,7 +671,8 @@
"odometer",
"tirePressure",
"wiperStatus",
- "stabilityControlsStatus"
+ "stabilityControlsStatus",
+ "windowStatus"
]
}
}
@@ -4009,6 +4013,102 @@
"since": "5.1"
},
{
+ "name": "windowStatus",
+ "params": [
+ {
+ "name": "location",
+ "params": [
+ {
+ "name": "col",
+ "key": "OEM_REF_WND_LOC_COL",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "row",
+ "key": "OEM_REF_WND_LOC_ROW",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "level",
+ "key": "OEM_REF_WND_LOC_LVL",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 0,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "colspan",
+ "key": "OEM_REF_WND_LOC_COLSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ },
+ {
+ "name": "rowspan",
+ "key": "OEM_REF_WND_LOC_ROWSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ },
+ {
+ "name": "levelspan",
+ "key": "OEM_REF_WND_LOC_LVLSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ }
+ ],
+ "key": "OEM_REF_WND_LOC",
+ "type": "Struct",
+ "mandatory": true
+ },
+ {
+ "name": "state",
+ "params": [
+ {
+ "name": "approximatePosition",
+ "key": "OEM_REF_WND_STATE_APRPOS",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": 0,
+ "maxvalue": 100
+ },
+ {
+ "name": "deviation",
+ "key": "OEM_REF_WND_STATE_DEV",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": 0,
+ "maxvalue": 100
+ }
+ ],
+ "key": "OEM_REF_WND_STATE",
+ "type": "Struct",
+ "mandatory": true
+ }
+ ],
+ "key": "OEM_REF_WND_STATUS",
+ "array": true,
+ "type": "Struct",
+ "mandatory": false,
+ "minsize": 0,
+ "maxsize": 100,
+ "since": "7.0"
+ },
+ {
"name": "eCallInfo",
"params": [
{
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index a5d980762d..fe7dbbdc26 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -339,6 +339,7 @@ extern const char* system_software_version;
extern const char* priority;
extern const char* engine_oil_life;
extern const char* oem_custom_data_type;
+extern const char* window_status;
// app services
extern const char* app_service_manifest;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc
new file mode 100644
index 0000000000..c559268bfd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc
@@ -0,0 +1,344 @@
+/*
+ Copyright (c) 2020, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/subscribe_vehicle_data_request.h"
+#include "resumption/last_state_wrapper_impl.h"
+#include "resumption/mock_last_state.h"
+#include "vehicle_info_plugin/commands/vi_command_request_test.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+
+#include "application_manager/mock_rpc_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_vehicle_data_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::SubscribeVehicleDataRequest;
+
+typedef std::shared_ptr<SubscribeVehicleDataRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kMsgParamKey = "test_key";
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS;
+const std::string kVehicleTypeStr = am::strings::window_status;
+} // namespace
+
+class SubscribeVehicleRequestTest
+ : public VICommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SubscribeVehicleRequestTest()
+ : mock_app_(CreateMockApp())
+ , vi_app_extension_ptr_(
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin_, *mock_app_))
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_last_state_(std::make_shared<resumption::LastStateWrapperImpl>(
+ std::make_shared<resumption_test::MockLastState>())) {}
+
+ protected:
+ void SubscribeSuccessfully();
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, GetRPCHandler())
+ .WillByDefault(ReturnRef(mock_rpc_handler_));
+
+ vi_plugin_.Init(app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_last_state_);
+ ON_CALL(*mock_app_, AddExtension(vi_app_extension_ptr_));
+ vi_plugin_.OnApplicationEvent(application_manager::plugin_manager::
+ ApplicationEvent::kApplicationRegistered,
+ mock_app_);
+ ON_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillByDefault(Return(vi_app_extension_ptr_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ MockAppPtr mock_app_;
+ application_manager::AppExtensionPtr vi_app_extension_ptr_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin_;
+ application_manager_test::MockRPCHandler mock_rpc_handler_;
+ resumption::LastStateWrapperPtr mock_last_state_;
+};
+
+TEST_F(SubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, Run_DataToSubscribeIsNotExisted_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ kVehicleTypeStr;
+
+ am::VehicleData empty_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(empty_data));
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest,
+ Run_EmptyVehicleData_INVALID_DATA_SentToMobile) {
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = false;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest,
+ Run_SubscribeDataNotIncludedToRequest_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, Run_Subscribe_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_SDL))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+
+ application_manager::ApplicationSet app_set = {mock_app_};
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_ptr_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData),
+ _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_WrongEvent_FAIL) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ test_event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_AppNotRegistered_FAIL) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(nullptr));
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ test_event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_DataSubscribed_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kVehicleTypeStr] = true;
+ test_event.set_smart_object(message);
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ kVehicleTypeStr, mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+} // namespace subscribe_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index dc54f6d1eb..969307ad68 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -242,9 +242,10 @@ std::pair<std::string, mobile_apis::VehicleDataType::eType>
mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
std::make_pair(strings::steering_wheel_angle,
mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
- std::make_pair(
- strings::engine_oil_life,
- mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
+ std::make_pair(strings::engine_oil_life,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE),
+ std::make_pair(strings::window_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS)};
const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 1765788419..e193967f7e 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -306,6 +306,7 @@ const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
const char* engine_oil_life = "engineOilLife";
const char* oem_custom_data_type = "oemCustomDataType";
+const char* window_status = "windowStatus";
// app services
const char* app_service_manifest = "appServiceManifest";
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index f85c569bdb..f85a49dec7 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
#include <string>
#include <vector>
@@ -46,6 +47,7 @@
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/state_controller.h"
#include "policy/mock_policy_settings.h"
+#include "smart_objects/enum_schema_item.h"
#include "utils/custom_string.h"
#include "utils/lock.h"
@@ -1112,6 +1114,38 @@ TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_FromWrongType) {
MessageHelper::ExtractWindowIdFromSmartObject(message));
}
+TEST_F(MessageHelperTest,
+ VehicleDataMapping_ContainsGeneratedVehicleTypes_SUCCESS) {
+ using VehicleDataTypeEnum = mobile_apis::VehicleDataType::eType;
+ using VehicleDataTypes =
+ smart_objects::EnumConversionHelper<VehicleDataTypeEnum>;
+
+ const auto& vehicle_data_mapping = MessageHelper::vehicle_data();
+ const auto& enum_map = VehicleDataTypes::enum_to_cstring_map();
+
+ // Values which vehicle_data_mapping doesn't contain
+ const std::vector<VehicleDataTypeEnum> excluded_values = {
+ VehicleDataTypeEnum::INVALID_ENUM,
+ VehicleDataTypeEnum::VEHICLEDATA_OEM_CUSTOM_DATA,
+ VehicleDataTypeEnum::VEHICLEDATA_BATTVOLTAGE};
+
+ for (const auto& enum_item : enum_map) {
+ const auto& excluded_value = std::find(
+ excluded_values.begin(), excluded_values.end(), enum_item.first);
+ if (excluded_value != excluded_values.end()) {
+ continue;
+ }
+
+ const auto& found_value = std::find_if(
+ vehicle_data_mapping.begin(),
+ vehicle_data_mapping.end(),
+ [&enum_item](const std::pair<std::string, VehicleDataTypeEnum>& item)
+ -> bool { return enum_item.first == item.second; });
+
+ EXPECT_NE(found_value, vehicle_data_mapping.end());
+ }
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index acc3fe10cc..06f472224b 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -1216,6 +1216,7 @@
<element name="VEHICLEDATA_CLOUDAPPVEHICLEID" />
<element name="VEHICLEDATA_OEM_CUSTOM_DATA" />
<element name="VEHICLEDATA_STABILITYCONTROLSSTATUS" />
+ <element name="VEHICLEDATA_WINDOWSTATUS"/>
</enum>
<enum name="WiperStatus">
@@ -1727,6 +1728,21 @@
</param>
</struct>
+<struct name="WindowState">
+ <param name="approximatePosition" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>The approximate percentage that the window is open - 0 being fully closed, 100 being fully open</description>
+ </param>
+ <param name="deviation" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50 and the deviation is 10, then the window's location is somewhere between 40 and 60.</description>
+ </param>
+</struct>
+
+<struct name="WindowStatus">
+ <description>Describes the status of a window of a door/liftgate etc.</description>
+ <param name="location" type="Common.Grid" mandatory="true"/>
+ <param name="state" type="Common.WindowState" mandatory="true"/>
+</struct>
+
<struct name="ModuleInfo">
<description>Information about a RC module</description>
<param name="moduleId" type="String" maxlength="100" mandatory="true">
@@ -6150,6 +6166,9 @@
<param name="stabilityControlsStatus" type="Boolean" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6252,6 +6271,9 @@
<param name="stabilityControlsStatus" type="Common.VehicleDataResult" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
@@ -6357,6 +6379,9 @@
<param name="stabilityControlsStatus" type="Boolean" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6459,6 +6484,9 @@
<param name="stabilityControlsStatus" type="Common.VehicleDataResult" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
@@ -6565,6 +6593,9 @@
<param name="stabilityControlsStatus" type="Boolean" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6670,6 +6701,9 @@
<param name="stabilityControlsStatus" type="Common.StabilityControlsStatus" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Common.WindowStatus" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
@@ -6776,6 +6810,9 @@
<param name="stabilityControlsStatus" type="Common.StabilityControlsStatus" mandatory="false">
<description>See StabilityControlsStatus</description>
</param>
+ <param name="windowStatus" type="Common.WindowStatus" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">