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