X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Flow-can-hat.hpp;h=131b61f2dbd96af46286f112171cbf83913bdf49;hb=3fb6ac3c3670499bee4ce02ff7813739017e8b8f;hp=248b62ceac71ae11e4cd145acb6191479587b7ab;hpb=01715613f16113017529c51703f3e5d90918c4c5;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/binding/low-can-hat.hpp b/low-can-binding/binding/low-can-hat.hpp index 248b62ce..131b61f2 100644 --- a/low-can-binding/binding/low-can-hat.hpp +++ b/low-can-binding/binding/low-can-hat.hpp @@ -23,12 +23,23 @@ #include #include #include +#include #include class low_can_subscription_t; -int initv2(); -void on_no_clients(std::shared_ptr can_subscription, std::map >& s); -void on_no_clients(std::shared_ptr can_subscription, uint32_t pid, std::map >& s); +typedef std::map> map_subscription; + +void on_no_clients(std::shared_ptr can_subscription, map_subscription& s); +void on_no_clients(std::shared_ptr can_subscription, uint32_t pid, map_subscription& s); int read_message(sd_event_source *s, int fd, uint32_t revents, void *userdata); + +inline bool caseInsCharCompareN(char a, char b) { + return(toupper(a) == toupper(b)); +} + +inline bool caseInsCompare(const std::string& s1, const std::string& s2) { + return((s1.size() == s2.size()) && + equal(s1.begin(), s1.end(), s2.begin(), caseInsCharCompareN)); +}