1 | /*********************************************************************
|
---|
2 | // created: 2006/08/08 - 10:36
|
---|
3 | // filename: CanDriver.h
|
---|
4 | //
|
---|
5 | // author: Gerald Dherbomez
|
---|
6 | //
|
---|
7 | // version: $Id: CanDriver.h 1191 2012-07-08 10:26:53Z gdherbom $
|
---|
8 | //
|
---|
9 | // purpose: This is a generic class which may be used to control
|
---|
10 | // a CAN interface
|
---|
11 | //
|
---|
12 | // Only one driver can be used in the same application !
|
---|
13 | //
|
---|
14 | *********************************************************************/
|
---|
15 |
|
---|
16 |
|
---|
17 | #ifndef _CANDRIVER_H_
|
---|
18 | #define _CANDRIVER_H_
|
---|
19 |
|
---|
20 |
|
---|
21 | #define VECTOR_CAN_DRIVER 1
|
---|
22 | #define NI_CAN_DRIVER 2
|
---|
23 | #define VECTOR_CANXL_DRIVER 3
|
---|
24 | #define PEAK_CAN_DRIVER 4
|
---|
25 | #define IGEP_CAN_DRIVER 5
|
---|
26 | #define PEAK_CAN_DRIVER_WIN 6
|
---|
27 | #define SOFTING_CAN_DRIVER 7
|
---|
28 | #define KVASER_CAN_DRIVER_WIN 8
|
---|
29 |
|
---|
30 |
|
---|
31 | #if CAN_DRIVER_TYPE == VECTOR_CAN_DRIVER
|
---|
32 | #include "VectorCanDriver.h"
|
---|
33 | #define CanDriverType VectorCanDriver
|
---|
34 | #elif CAN_DRIVER_TYPE == NI_CAN_DRIVER
|
---|
35 | #include "NiCanDriver.h"
|
---|
36 | #define CanDriverType NiCanDriver
|
---|
37 | #elif CAN_DRIVER_TYPE == VECTOR_CANXL_DRIVER
|
---|
38 | #include "XLVectorCanDriver.h"
|
---|
39 | #define CanDriverType XLVectorCanDriver
|
---|
40 | #elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER
|
---|
41 | #include "PeakCanDriver.h"
|
---|
42 | #define CanDriverType PeakCanDriver
|
---|
43 | #elif CAN_DRIVER_TYPE == IGEP_CAN_DRIVER
|
---|
44 | #include "igepCanDriver.h"
|
---|
45 | #define CanDriverType igepCanDriver
|
---|
46 | #elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER_WIN
|
---|
47 | #include "PeakCanDriverWin.h"
|
---|
48 | #define CanDriverType PeakCanDriverWin
|
---|
49 | #elif CAN_DRIVER_TYPE == SOFTING_CAN_DRIVER
|
---|
50 | #include "SoftingCanDriver.h"
|
---|
51 | #define CanDriverType SoftingCanDriver
|
---|
52 | #elif CAN_DRIVER_TYPE == KVASER_CAN_DRIVER_WIN
|
---|
53 | #include "KVaserCanDriver.h"
|
---|
54 | #define CanDriverType KVaserCanDriver
|
---|
55 | #else
|
---|
56 | #define CanDriverType CanDriverUnknown
|
---|
57 | #endif
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 | class CanDriver : public CanDriverType
|
---|
62 | {
|
---|
63 | public:
|
---|
64 | CanDriver(){};
|
---|
65 | CanDriver(int channel) : CanDriverType(channel){};
|
---|
66 | CanDriver(const int channel, const unsigned int speed)
|
---|
67 | : CanDriverType(channel, speed){};
|
---|
68 | CanDriver(char* port, char* mode):CanDriverType(port, mode){};
|
---|
69 | ~CanDriver(){};
|
---|
70 | protected:
|
---|
71 |
|
---|
72 | private:
|
---|
73 | };
|
---|
74 |
|
---|
75 |
|
---|
76 |
|
---|
77 | #endif
|
---|