|
| enum | Mode { MODE_CONTROLLER = 0,
MODE_DEVICE = 1
} |
| |
| enum | { EOS_CRLF = 0,
EOS_CR = 1,
EOS_LF = 2,
EOS_NONE = 3
} |
| |
|
| | GpibUsbController (bool doSpawn=false) |
| |
| | GpibUsbController (std::string port, bool doSpawn=false) |
| |
| virtual | ~GpibUsbController () |
| |
|
void | stop () |
| |
| int | connect () |
| |
| int | connectAndClear () |
| |
| void | setAuto (bool doAuto) |
| |
|
void | setMode (Mode mode) |
| |
| virtual void | setAddress (unsigned address) |
| |
| virtual unsigned | getAddress () |
| |
|
void | setEoi (bool sendEoi) |
| |
| std::string | getEoi () |
| |
| std::string | getVersion () |
| |
| std::string | getHelp () |
| |
|
void | setEos (unsigned) |
| |
| std::string | getEos () |
| |
| void | clearInterface () |
| |
| void | resetController () |
| |
|
void | enableEot (bool enable) |
| |
|
void | setEotChar (char eot) |
| |
| std::string | getDevice () |
| |
|
void | resetDevice () |
| |
|
void | clearDevice () |
| |
|
void | clearDeviceInterface () |
| |
| std::string | getSelfTest () |
| |
| void | wait () |
| |
| | SerialClient (std::string port="/dev/ttyS0", int baudRate=9600, bool canonical=false, bool sevenBit=false) |
| |
| virtual | ~SerialClient () |
| |
| void | setPort (std::string port) |
| |
| void | setBaudRate (int baudRate) |
| |
| int | connect () |
| |
| void | disconnect () |
| |
|
std::string | portName () |
| |
|
void | setFd (int fd) |
| |
| | Port (int fd=-1) |
| |
| virtual | ~Port () |
| |
| int | getFd () |
| |
| void | writeString (std::string &message, int fd=-1) |
| |
| void | writeBytes (Vector< unsigned char > &buffer) |
| |
| unsigned int | readBytes (unsigned char *message, int fd=-1) |
| |
|
unsigned int | readBytes (Vector< unsigned char > &buffer) |
| |
|
unsigned char | getNextByte () |
| |
|
std::string | readString (int fd=-1) |
| |
|
bool | concatenateString (std::ostringstream &os, int fd=-1, bool cont=true) |
| |
|
void | concatenateChar (std::ostringstream &os, int fd=-1) |
| |
|
int | getNbyte (int fd=-1) |
| |
| void | terminateAt (std::string strip) |
| |
| void | strip (std::string strip) |
| |
| void | dontStrip (std::string strip) |
| |
| void | stripUnprintable (bool strip) |
| |
| void | append (std::string append) |
| |
| void | setNoBuf () |
| |
| void | setLineBuf () |
| |
| | SpawnableTask (bool spawn) |
| |
| virtual | ~SpawnableTask () |
| |
| void | sendRestartMsg () |
| |
| void | sendStopMsg () |
| |
| void | sendHeartBeatMsg () |
| |
| virtual void | fwdTaskMsg (GpibUsbControllerMsg *msg) |
| |
| | RunnableTask (bool spawnThread) |
| |
| virtual | ~RunnableTask () |
| |
| | Runnable (bool spawnThread, RUN_FN(*runFn)) |
| |
|
| Runnable (bool spawnThread, RUN_FN(*runFn), int priority) |
| |
| virtual | ~Runnable () |
| |
|
void | blockForever () |
| |
|
void | spawn () |
| |
|
|
std::ostringstream | response_ |
| |
|
void * | retVal_ |
| |
|
| enum | Receiver { DEVICE = 0,
CONTROLLER = 1
} |
| |
|
|
void | initialize (bool doSpawn) |
| |
| void | serviceMsgQ (void) |
| |
| void | processMsg (GpibUsbControllerMsg *msg) |
| |
| void | suspendProcessingMessages (bool suspend) |
| |
| void | watchForResponse (bool watch) |
| |
| void | respondToTimeOut () |
| |
| void | readResponse () |
| |
| void | respondToUnexpectedInput () |
| |
| void | sendDeviceCommand (std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0) |
| |
| void | sendControllerCommand (std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0) |
| |
| virtual void | sendCommand (std::string cmd, Receiver rx, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0) |
| |
| void | executeCommand (std::string cmd, bool expectsResponse, GPIB_RESPONSE_HANDLER(*handler), CondVar *condVar, void *retVal) |
| |
| void | executeConnect (void *retVal) |
| |
| void | run () |
| |
| | GenericTask () |
| |
| | GenericTask (Thread *thread) |
| |
| virtual | ~GenericTask () |
| |
| void | sendTaskMsg (GpibUsbControllerMsg *msg) |
| |
| void | startThreads (void *arg) |
| |
| void | startThread (void *arg, unsigned order) |
| |
| unsigned | getMinStartOrder () |
| |
| bool | threadsNeedStarting () |
| |
| void | cancelThreads () |
| |
| void | cancelThread (unsigned order) |
| |
| unsigned | getMinCancelOrder () |
| |
| bool | threadsNeedCancelling () |
| |
| void | pingThreads (void *arg) |
| |
| void | raise (std::string name, int sigNo) |
| |
| Thread * | getThread (std::string name) |
| |
| bool | threadsAreRunning () |
| |
| void | shutdownConnection (int fd) |
| |
| virtual void | restart (void) |
| |
| virtual void | processTaskMsg (bool *stop) |
| |
| virtual void | respondToHeartBeat () |
| |
| virtual void | installTimer (GpibUsbControllerMsg *msg) |
| |
| virtual void | installSignal (GpibUsbControllerMsg *msg) |
| |
| virtual void | enableTimer (GpibUsbControllerMsg *msg) |
| |
| virtual void | addHandler (GpibUsbControllerMsg *msg) |
| |
| void | stepCommands () |
| |
|
virtual void | broadcastReady () |
| |
|
void | spawn (void *arg) |
| |
|
|
static | GPIB_RESPONSE_HANDLER (checkHandler) |
| |
|
static | GPIB_RESPONSE_HANDLER (checkAddress) |
| |
|
static | GPIB_RESPONSE_HANDLER (checkDevice) |
| |
|
static | GPIB_RESPONSE_HANDLER (checkCompletion) |
| |
|
|
static const unsigned int | MAX_RCV_BUFFER = 300 |
| |
|
static const unsigned | TELNET_PORT_NO = 23 |
| |
| GpibUsbController::GpibUsbController |
( |
bool |
doSpawn = false | ) |
|
....................................................................... Constructor.
| GpibUsbController::GpibUsbController |
( |
std::string |
port, |
|
|
bool |
doSpawn = false |
|
) |
| |
....................................................................... Constructor.
| GpibUsbController::~GpibUsbController |
( |
| ) |
|
|
virtual |
....................................................................... Destructor.
| void GpibUsbController::clearInterface |
( |
| ) |
|
....................................................................... Clear the interfacae
| int GpibUsbController::connect |
( |
| ) |
|
|
virtual |
....................................................................... Send a message to connect to the serial port
Reimplemented from gcp::util::Port.
| int GpibUsbController::connectAndClear |
( |
| ) |
|
....................................................................... Connect to the controller, and send a message to clear the interface
| void GpibUsbController::executeCommand |
( |
std::string |
cmd, |
|
|
bool |
expectsResponse, |
|
|
GPIB_RESPONSE_HANDLER * |
handler, |
|
|
CondVar * |
condVar, |
|
|
void * |
retVal |
|
) |
| |
|
protected |
....................................................................... Execute a command
| void GpibUsbController::executeConnect |
( |
void * |
retVal | ) |
|
|
protected |
....................................................................... Open the psuedo-serial port
| unsigned GpibUsbController::getAddress |
( |
| ) |
|
|
virtual |
....................................................................... Get the GPIB address of the controller
| std::string GpibUsbController::getDevice |
( |
| ) |
|
....................................................................... Get the device identification string
| std::string GpibUsbController::getEoi |
( |
| ) |
|
....................................................................... Get the EOI state from the controller
| std::string GpibUsbController::getEos |
( |
| ) |
|
....................................................................... Get the EOS state from the controller
| std::string GpibUsbController::getHelp |
( |
| ) |
|
....................................................................... Get the help string from the controller
| std::string GpibUsbController::getSelfTest |
( |
| ) |
|
....................................................................... Query the status of a self test
| std::string GpibUsbController::getVersion |
( |
| ) |
|
....................................................................... Get the version string from the controller
....................................................................... Main Task event loop: when this is called, the task blocks forever in select(), or until a stop message is received.
Reimplemented from gcp::util::SpawnableTask< GpibUsbControllerMsg >.
| void GpibUsbController::readResponse |
( |
| ) |
|
|
protected |
....................................................................... Read/continue reading a response
| void GpibUsbController::resetController |
( |
| ) |
|
....................................................................... Reset the controller
| void GpibUsbController::respondToTimeOut |
( |
| ) |
|
|
protected |
....................................................................... Respond to a timeout while waiting for a response
| void GpibUsbController::respondToUnexpectedInput |
( |
| ) |
|
|
protected |
....................................................................... Respond to unexpected input from the controller
| void GpibUsbController::sendCommand |
( |
std::string |
cmd, |
|
|
Receiver |
rx, |
|
|
bool |
expectsResponse = false, |
|
|
GPIB_RESPONSE_HANDLER * |
handler = 0, |
|
|
bool |
block = false, |
|
|
void * |
retVal = 0 |
|
) |
| |
|
protectedvirtual |
....................................................................... Send a command
| void GpibUsbController::sendControllerCommand |
( |
std::string |
cmd, |
|
|
bool |
expectsResponse = false, |
|
|
GPIB_RESPONSE_HANDLER * |
handler = 0, |
|
|
bool |
block = false, |
|
|
void * |
retVal = 0 |
|
) |
| |
|
protected |
....................................................................... Send a controller command
| void GpibUsbController::sendDeviceCommand |
( |
std::string |
cmd, |
|
|
bool |
expectsResponse = false, |
|
|
GPIB_RESPONSE_HANDLER * |
handler = 0, |
|
|
bool |
block = false, |
|
|
void * |
retVal = 0 |
|
) |
| |
|
protected |
....................................................................... Send a device command
| void GpibUsbController::serviceMsgQ |
( |
void |
| ) |
|
|
protectedvirtual |
....................................................................... Main Task event loop: when this is called, the task blocks forever in select(), or until a stop message is received.
Reimplemented from gcp::util::GenericTask< GpibUsbControllerMsg >.
| void GpibUsbController::setAddress |
( |
unsigned |
address | ) |
|
|
virtual |
........................................................................ Set the GPIB address of the controller device
| void GpibUsbController::setAuto |
( |
bool |
doAuto | ) |
|
....................................................................... Set the GPIB controller mode to automatically listen for a response from the GPIB device
| void GpibUsbController::suspendProcessingMessages |
( |
bool |
suspend | ) |
|
|
protected |
....................................................................... Suspend or resume processing messages
| void GpibUsbController::wait |
( |
| ) |
|
....................................................................... Issue GPIB WAIT command
| void GpibUsbController::watchForResponse |
( |
bool |
watch | ) |
|
|
protected |
....................................................................... Watch the serial port for a response, and set a timeout
The documentation for this class was generated from the following files: