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

Last change on this file since 134 was 40, checked in by phudelai, 11 years ago

bug corrected

File size: 2.4 KB
Line 
1/// Purpose: Inherits from the CanDriver class
2/// Reimplement all the virtual members of the CanDriverBase
3/// class in order to be used with the Vector driver.
4/// platform : Windows specific
5///
6/// @date created 2006/08/07 - 14:14
7/// @author Gerald Dherbomez
8/// @version $Id$
9
10#ifndef XLVECTORCANDRIVER_H
11#define XLVECTORCANDRIVER_H
12
13#include <string>
14#include <windows.h>
15
16#include "CanDriverBase.h"
17#include "vxlapi.h"
18#include "../CanGatewayConfig.h"
19
20class CANGATEWAY_API XLVectorCanDriver
21 : public CanDriverBase
22{
23public:
24 XLVectorCanDriver(void);
25 XLVectorCanDriver(const std::string &name, const int hwType, const int hwIndex, const int hwChannel, unsigned long bitrate);
26 void initialize(const std::string &name, const int hwType, const int hwIndex, const int hwChannel, unsigned long bitrate);
27 XLVectorCanDriver(int channel);
28 XLVectorCanDriver(int channel, unsigned int bitRate);
29 XLVectorCanDriver(char * /*dummy1*/, char * /*dummy2*/) {} // DON'T USE
30 ~XLVectorCanDriver(void);
31
32 short initPort (void);
33 short cleanUpPort (void);
34
35 void displayHardware(void);
36
37 //Vstatus AcceptId(int id);
38 //Vstatus AcceptIdRange(int deb,int fin);
39 //Vstatus sendFrame (unsigned char, unsigned char, unsigned char *, int);
40 //Vstatus receiveFrame (unsigned char *, unsigned char *, unsigned char *, int *);
41 short sendFrame (struct CanFrame frame);
42 short receiveFrame (struct CanFrame &frame);
43 void waitReceivingFrame(void);
44
45protected:
46
47private:
48 /*
49 VportHandle gPortHandle; //!< Handle to the AC2PCI CAN Card
50 Vaccess gChannelMask; //!< Mask to select the channel of the card (channel 0 or 1)
51 Vaccess gPermissionMask; //!< Mask of the channel selected
52 unsigned int gCanId; //!< Identificator of the CAN frame send by the card
53 unsigned int gBitRate; //!< Variable which defined the bitrate of the card
54 unsigned int gHwType; //!< Defined the type of the hardware use for CAN communication. for the moment the only possible value is HWTYPE_CANAC2PCI for the AC2PCI CAN Card
55 int gHwChannel; //!< Defined the channel of the card what we want used (channel 0 or 1)
56 HANDLE gEventHandle; //!< Handle on a windows event for known if a CAN frame is present on the frame's buffer of the card
57*/
58 XLaccess accessMask;
59 XLportHandle port;
60 XLhandle msgEvent;
61
62};
63
64#endif // XLVECTORCANDRIVER_H
Note: See TracBrowser for help on using the repository browser.