Change-Id: I9a0726ab41c4801e7a5305731ce78ddd03aff9e1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
* limitations under the License.
*/
+#include <fnmatch.h>
+
#include "active-diagnostic-request.hpp"
std::string active_diagnostic_request_t::prefix_ = "diagnostic_messages";
*/
bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name)
{
- if(name.find_first_of(prefix_.c_str(), 0, prefix_.size()))
+ const std::string p = active_diagnostic_request_t::prefix_ + "*";
+ if(::fnmatch(p.c_str(), name.c_str(), FNM_CASEFOLD) == 0)
return true;
return false;
}
uint32_t get_id() const;
std::shared_ptr<can_bus_dev_t> get_can_bus_dev();
DiagnosticRequestHandle* get_handle();
- std::string& get_name();
+ const std::string get_name() const;
static std::string& get_prefix();
DiagnosticResponseDecoder& get_decoder();
DiagnosticResponseCallback& get_callback();