3 #ifndef GCP_UTIL_GPIBUSBCONTROLLER_H
4 #define GCP_UTIL_GPIBUSBCONTROLLER_H
15 #include "gcp/util/common/CondVar.h"
16 #include "gcp/util/common/SerialClient.h"
17 #include "gcp/util/common/SpawnableTask.h"
18 #include "gcp/util/common/GenericTaskMsg.h"
19 #include "gcp/util/common/TimeOut.h"
23 #define GPIB_RESPONSE_HANDLER(fn) bool (fn)(void* arg)
41 unsigned char cmd_[100];
42 bool expectsResponse_;
43 GPIB_RESPONSE_HANDLER(*responseHandler_);
87 void setMode(Mode mode);
96 void setEoi(
bool sendEoi);
116 void setEos(
unsigned);
132 void enableEot(
bool enable);
137 void setEotChar(
char eot);
157 void clearDeviceInterface();
167 std::ostringstream response_;
176 static GPIB_RESPONSE_HANDLER(checkString);
193 std::string devName_;
194 std::string lastCmd_;
195 bool expectingResponse_;
196 GPIB_RESPONSE_HANDLER(*responseHandler_);
205 void initialize(
bool doSpawn);
230 GPIB_RESPONSE_HANDLER(*handler)=0,
bool block=
false,
234 GPIB_RESPONSE_HANDLER(*handler)=0,
bool block=
false,
void* retVal=0);
236 virtual void sendCommand(std::string cmd, Receiver rx,
bool expectsResponse=
false,
237 GPIB_RESPONSE_HANDLER(*handler)=0,
bool block=
false,
void* retVal=0);
240 GPIB_RESPONSE_HANDLER(*handler),
CondVar* condVar,
void* retVal);
246 static GPIB_RESPONSE_HANDLER(checkHandler);
248 static GPIB_RESPONSE_HANDLER(checkAddress);
249 static GPIB_RESPONSE_HANDLER(checkDevice);
250 static GPIB_RESPONSE_HANDLER(checkCompletion);
259 #endif // End #ifndef GCP_UTIL_GPIBUSBCONTROLLER_H
Definition: GenericTaskMsg.h:31
virtual void setAddress(unsigned address)
Definition: GpibUsbController.cc:545
void respondToUnexpectedInput()
Definition: GpibUsbController.cc:251
std::string getEoi()
Definition: GpibUsbController.cc:713
void processMsg(GpibUsbControllerMsg *msg)
Definition: GpibUsbController.cc:260
std::string getVersion()
Definition: GpibUsbController.cc:506
void sendControllerCommand(std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0)
Definition: GpibUsbController.cc:305
virtual ~GpibUsbController()
Definition: GpibUsbController.cc:49
void sendDeviceCommand(std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0)
Definition: GpibUsbController.cc:287
Definition: GpibUsbDevice.h:22
virtual void sendCommand(std::string cmd, Receiver rx, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0)
Definition: GpibUsbController.cc:314
virtual unsigned getAddress()
Definition: GpibUsbController.cc:557
std::string getDevice()
Definition: GpibUsbController.cc:623
void executeCommand(std::string cmd, bool expectsResponse, GPIB_RESPONSE_HANDLER(*handler), CondVar *condVar, void *retVal)
Definition: GpibUsbController.cc:369
Definition: SpawnableTask.h:31
void resetController()
Definition: GpibUsbController.cc:692
Definition: SerialClient.h:18
int connect()
Definition: GpibUsbController.cc:403
int connectAndClear()
Definition: GpibUsbController.cc:438
void executeConnect(void *retVal)
Definition: GpibUsbController.cc:452
std::string getSelfTest()
Definition: GpibUsbController.cc:648
std::string getEos()
Definition: GpibUsbController.cc:730
void setAuto(bool doAuto)
Definition: GpibUsbController.cc:481
void suspendProcessingMessages(bool suspend)
Definition: GpibUsbController.cc:137
void readResponse()
Definition: GpibUsbController.cc:201
void wait()
Definition: GpibUsbController.cc:676
GpibUsbController(bool doSpawn=false)
Definition: GpibUsbController.cc:14
Definition: GpibUsbController.h:53
std::string getHelp()
Definition: GpibUsbController.cc:516
void respondToTimeOut()
Definition: GpibUsbController.cc:170
void clearInterface()
Definition: GpibUsbController.cc:684
Definition: GpibUsbController.h:32
void serviceMsgQ(void)
Definition: GpibUsbController.cc:59
void watchForResponse(bool watch)
Definition: GpibUsbController.cc:153