My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
GpibUsbDevice.h
Go to the documentation of this file.
1 // $Id: GpibUsbDevice.h,v 1.1 2009/08/13 21:34:51 eml Exp $
2 
3 #ifndef GCP_UTIL_GPIBUSBDEVICE_H
4 #define GCP_UTIL_GPIBUSBDEVICE_H
5 
15 #include "gcp/util/common/GpibUsbController.h"
16 
17 #include <string>
18 
19 namespace gcp {
20  namespace util {
21 
22  class GpibUsbDevice {
23  public:
24 
25  // Constructor.
26 
27  GpibUsbDevice(bool doSpawn=false);
28  GpibUsbDevice(std::string port, bool doSpawn=false);
29  GpibUsbDevice(GpibUsbController& controller);
30 
31  // Destructor.
32 
33  virtual ~GpibUsbDevice();
34 
35  // Set the address for this device
36 
37  void setAddress(unsigned address);
38  unsigned getAddress();
39 
40  // Convenience accessor methods to the controller
41 
42  void sendDeviceCommand(std::string cmd, bool expectsResponse=false,
43  GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false,
44  void* retVal=0);
45 
46  void sendControllerCommand(std::string cmd, bool expectsResponse=false,
47  GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void* retVal=0);
48 
49  std::string getDevice();
50 
51  GpibUsbController* controller() {
52  return controller_;
53  }
54 
55  private:
56 
57  unsigned address_;
58  GpibUsbController* controller_;
59  bool ownController_;
60 
61  }; // End class GpibUsbDevice
62 
63  } // End namespace util
64 } // End namespace gcp
65 
66 
67 
68 #endif // End #ifndef GCP_UTIL_GPIBUSBDEVICE_H
virtual ~GpibUsbDevice()
Definition: GpibUsbDevice.cc:33
void setAddress(unsigned address)
Definition: GpibUsbDevice.cc:67
Definition: GpibUsbDevice.h:22
void sendDeviceCommand(std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0)
Definition: GpibUsbDevice.cc:44
void sendControllerCommand(std::string cmd, bool expectsResponse=false, GPIB_RESPONSE_HANDLER(*handler)=0, bool block=false, void *retVal=0)
Definition: GpibUsbDevice.cc:57
unsigned getAddress()
Definition: GpibUsbDevice.cc:75
Definition: GpibUsbController.h:53
GpibUsbDevice(bool doSpawn=false)
Definition: GpibUsbDevice.cc:9