OpcUaCanOpen
CANopen OPC-UA server
SockCanScan.h
Go to the documentation of this file.
1 /*
2  * SockCanScan.h
3  *
4  * Created on: Jul 21, 2011
5  * Author: vfilimon
6  */
7 
8 #ifndef SOCKCANSCAN_H_
9 #define SOCKCANSCAN_H_
10 
11 #include <pthread.h>
12 #include <unistd.h>
13 
14 #include <string>
15 using namespace std;
16 #include "CCanAccess.h"
17 #include "CCanCallback.h"
18 
19 
20 class CSockCanScan : public CCanAccess
21 {
22 public:
23  CSockCanScan() { } ;
24  int FinalConstruct(const char *port, const char *parameters,CCanCallback *);
25  string &getNamePort() { return name_of_port; }
26  int getHandler() { return sock; }
27  int sendErrorCode(int);
28 
29  virtual ~CSockCanScan();
30 
31  virtual bool sendMessage(short cobID, unsigned char len, unsigned char *message);
32  virtual bool sendRemoteRequest(short cobID);
33  virtual bool createBUS(const char *name ,const char *parameters ,CCanCallback *callback);
34  bool run_can;
35  int numModule;
38  int sock;
39 
41 
42 private:
43 
44 #define Timeout 1000
45  pthread_t m_hCanScanThread;
46  int m_idCanScanThread;
47 
48  int configureCanboard(const char *,const char *);
49  static void* CanScanControlThread(void *);
50  string name_of_port;
51 
52 };
53 
54 
55 #endif /* SOCKCANSCAN_H_ */