Improve reliability on multi-threading.
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / binding / low-can-hat.hpp
index 57c0a53..233d798 100644 (file)
@@ -19,7 +19,9 @@
 #pragma once
 
 #include <cstddef>
+#include <map>
 #include <string>
+#include <memory>
 #include <systemd/sd-event.h>
 
 extern "C"
@@ -31,9 +33,11 @@ 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);
+class low_can_subscription_t;
+
+void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
+void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription, uint32_t pid, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
+int read_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