summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-06 22:28:50 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:05:17 +0100
commitde8fb10e1d8e98a85dfba6fc8966266dbf5e42c6 (patch)
tree0eab1a766f80b7498d63fb8ecd36486c13b633a2 /src/low-can-binding.cpp
parent4fd376fac5b1d47eed3f22467ae5b5e35f1ec610 (diff)
Beginning of work on obd2 object and
files reorganization. Change-Id: Idaa7ad05c45d734ce771506fd6e41f1a09a6ac66 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index b9fb27d..043261f 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -119,33 +119,33 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe,
*
* @return Number of correctly subscribed signal
*/
-static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, std::vector<std::string>& signals)
+static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, const std::vector<std::string>& signals)
{
int rets = 0;
- for(auto& signal_i : signals)
+ for(auto& sig : signals)
{
- int ret = subscribe_unsubscribe_signal(request, subscribe, signal_i);
+ int ret = subscribe_unsubscribe_signal(request, subscribe, sig);
if(ret <= 0)
return ret;
rets++;
- DEBUG(binder_interface, "Signal: %s subscribed", signal_i.c_str());
+ DEBUG(binder_interface, "Signal: %s subscribed", sig.c_str());
}
return rets;
}
static int subscribe_unsubscribe_name(struct afb_req request, bool subscribe, const char *name)
{
- std::vector<std::string> sig;
+ std::vector<std::string> signals;
int ret = 0;
openxc_DynamicField search_key = build_DynamicField(std::string(name));
- sig = find_signals(search_key);
- if (sig.empty())
+ signals = find_signals(search_key);
+ if (signalssig.empty())
ret = 0;
- ret = subscribe_unsubscribe_signals(request, subscribe, sig);
- NOTICE(binder_interface, "Subscribed correctly to %d/%d signal(s).", ret, (int)sig.size());
+ ret = subscribe_unsubscribe_signals(request, subscribe, signals);
+ NOTICE(binder_interface, "Subscribed correctly to %d/%d signal(s).", ret, (int)signals.size());
return ret;
}