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 |
|
---|
18 | #ifndef _CANDRIVER_H_
|
---|
19 | #define _CANDRIVER_H_
|
---|
20 |
|
---|
21 |
|
---|
22 | #define VECTOR_CAN_DRIVER 1
|
---|
23 | #define NI_CAN_DRIVER 2
|
---|
24 | #define VECTOR_CANXL_DRIVER 3
|
---|
25 |
|
---|
26 |
|
---|
27 | #if CAN_DRIVER_TYPE == VECTOR_CAN_DRIVER
|
---|
28 | #include "VectorCanDriver.h"
|
---|
29 | #define CanDriverType VectorCanDriver
|
---|
30 | #elif CAN_DRIVER_TYPE == NI_CAN_DRIVER
|
---|
31 | #include "NiCanDriver.h"
|
---|
32 | #define CanDriverType NiCanDriver
|
---|
33 | #elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER
|
---|
34 | #include "PeakCanDriver.h"
|
---|
35 | #define CanDriverType PeakCanDriver
|
---|
36 | #elif CAN_DRIVER_TYPE == VECTOR_CANXL_DRIVER
|
---|
37 | #include "XLVectorCanDriver.h"
|
---|
38 | #define CanDriverType XLVectorCanDriver
|
---|
39 | #else
|
---|
40 | #define CanDriverType CanDriverUnknown
|
---|
41 | #endif
|
---|
42 |
|
---|
43 |
|
---|
44 |
|
---|
45 | class CanDriver : public CanDriverType
|
---|
46 | {
|
---|
47 | public:
|
---|
48 | CanDriver(){};
|
---|
49 | CanDriver(int channel) : CanDriverType(channel){};
|
---|
50 | CanDriver(const int channel, const unsigned int speed)
|
---|
51 | : CanDriverType(channel, speed){};
|
---|
52 | CanDriver(char* port, char* mode):CanDriverType(port, mode){};
|
---|
53 | ~CanDriver(){};
|
---|
54 | protected:
|
---|
55 |
|
---|
56 | private:
|
---|
57 | };
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 | #endif
|
---|