areaDetector  3-5-0
EPICS areaDetector framework
siswSerialPort.h
Go to the documentation of this file.
1 
9 /*
10  * Include files.
11  */
12 #ifdef _WIN32
13 #include <windows.h>
14 #else
15 #include <dlfcn.h>
16 
17 #endif
18 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string>
22 #include "logfile.h"
23 #include "time.h"
24 #include "comportInterface.h"
25 #include "ccd_exception.h"
26 // si software serial port calls
27 
28 #ifdef USE_SISW
29 
30 //#include "clser.h"
31 /*
32  * Double incluson protection.
33  */
34 #ifndef _siswSerialPort_H
35 #define _siswSerialPort_H
36 
37 /*
38  * Class for
39  */
40 
41 class siswSerialPort : public comportInterface {
42  public:
43  siswSerialPort(char *name,log_file *lf_);
44  ~siswSerialPort();
45  /*
46  * ports we can write to
47  */
48 
49  virtual void open(void);
50  virtual void open(int baud, int parity, int nbits, int nstop);
51 
52  virtual void open(int baud, int parity, int nbits, int nstop, int rdtimeout);
53 
54  virtual void write(unsigned char *buffer, int length);
55  virtual void read(unsigned char *buffer, int length);
56  virtual void write(unsigned char c);
57  virtual unsigned char read(void);
58  virtual void close(void);
59  virtual void flush(void);
60  virtual void clearPipe();
61 
62  virtual void setPortName(char *n){};
63 
64  virtual void wait(int us);
65 
66  // for timing things. call tic. toc returns time in s since last tic.
67  virtual void tic();
68  virtual double toc();
69 
70  protected:
71  void readDll(void);
72 
73  bool is_open;
74 
75  double currenttime, elapsedtime;
76 
77  void *serial_ref;
78  char mesgx[512];
79  log_file *lf;
80 };
81 
82 #endif
83 #endif
virtual void clearPipe()=0
virtual void tic()=0
virtual unsigned char read(void)=0
Interface to a com port, on a grabber.
Definition: comportInterface.h:24
name
Definition: makeDbAndEdl.py:232
virtual void flush(void)=0
virtual void write(unsigned char *buffer, int length)=0
virtual void setPortName(char *n)=0
Class LOG_FILE.
Definition: logfile.h:38
virtual double toc()=0
virtual void open(void)=0
virtual void wait(int us)=0
virtual void close(void)=0