Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
if (!SubscribePendingVehicleData(app, converted_msg_params)) {
result_code = mobile_apis::Result::GENERIC_ERROR;
response_info = "Subscription failed for some Vehicle data";
SendResponse(false, result_code, response_info.c_str());
SendResponse(
false, result_code, response_info.c_str(), &converted_msg_params);
return;
}
}
Expand Down Expand Up @@ -214,6 +215,7 @@ bool SubscribeVehicleDataRequest::SubscribePendingVehicleData(
VD_ResultCode::VDRC_DATA_NOT_SUBSCRIBED,
VD_ResultCode::VDRC_IGNORED});

bool overall_success = vi_waiting_for_subscribe_.empty();
for (auto vi_name = vi_waiting_for_subscribe_.begin();
vi_name != vi_waiting_for_subscribe_.end();) {
const bool is_subscription_successful = CheckSubscriptionStatus(
Expand All @@ -223,6 +225,7 @@ bool SubscribeVehicleDataRequest::SubscribePendingVehicleData(
auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
ext.subscribeToVehicleInfo(*vi_name);
vi_name = vi_waiting_for_subscribe_.erase(vi_name);
overall_success = true;
} else {
auto res_code =
static_cast<hmi_apis::Common_VehicleDataResultCode::eType>(
Expand All @@ -238,7 +241,7 @@ bool SubscribeVehicleDataRequest::SubscribePendingVehicleData(
}
}
}
return vi_waiting_for_subscribe_.empty();
return vi_waiting_for_subscribe_.empty() && overall_success;
}

bool SubscribeVehicleDataRequest::Init() {
Expand Down