source: pacpussensors/trunk/CanGateway/driver/CanDriverBase.h@ 118

Last change on this file since 118 was 4, checked in by guyardro, 11 years ago

add igep can driver for CanGateway and add support for igep compilation

File size: 1.4 KB
Line 
1/********************************************************************
2// created: 2006/08/07 - 14:12
3// filename: CanDriverBase.h
4//
5// author: Gerald Dherbomez
6//
7// version: $Id: CanDriverBase.h 1069 2012-03-07 15:57:30Z kurdejma $
8//
9// purpose: This is an abstract class that manages the CAN card.
10// Use UPF frames to communicate with it.
11// Contains basic decoding functions for CAN data.
12//
13*********************************************************************/
14
15
16#ifndef _CANDRIVERBASE_H_
17#define _CANDRIVERBASE_H_
18
19#include "Pacpus/kernel/road_time.h"
20#include "Pacpus/PacpusTools/BinaryDecoder.h"
21
22#include "../structureCan.h"
23
24/*
25
26#define MAX_CAN_MSG_LENGTH 8
27
28
29// Basic structure of a CAN frame
30struct CanFrame {
31 unsigned long id;
32 unsigned char dlc;
33 unsigned char data [MAX_CAN_MSG_LENGTH];
34};
35
36// Can structure with timestamping
37struct TimestampedCanFrame {
38 CanFrame frame;
39 road_time_t time;
40 road_timerange_t timerange;
41};
42
43*/
44
45class CanDriverBase
46{
47public:
48 CanDriverBase(){}
49 ~CanDriverBase(){}
50
51 virtual short initPort (void) = 0;
52 virtual short cleanUpPort (void) = 0;
53 virtual short sendFrame (struct CanFrame frame) = 0 ;
54 virtual short receiveFrame (struct CanFrame &frame) = 0;
55 virtual void waitReceivingFrame (void) = 0;
56
57protected:
58
59private:
60};
61
62
63
64
65#endif
Note: See TracBrowser for help on using the repository browser.