From 398f2aafbe3927bd6f4e961e2f5f090a2770d6d1 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 2 Feb 2017 23:10:21 +0000 Subject: CPP conversion began Change-Id: I4d20e7537b1ee3b00fcaa42146b3f2681741074d Signed-off-by: Romain Forlot --- can-utils.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'can-utils.h') 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 #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. -- cgit 1.2.3-korg