source: pacpussensors/trunk/CanGateway/driver/CanDriver.h@ 134

Last change on this file since 134 was 89, checked in by DHERBOMEZ Gérald, 9 years ago

Add KVASER CAN driver support for CanGateway component. Tested only for Windows.

File size: 2.1 KB
RevLine 
[1]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
[86]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
[89]28#define KVASER_CAN_DRIVER_WIN 8
[1]29
[86]30
[1]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
[86]37#elif CAN_DRIVER_TYPE == VECTOR_CANXL_DRIVER
38#include "XLVectorCanDriver.h"
39#define CanDriverType XLVectorCanDriver
[1]40#elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER
41#include "PeakCanDriver.h"
42#define CanDriverType PeakCanDriver
[86]43#elif CAN_DRIVER_TYPE == IGEP_CAN_DRIVER
44#include "igepCanDriver.h"
45#define CanDriverType igepCanDriver
[59]46#elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER_WIN
47#include "PeakCanDriverWin.h"
48#define CanDriverType PeakCanDriverWin
[86]49#elif CAN_DRIVER_TYPE == SOFTING_CAN_DRIVER
50#include "SoftingCanDriver.h"
51#define CanDriverType SoftingCanDriver
[89]52#elif CAN_DRIVER_TYPE == KVASER_CAN_DRIVER_WIN
53#include "KVaserCanDriver.h"
54#define CanDriverType KVaserCanDriver
[1]55#else
56#define CanDriverType CanDriverUnknown
57#endif
58
59
60
61class CanDriver : public CanDriverType
62{
63public:
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(){};
70protected:
71
72private:
73};
74
75
76
77#endif
Note: See TracBrowser for help on using the repository browser.