CPP conversion began
[apps/agl-service-can-low-level.git] / can-utils.h
index 7d00dd1..55408cb 100644 (file)
@@ -18,6 +18,7 @@
 
 #pragma once
 
+#include <string>
 #include "timer.h"
 #include "openxc.pb.h"
 
@@ -85,6 +86,21 @@ typedef openxc_DynamicField (*SignalDecoder)(struct CanSignal* signal,
 typedef uint64_t (*SignalEncoder)(struct CanSignal* signal,
         openxc_DynamicField* value, bool* send);
 
+/* CanBus represent a can device definition get from configuraiton file */
+class CanBus {
+       private:
+               /* Got from conf file */
+               std::string deviceName;
+
+               int socket;
+               bool is_fdmode_on;
+               struct sockaddr_can txAddress;
+
+       public:
+               int open();
+               int close();
+};
+
 /* Public: The ID format for a CAN message.
  *
  * STANDARD - standard 11-bit CAN arbitration ID.