Changed the decoding function
[apps/agl-service-can-low-level.git] / src / can-signals.hpp
index d4ada1d..fb77df5 100644 (file)
 
 #include <map>
 #include <queue>
-#include <string>
 #include <vector>
-#include <fnmatch.h>
+#include <string>
+#include <thread>
+#include <linux/can.h>
+#include <mutex>
+#include <condition_variable>
 
+#include "timer.hpp"
+#include "openxc.pb.h"
 #include "can-utils.hpp"
 
 extern "C"
 {
+       #include <afb/afb-binding.h>
        #include <afb/afb-event-itf.h>
 }
 
@@ -42,6 +48,13 @@ extern "C"
  */
 static std::map<std::string, struct afb_event> subscribed_signals;
 
+/**
+* @brief Mutex allowing safe manipulation on subscribed_signals map.
+* @desc To ensure that the map object isn't modified when we read it, you
+*  have to set this mutex before use subscribed_signals map object.
+*/
+extern std::mutex subscribed_signals_mutex;
+
 /** Public: Return the currently active CAN configuration. */
 CanMessageSet* getActiveMessageSet();