Fix subscribe response
authorRomain Forlot <romain.forlot@iot.bzh>
Thu, 20 Jul 2017 15:51:20 +0000 (17:51 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Thu, 20 Jul 2017 15:51:20 +0000 (17:51 +0200)
This patch is "No signal(s) found for %s." return value is ret = -1.

Change-Id: Ia6f4f2db13beb7f9d3507d890383fc13cbddac0f
Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
low-can-binding/binding/low-can-cb.cpp

index e2ddf07..ec8b2b4 100644 (file)
@@ -308,9 +308,12 @@ static int one_subscribe_unsubscribe(struct afb_req request, bool subscribe, con
        openxc_DynamicField search_key = build_DynamicField(tag);
        sf = utils::signals_manager_t::instance().find_signals(search_key);
        if (sf.can_signals.empty() && sf.diagnostic_messages.empty())
        openxc_DynamicField search_key = build_DynamicField(tag);
        sf = utils::signals_manager_t::instance().find_signals(search_key);
        if (sf.can_signals.empty() && sf.diagnostic_messages.empty())
+       {
                AFB_NOTICE("No signal(s) found for %s.", tag.c_str());
                AFB_NOTICE("No signal(s) found for %s.", tag.c_str());
+               ret = -1;
+       }
        else
        else
-               ret = subscribe_unsubscribe_signals(request, subscribe, sf, event_filter);
+               {ret = subscribe_unsubscribe_signals(request, subscribe, sf, event_filter);}
 
        return ret;
 }
 
        return ret;
 }