summaryrefslogtreecommitdiffstats
path: root/can-utils.h
diff options
context:
space:
mode:
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.