summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-13 09:45:01 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:15:55 +0100
commitb606db2b74d5c92d33a126071062c9eb2a548beb (patch)
tree26e0edc377c35521bba345a5f162809894751376 /src/low-can-binding.cpp
parent37bf83a16cbd07b168b8c4f5a2c05cbf281d8fad (diff)
Change the way to check signal type making prefix_
attribute as static with a static class method which will check that the beginning of string argument matches the prefix. Change-Id: Idb129c7179391da61447996560957b2791aa9383 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index e7d8530f..0c418fe8 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -128,13 +128,11 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
//TODO: Implement way to dynamically call the right function no matter
// how much signals types we have.
- /// const std::string& can_prefix = configuration_t::instance().get_can_signals().front().get_prefix();
- const std::string& obd2_prefix = configuration_t::instance().get_obd2_signals().front().get_prefix();
for(const std::string& sig : signals)
{
int ret;
- if (sig.find_first_of(obd2_prefix.c_str(), 0, obd2_prefix.size()))
+ if (obd2_signal_t::is_obd2_signal(sig))
{
std::vector<obd2_signal_t*> found;
configuration_t::instance().find_obd2_signals(build_DynamicField(sig), found);