source: pacpussensors/trunk/CanGateway/driver/igepCanDriver.h@ 124

Last change on this file since 124 was 4, checked in by guyardro, 11 years ago

add igep can driver for CanGateway and add support for igep compilation

File size: 1.4 KB
RevLine 
[4]1/********************************************************************
2// created: 2011/02/21 - 10:39
3// filename: igepCanDriver.h
4//
5// author: Sergio Rodriguez
6//
7// version: $Id: igepCanDriver.h srodrigu $
8//
9// purpose: Inherits from the CanDriver class
10// Reimplement all the virtual members of the CanDriverBase
11// class in order to be used with the igep driver.
12// platform : Linux specific
13//
14*********************************************************************/
15
16#ifndef PEAKCANDRIVER_H
17#define PEAKCANDRIVER_H
18
19#include "CanDriverBase.h"
20#include "libpcan.h"
21#include <fcntl.h> // O_RDWR
22#include <errno.h>
23#include <string>
24
25#define PSUCCESS 0
26#define READ_TIMEOUT 100000 // 100 miliseconds timeout
27
28class igepCanDriver : public CanDriverBase
29{
30public:
31 igepCanDriver(void);
32 igepCanDriver(int);
33 igepCanDriver(const char* port, const char* mode);
34 igepCanDriver(int channel, unsigned int bitRate);
35 ~igepCanDriver(void);
36
37 short initPort (void);
38 short cleanUpPort (void);
39
40 short sendFrame (struct CanFrame frame);
41 short receiveFrame (struct CanFrame &frame);
42 void waitReceivingFrame(void);
43
44 enum OperationMode{ReadOnly, WriteOnly, ReadWrite};
45
46protected:
47
48private:
49 char * szDevNode_;
50 OperationMode mode_;
51
52 HANDLE canDeviceHandle_;
53
54 void print_message(TPCANMsg *m);
55
56 int s; //socket
57
58};
59
60#endif // PEAKCANDRIVER_H
Note: See TracBrowser for help on using the repository browser.