summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-20 17:51:20 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-20 17:51:20 +0200
commit9295346830bae064dddb4e0a12a69ddc9c120123 (patch)
treeedbb63b01514c4c28114f84cb53f01ca03454b07
parent4a538f440d525a2d01bd892989998dbaf67e5af0 (diff)
Fix subscribe response
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>
-rw-r--r--low-can-binding/binding/low-can-cb.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index e2ddf07..ec8b2b4 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -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())
+ {
AFB_NOTICE("No signal(s) found for %s.", tag.c_str());
+ ret = -1;
+ }
else
- ret = subscribe_unsubscribe_signals(request, subscribe, sf, event_filter);
+ {ret = subscribe_unsubscribe_signals(request, subscribe, sf, event_filter);}
return ret;
}