- return CanBus_handler.socket;
- }
-
- event_loop = afb_daemon_get_event_loop(interface->daemon);
- rc = sd_event_add_io(event_loop, &source, CanBus_handler.socket, EPOLLIN, on_event, NULL);
- if (rc < 0)
- {
- CanBus_handler.close();
- ERROR(interface, "Can't connect CAN bus %s to the event loop", CanBus_handler.device);
- } else
- {
- NOTICE(interface, "Connected CAN bus %s to the event loop", CanBus_handler.device);
- }
-
- return rc;
-}
- */
-
-/********************************************************************************
-*
-* Subscription and unsubscription
-*
-*********************************************************************************/
-
-static int subscribe_unsubscribe_signal(struct afb_req request, int subscribe, std::map<CanSignal, struct afb_event>::iterator *s_sig)
- {
- if (!afb_event_is_valid(s_sig->second)) {
- if (!subscribe)
- return 1;
- sig->event = afb_daemon_make_event(afbitf->daemon, s_sig->first->genericName);
- if (!afb_event_is_valid(s_sig->second)) {
- return 0;
- }
- }
-
- if (((subscribe ? afb_req_subscribe : afb_req_unsubscribe)(request, s_sig->second)) < 0) {