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

Last change on this file since 1 was 1, checked in by DHERBOMEZ Gérald, 11 years ago

ajout des capteurs CanGateway et Alasca

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
19class XLVectorCanDriver
20 : public CanDriverBase
21{
22public:
23 XLVectorCanDriver(void);
24 XLVectorCanDriver(const std::string &name, const int hwType, const int hwIndex, const int hwChannel, unsigned long bitrate);
25 void initialize(const std::string &name, const int hwType, const int hwIndex, const int hwChannel, unsigned long bitrate);
26 XLVectorCanDriver(int channel);
27 XLVectorCanDriver(int channel, unsigned int bitRate);
28 XLVectorCanDriver(char * /*dummy1*/, char * /*dummy2*/) {} // DON'T USE
29 ~XLVectorCanDriver(void);
30
31 short initPort (void);
32 short cleanUpPort (void);
33
34 void displayHardware(void);
35
36 //Vstatus AcceptId(int id);
37 //Vstatus AcceptIdRange(int deb,int fin);
38 //Vstatus sendFrame (unsigned char, unsigned char, unsigned char *, int);
39 //Vstatus receiveFrame (unsigned char *, unsigned char *, unsigned char *, int *);
40 short sendFrame (struct CanFrame frame);
41 short receiveFrame (struct CanFrame &frame);
42 void waitReceivingFrame(void);
43
44protected:
45
46private:
47 /*
48 VportHandle gPortHandle; //!< Handle to the AC2PCI CAN Card
49 Vaccess gChannelMask; //!< Mask to select the channel of the card (channel 0 or 1)
50 Vaccess gPermissionMask; //!< Mask of the channel selected
51 unsigned int gCanId; //!< Identificator of the CAN frame send by the card
52 unsigned int gBitRate; //!< Variable which defined the bitrate of the card
53 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
54 int gHwChannel; //!< Defined the channel of the card what we want used (channel 0 or 1)
55 HANDLE gEventHandle; //!< Handle on a windows event for known if a CAN frame is present on the frame's buffer of the card
56*/
57 XLaccess accessMask;
58 XLportHandle port;
59 XLhandle msgEvent;
60
61};
62
63#endif // XLVECTORCANDRIVER_H
Note: See TracBrowser for help on using the repository browser.