summaryrefslogtreecommitdiffstats
path: root/can-utils.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-02 23:10:21 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-02 23:10:21 +0000
commit398f2aafbe3927bd6f4e961e2f5f090a2770d6d1 (patch)
tree6ea518a1ce37dfbdd3eca3fb8ba5c22143b40ded /can-utils.h
parent4da559091678dddb4c0392459ce41f2fa0821f72 (diff)
CPP conversion began
Change-Id: I4d20e7537b1ee3b00fcaa42146b3f2681741074d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'can-utils.h')
-rw-r--r--can-utils.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/can-utils.h b/can-utils.h
index 7d00dd1a..55408cb4 100644
--- a/can-utils.h
+++ b/can-utils.h
@@ -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.