summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <akutsan@luxoft.com>2018-06-18 13:19:52 +0300
committerIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-26 12:01:49 +0300
commit0a1e969a12ddf8aaebc21a6ef98f732ef3cd7567 (patch)
tree4f43c340b937a83b2ab55bb3a6d7555f4c30f148
parentd1812c1d50ebc1f29edeba08c9b44f43aa35d0ee (diff)
downloadsdl_core-0a1e969a12ddf8aaebc21a6ef98f732ef3cd7567.tar.gz
fixup! Add resumption processing in VehicleInfoAppExtension
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc68
2 files changed, 3 insertions, 67 deletions
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
index 97d06b85d5..97e622f1f4 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
@@ -65,8 +65,6 @@ class VehicleInfoPlugin : public plugins::RPCPlugin {
void ProcessResumptionSubscription(app_mngr::Application& app,
VehicleInfoAppExtension& ext);
- static const VehicleData vehicle_data_;
-
private:
void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
index 2a828cab0e..7b94d22312 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
@@ -35,75 +35,13 @@
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/message_helper.h"
+#include "application_manager/message_helper.h"
namespace vehicle_info_plugin {
CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
namespace strings = application_manager::strings;
-std::pair<std::string,
- mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = {
- std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
- std::make_pair(strings::speed,
- mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
- std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
- std::make_pair(strings::fuel_level,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
- std::make_pair(strings::fuel_level_state,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
- std::make_pair(strings::instant_fuel_consumption,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
- std::make_pair(strings::fuel_range,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
- std::make_pair(strings::external_temp,
- mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
- std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
- std::make_pair(strings::prndl,
- mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
- std::make_pair(strings::tire_pressure,
- mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
- std::make_pair(strings::odometer,
- mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
- std::make_pair(strings::belt_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
- std::make_pair(strings::body_information,
- mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
- std::make_pair(strings::device_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
- std::make_pair(strings::driver_braking,
- mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
- std::make_pair(strings::wiper_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
- std::make_pair(strings::head_lamp_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
- std::make_pair(strings::e_call_info,
- mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
- std::make_pair(strings::airbag_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
- std::make_pair(strings::emergency_event,
- mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
- std::make_pair(strings::cluster_mode_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
- std::make_pair(strings::my_key,
- mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
- /*
- NOT DEFINED in mobile APIVehicleInfoPlugin
- std::make_pair(strings::gps,
- BATTVOLTAGE),
- */
- std::make_pair(strings::engine_torque,
- mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
- std::make_pair(strings::acc_pedal_pos,
- 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)};
-
-const VehicleInfoPlugin::VehicleData VehicleInfoPlugin::vehicle_data_(
- kVehicleDataInitializer,
- kVehicleDataInitializer + ARRAYSIZE(kVehicleDataInitializer));
-
VehicleInfoPlugin::VehicleInfoPlugin() : application_manager_(nullptr) {}
bool VehicleInfoPlugin::Init(
@@ -147,7 +85,7 @@ void VehicleInfoPlugin::ProcessResumptionSubscription(
smart_objects::SmartObject(smart_objects::SmartType_Map);
msg_params[strings::app_id] = app.app_id();
const auto& subscriptions = ext.Subscriptions();
- for (auto& ivi_data : vehicle_data_) {
+ for (auto& ivi_data : application_manager::MessageHelper::vehicle_data()) {
mobile_apis::VehicleDataType::eType type_id = ivi_data.second;
if (subscriptions.end() != subscriptions.find(type_id)) {
std::string key_name = ivi_data.first;
@@ -181,7 +119,7 @@ smart_objects::SmartObjectSPtr GetUnsubscribeIVIRequest(
using namespace smart_objects;
auto find_ivi_name = [ivi_id]() {
- for (auto item : VehicleInfoPlugin::vehicle_data_) {
+ for (auto item : application_manager::MessageHelper::vehicle_data()) {
if (ivi_id == item.second) {
return item.first;
}