X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Flow-can-hat.hpp;h=1662ce04fb72ecc9ff2f7437958c3a470bb9b202;hb=5d0fe05cf3d11402dd35ddfe5abd65af8061c688;hp=162a8e5965ec1d2a5bd18d48d448fd6c3d3ddc7c;hpb=e2af4a871c6a8bcab4733193948833aed9c5ceb8;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 162a8e59..1662ce04 100644 --- a/low-can-binding/binding/low-can-hat.hpp +++ b/low-can-binding/binding/low-can-hat.hpp @@ -23,12 +23,9 @@ #include #include #include +#include -extern "C" -{ - #define AFB_BINDING_VERSION 2 - #include -}; +#include class low_can_subscription_t; @@ -36,7 +33,11 @@ void on_no_clients(std::shared_ptr can_subscription, std void on_no_clients(std::shared_ptr can_subscription, uint32_t pid, std::map >& s); int read_message(sd_event_source *s, int fd, uint32_t revents, void *userdata); -void auth(struct afb_req request); -void subscribe(struct afb_req request); -void unsubscribe(struct afb_req request); -void write(struct afb_req request); +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)); +}