OpcUaCanOpen
CANopen OPC-UA server
kvcan.h
Go to the documentation of this file.
1 /*
2  * kvcan.h
3  *
4  * Created on: Apr 5, 2011
5  * Author: vfilimon
6  */
7 
8 #ifndef CCANKVSCAN_H_
9 #define CCANSKVCAN_H_
10 #ifdef WIN32
11 #include "Winsock2.h"
12 #endif
13 
14 #include <string>
15 using namespace std;
16 
17 #include <canlib.h>
18 #include "CCanAccess.h"
19 
20 class KVCanScan: public CCanAccess
21 {
22 public:
23  KVCanScan();
24  virtual ~KVCanScan();
25  virtual bool createBUS(const char * ,const char *);
26  virtual bool sendMessage(short cobID, unsigned char len, unsigned char *message);
27  virtual bool sendRemoteRequest(short cobID);
28 
29  virtual bool getErrorMessage(long error, char **message);
30 private:
31 
32  string getNamePort() { return canName; }
33  bool sendErrorCode(long);
34 // virtual int getHandler();
35 
36  canStatus bus_status;
37  bool run_can;
38  unsigned int numChannel;
39 
40  string canName;
41 
42 #define Timeout 1000
43 
44  canHandle canObjHandler;
45  bool configureCanboard(const char *,const char *);
46 #ifdef WIN32
47  static void CANLIBAPI CanScanControlThread(CanHandle hnd, void* context, unsigned int notifyEvent);
48 #else
49  static void CANLIBAPI CanScanControlThread(canNotifyData *);
50 #endif
51 
52 
53 };
54 
55 #endif