summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-15 23:16:59 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:21:57 +0100
commit0a9f3524f442ff055fb1075f92bd85f9b4522910 (patch)
treea2aef99c4c596d13992173c015cb4d6f0d1a2fe0 /src/low-can-binding.cpp
parent53cd923a034162273fea2f4fb045b28686f51df5 (diff)
Rename class and 1:1 map to JSON description file
Added decoder and callback member that will be set by generator and taken at submission to be used later, storing them into an active diagnostic request instance, when response CAN message comes in. Change-Id: I9ded05de3bb28ec55e4e007d72d0e1924141a6a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index 074e95cc..53d34c70 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -130,13 +130,13 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
int ret;
if (active_diagnostic_request_t::is_diagnostic_signal(sig) && subscribe)
{
- std::vector<obd2_signal_t*> found;
- configuration_t::instance().find_obd2_signals(build_DynamicField(sig), found);
- int frequency = found.front()->get_frequency();
+ std::vector<diagnostic_message_t*> found;
+ configuration_t::instance().find_diagnostic_messages(build_DynamicField(sig), found);
+ float frequency = found.front()->get_frequency();
DiagnosticRequest* diag_req = new DiagnosticRequest(found.front()->build_diagnostic_request());
configuration_t::instance().get_diagnostic_manager().add_recurring_request(
- diag_req, sig.c_str(), false, obd2_signal_t::decode_obd2_response, nullptr, (float)frequency);
- //TODO: Adding callback requesting ignition status: diag_req, sig.c_str(), false, obd2_signal_t::decode_obd2_response, obd2_signal_t::check_ignition_status, frequency);
+ diag_req, sig.c_str(), false, found.front()->get_decoder(), found.front()->get_callback(), (float)frequency);
+ //TODO: Adding callback requesting ignition status: diag_req, sig.c_str(), false, diagnostic_message_t::decode_obd2_response, diagnostic_message_t::check_ignition_status, frequency);
}
ret = subscribe_unsubscribe_signal(request, subscribe, sig);