|
areaDetector
3-5-0
EPICS areaDetector framework
|
Class for general serial port. More...
#include <sw_com_port.h>
Public Member Functions | |
| sw_com_port (char *name, log_file *lf_) | |
| Class for general serial port. More... | |
| ~sw_com_port () | |
| Destructior. More... | |
| virtual void | open (void) |
| OPen com port with default settings. More... | |
| virtual void | open (int baud, int parity, int nbits, int nstop) |
| Open comport with baud as int, parity (1,0), nbits 7,8, nstop, 0,1. More... | |
| virtual void | open (int baud, int parity, int nbits, int nstop, int rdtimeout) |
| Open com port with standard specs and add read time out in ms. More... | |
| virtual void | write (unsigned char *buffer, int length) |
| Write mem buffer of byes, num bytes to ser port, flush. More... | |
| virtual void | read (unsigned char *buffer, int length) |
| read length bytes into bufferfrom ser port. More... | |
| virtual void | write (unsigned char c) |
| Write byte to serial port, flush. More... | |
| virtual unsigned char | read (void) |
| read 1 byte from ser port. More... | |
| virtual void | close (void) |
| close ser port. More... | |
| virtual void | flush (void) |
| virtual void | clearPipe () |
| read ser port until no data left. More... | |
| virtual void | setPortName (char *n) |
| Set port name like COM1 or etc. More... | |
| virtual void | wait (int us) |
| Waait in a for loop. More... | |
| virtual void | tic () |
| Start a stop watch. More... | |
| virtual double | toc () |
| read stop watch in sec. More... | |
Protected Attributes | |
| bool | is_open |
| double | currenttime |
| double | elapsedtime |
| char | INBUFFER [500] |
| char | OUTBUFFER [20] |
| int | bytes_read |
| int | bytes_written |
| int | bStatus |
| char | port_name [64] |
| log_file * | lf |
| std::queue< unsigned char > * | myqueue |
Class for general serial port.
Can be overridden. Used for camera link serial port.
| sw_com_port::sw_com_port | ( | char * | name, |
| log_file * | lf_ | ||
| ) |
Class for general serial port.
Can be overridden. Used for camera link serial port.
| name | C string like "COM2" |
| sw_com_port::~sw_com_port | ( | ) |
Destructior.
|
virtual |
read ser port until no data left.
clears out garbage that may be in serial port.
Implements comportInterface.
|
virtual |
close ser port.
Implements comportInterface.
|
virtual |
Implements comportInterface.
|
virtual |
OPen com port with default settings.
115200 baud, 1stop, no parituy, 8 bit data.
Implements comportInterface.
|
virtual |
Open comport with baud as int, parity (1,0), nbits 7,8, nstop, 0,1.
| baud | baud rate like 9600 or 115200 |
| parity | 1 or 0 |
| nbits | 7 or 8 |
| nstop | 1 or 0 |
Implements comportInterface.
|
virtual |
Open com port with standard specs and add read time out in ms.
| baud | Baud rate |
| parity | 1 or 0 |
| nbits | 7 or 8 bits |
| nstop | 0 opr 1 stop bits |
| rdtimeout | int millisec for timeout. |
Implements comportInterface.
|
virtual |
read length bytes into bufferfrom ser port.
| buffer | Read ser port into this memory. |
| length | max len of data to read from ser port. |
Implements comportInterface.
|
virtual |
read 1 byte from ser port.
Implements comportInterface.
|
virtual |
|
virtual |
|
virtual |
read stop watch in sec.
return double seconds since tic. let stop watch keep going. likc toc in matlab.
Implements comportInterface.
|
virtual |
Waait in a for loop.
Not a sleep. give micro sec.
| num | microsec to loop. or wait. |
Implements comportInterface.
|
virtual |
Write mem buffer of byes, num bytes to ser port, flush.
| buffer | mem w/ message or data to send to ser port./ |
| length | lengt of message to send in bytes |
Implements comportInterface.
|
virtual |
Write byte to serial port, flush.
| c | char to write to ser port. |
Implements comportInterface.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.15