From b606db2b74d5c92d33a126071062c9eb2a548beb Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 13 Mar 2017 09:45:01 +0100 Subject: 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 --- src/low-can-binding.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/low-can-binding.cpp') diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index e7d8530..0c418fe 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 found; configuration_t::instance().find_obd2_signals(build_DynamicField(sig), found); -- cgit 1.2.3-korg