X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Flow-can-binding.cpp;h=08301933696d706bcbe7a7d9bdf2b04e73b806a1;hb=1ee222a7250896fc7f2e5fb1dc50a7466d81b741;hp=8ea885d1dac1ea1ea906099953c71cec13c359ee;hpb=f3ddfa1c2c4a9ac54f129a63dc9673afdc87bb9e;p=apps%2Fagl-service-can-low-level.git diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index 8ea885d1..08301933 100644 --- a/src/low-can-binding.cpp +++ b/src/low-can-binding.cpp @@ -133,7 +133,12 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, std::vector found; configuration_t::instance().find_diagnostic_messages(build_DynamicField(sig), found); DiagnosticRequest* diag_req = new DiagnosticRequest(found.front()->build_diagnostic_request()); - + + // 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(found.front()->get_supported()) + subscribe = false; if(subscribe) { float frequency = found.front()->get_frequency();