Make error goes back to the subscribed clients when unsupported.
authorRomain Forlot <romain.forlot@iot.bzh>
Mon, 20 Mar 2017 09:11:58 +0000 (09:11 +0000)
committerRomain Forlot <romain.forlot@iot.bzh>
Mon, 20 Mar 2017 09:11:58 +0000 (09:11 +0000)
Change-Id: Ic864803c8dffdab3cc9bf5bf281ce032600a732f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/diagnostic/diagnostic-manager.cpp
src/low-can-binding.cpp

index 017601c..cf84ecc 100644 (file)
@@ -518,6 +518,7 @@ openxc_VehicleMessage diagnostic_manager_t::relay_diagnostic_response(active_dia
                found_signals.front()->set_supported(false);
                cleanup_request(adr, true);
                NOTICE(binder_interface, "relay_diagnostic_response: PID not supported or ill formed. Please unsubscribe from it. Error code : %d", response.negative_response_code);
+               message = build_VehicleMessage(build_SimpleMessage(adr->get_name(), build_DynamicField("This PID isn't supported by your vehicle.")));
        }
 
        if(adr->get_callback() != nullptr)
index 45213d9..ed1aa34 100644 (file)
@@ -147,7 +147,6 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
                        }
                        else
                        {
-                               found.front()->set_supported(false);
                                configuration_t::instance().get_diagnostic_manager().cleanup_request(
                                        configuration_t::instance().get_diagnostic_manager().find_recurring_request(diag_req), true);
                                DEBUG(binder_interface, "Signal: %s isn't supported. Canceling operation.", sig.c_str());