diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-16 12:37:46 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-19 11:36:42 +0200 |
commit | 4f1b1d088afe8eb9a5b75287429104e4175e97e7 (patch) | |
tree | f3d0ba62b108f1f9ad022800929022f575c70b45 /CAN-binder/low-can-binding/binding/low-can-hat.hpp | |
parent | c59a57338a488cc451482f1180fe672e7d5c9179 (diff) |
Adding also diagnostic request to systemd event loop
As for CAN signal, monitoring diagnostic request messages is now handled by
systemD io event loop. Socket reading is common for all OBD2 signals and handled
by the diagnostic manager.
systemd callback function lies in binding callback which in turns call read_socket
method of diagnostic manager. Processing is little bit different from classic CAN
messages so it is a separate callback function.
Lot of cleaning to do now...
Change-Id: I4d2ada0beb5d3348736dfdf3c56a7cb875a1c6c7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/binding/low-can-hat.hpp')
-rw-r--r-- | CAN-binder/low-can-binding/binding/low-can-hat.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-hat.hpp b/CAN-binder/low-can-binding/binding/low-can-hat.hpp index 7df4663c..57c0a536 100644 --- a/CAN-binder/low-can-binding/binding/low-can-hat.hpp +++ b/CAN-binder/low-can-binding/binding/low-can-hat.hpp @@ -20,6 +20,7 @@ #include <cstddef> #include <string> +#include <systemd/sd-event.h> extern "C" { @@ -31,6 +32,8 @@ extern "C" struct afb_binding_interface; extern const struct afb_binding_interface *binder_interface; void on_no_clients(std::string message); +int read_can_signal(sd_event_source *s, int fd, uint32_t revents, void *userdata); +int read_diagnostic_message(sd_event_source *s, int fd, uint32_t revents, void *userdata); void subscribe(struct afb_req request); void unsubscribe(struct afb_req request);
\ No newline at end of file |