summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-04-21 15:42:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-21 15:42:48 +0200
commitf0880c9212e3fb1c2abe8dbbcd376da1279901e6 (patch)
tree2b2042042c77e1e753cddb30e8ee22d7416f3f55 /CAN-binder/low-can-binding/low-can-binding.cpp
parent1a67a9c8647c7fa48ee435f033f336e5f83ac270 (diff)
Diagnostic messages subscription simplified.
Remove useless function. Change-Id: I6638c3033cfeea643b29c1280d7f5785371cd342 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/low-can-binding.cpp')
-rw-r--r--CAN-binder/low-can-binding/low-can-binding.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/CAN-binder/low-can-binding/low-can-binding.cpp b/CAN-binder/low-can-binding/low-can-binding.cpp
index 07b3f1ea..6f361af2 100644
--- a/CAN-binder/low-can-binding/low-can-binding.cpp
+++ b/CAN-binder/low-can-binding/low-can-binding.cpp
@@ -141,13 +141,12 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
int ret;
if (active_diagnostic_request_t::is_diagnostic_signal(sig))
{
- diagnostic_message_t* diag_msg = configuration_t::instance().get_diagnostic_message(sig);
- DiagnosticRequest* diag_req = configuration_t::instance().get_request_from_diagnostic_message(diag_msg);
+ DiagnosticRequest* diag_req = configuration_t::instance().get_request_from_diagnostic_message(sig);
// If the requested diagnostic message isn't supported by the car then unssubcribe.
// no matter what we want, worse case will be a fail unsubscription but at least we don't
// poll a PID for nothing.
- if(diag_msg->get_supported() && subscribe)
+ if(diag_req != nullptr && subscribe)
{
float frequency = diag_msg->get_frequency();
subscribe = configuration_t::instance().get_diagnostic_manager().add_recurring_request(