CARMA C++
GpibUsbDevice.h
Go to the documentation of this file.
1 // $Id: GpibUsbDevice.h,v 1.1 2010/12/13 21:06:30 eml Exp $
2 
3 #ifndef SZA_UTIL_GPIBUSBDEVICE_H
4 #define SZA_UTIL_GPIBUSBDEVICE_H
5 
16 
17 #include <string>
18 
19 namespace sza {
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 sza
65 
66 
67 
68 #endif // End #ifndef SZA_UTIL_GPIBUSBDEVICE_H
Tagged: Tue Oct 16 13:01:01 PDT 2007.