From 035493b81d5bb6d909de05e9a06a0f61588a35aa Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 23 Feb 2017 17:52:35 +0000 Subject: First draft about lock/wait thread management. Reordering include files Change-Id: Ia6d9ee30eb4e1df0c380c26355679fe00b373aa8 Signed-off-by: Romain Forlot --- src/can-utils.hpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'src/can-utils.hpp') diff --git a/src/can-utils.hpp b/src/can-utils.hpp index 218452d9..e4a3d340 100644 --- a/src/can-utils.hpp +++ b/src/can-utils.hpp @@ -17,30 +17,14 @@ #pragma once -#include #include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include #include "timer.hpp" #include "openxc.pb.h" #include "low-can-binding.hpp" -extern "C" -{ - #include -} - // TODO actual max is 32 but dropped to 24 for memory considerations #define MAX_ACCEPTANCE_FILTERS 24 // TODO this takes up a ton of memory @@ -341,13 +325,34 @@ class can_bus_dev_t { */ can_bus_dev_t(const std::string& dev_name); + /** + * @brief Connect to the application framework event loop and adding + * a watch on the socket that will wakeup reading thread that will + * read the socket and fill can_bus_t object queue. + * + * @return 0 if success, anything else if not. + */ + int event_loop_connection(); + /** * @brief Open the can socket and returning it * * @return */ int open(); + + /** + * @brief Open the can socket and returning it + * + * @return + */ int close(); + + /** + * @brief Telling if the reading thread is running + * + * @return true if read is running, false if not. + */ bool is_running(); /** -- cgit 1.2.3-korg