25 #ifndef _SW_COM_PORT_H 26 #define _SW_COM_PORT_H 40 virtual void open(
void);
41 virtual void open(
int baud,
int parity,
int nbits,
int nstop);
43 virtual void open(
int baud,
int parity,
int nbits,
int nstop,
int rdtimeout);
45 virtual void write(
unsigned char *buffer,
int length);
46 virtual void read(
unsigned char *buffer,
int length);
47 virtual void write(
unsigned char c);
48 virtual unsigned char read(
void);
49 virtual void close(
void);
50 virtual void flush(
void);
55 virtual void wait(
int us);
int bStatus
Definition: sw_com_port.h:76
int bytes_read
Definition: sw_com_port.h:70
int bytes_written
Definition: sw_com_port.h:72
Interface to a com port, on a grabber.
Definition: comportInterface.h:24
name
Definition: makeDbAndEdl.py:232
virtual void setPortName(char *n)
Set port name like COM1 or etc.
Definition: sw_com_port.cpp:39
char OUTBUFFER[20]
Definition: sw_com_port.h:68
virtual double toc()
read stop watch in sec.
Definition: sw_com_port.cpp:190
virtual void write(unsigned char *buffer, int length)
Write mem buffer of byes, num bytes to ser port, flush.
Definition: sw_com_port.cpp:101
virtual void close(void)
close ser port.
Definition: sw_com_port.cpp:149
virtual void flush(void)
Definition: sw_com_port.cpp:142
std::queue< unsigned char > * myqueue
Definition: sw_com_port.h:85
bool is_open
Definition: sw_com_port.h:62
virtual void tic()
Start a stop watch.
Definition: sw_com_port.cpp:181
char port_name[64]
Definition: sw_com_port.h:82
Class LOG_FILE.
Definition: logfile.h:38
virtual unsigned char read(void)
read 1 byte from ser port.
Definition: sw_com_port.cpp:116
double elapsedtime
Definition: sw_com_port.h:64
sw_com_port(char *name, log_file *lf_)
Class for general serial port.
Definition: sw_com_port.cpp:16
log_file * lf
Definition: sw_com_port.h:83
~sw_com_port()
Destructior.
Definition: sw_com_port.cpp:28
virtual void clearPipe()
read ser port until no data left.
Definition: sw_com_port.cpp:157
char INBUFFER[500]
Definition: sw_com_port.h:66
double currenttime
Definition: sw_com_port.h:64
virtual void open(void)
OPen com port with default settings.
Definition: sw_com_port.cpp:77
virtual void wait(int us)
Waait in a for loop.
Definition: sw_com_port.cpp:166
Class for general serial port.
Definition: sw_com_port.h:32