Instrument Neutral Distributed Interface INDI  1.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INDI::USBDevice Class Reference

Class to provide general functionality of a generic USB device. More...

#include <indiusbdevice.h>

Inheritance diagram for INDI::USBDevice:
GPUSBDriver HitecAstroDCFocuser

Public Member Functions

int WriteInterrupt (unsigned char *, int, int)
 
int ReadInterrupt (unsigned char *, int, int)
 
int WriteBulk (unsigned char *buf, int nbytes, int timeout)
 
int ReadBulk (unsigned char *buf, int nbytes, int timeout)
 
int ControlMessage (unsigned char request_type, unsigned char request, unsigned int value, unsigned int index, unsigned char *data, unsigned char len)
 
int FindEndpoints ()
 
int Open ()
 
void Close ()
 
 USBDevice ()
 
 USBDevice (libusb_device *dev)
 
virtual ~USBDevice ()
 

Protected Member Functions

libusb_device * FindDevice (int, int, int)
 

Protected Attributes

libusb_device * dev
 
libusb_device_handle * usb_handle
 
int ProductId
 
int VendorId
 
int OutputType
 
int OutputEndpoint
 
int InputType
 
int InputEndpoint
 

Detailed Description

Class to provide general functionality of a generic USB device.

Developers need to subclass INDI::USBDevice to implement any driver within INDI that requires direct read/write/control over USB.

Definition at line 34 of file indiusbdevice.h.

Constructor & Destructor Documentation

INDI::USBDevice::USBDevice ( )

Definition at line 35 of file indiusbdevice.cpp.

INDI::USBDevice::USBDevice ( libusb_device *  dev)
INDI::USBDevice::~USBDevice ( )
virtual

Definition at line 52 of file indiusbdevice.cpp.

Member Function Documentation

void INDI::USBDevice::Close ( )

Definition at line 128 of file indiusbdevice.cpp.

int INDI::USBDevice::ControlMessage ( unsigned char  request_type,
unsigned char  request,
unsigned int  value,
unsigned int  index,
unsigned char *  data,
unsigned char  len 
)

Definition at line 210 of file indiusbdevice.cpp.

libusb_device * INDI::USBDevice::FindDevice ( int  vendor,
int  product,
int  searchindex 
)
protected

Definition at line 57 of file indiusbdevice.cpp.

int INDI::USBDevice::FindEndpoints ( )

Definition at line 133 of file indiusbdevice.cpp.

int INDI::USBDevice::Open ( )

Definition at line 98 of file indiusbdevice.cpp.

int INDI::USBDevice::ReadBulk ( unsigned char *  buf,
int  nbytes,
int  timeout 
)

Definition at line 188 of file indiusbdevice.cpp.

int INDI::USBDevice::ReadInterrupt ( unsigned char *  buf,
int  count,
int  timeout 
)

Definition at line 166 of file indiusbdevice.cpp.

int INDI::USBDevice::WriteBulk ( unsigned char *  buf,
int  nbytes,
int  timeout 
)

Definition at line 199 of file indiusbdevice.cpp.

int INDI::USBDevice::WriteInterrupt ( unsigned char *  buf,
int  count,
int  timeout 
)

Definition at line 177 of file indiusbdevice.cpp.

Member Data Documentation

libusb_device* INDI::USBDevice::dev
protected

Definition at line 37 of file indiusbdevice.h.

int INDI::USBDevice::InputEndpoint
protected

Definition at line 46 of file indiusbdevice.h.

int INDI::USBDevice::InputType
protected

Definition at line 45 of file indiusbdevice.h.

int INDI::USBDevice::OutputEndpoint
protected

Definition at line 44 of file indiusbdevice.h.

int INDI::USBDevice::OutputType
protected

Definition at line 43 of file indiusbdevice.h.

int INDI::USBDevice::ProductId
protected

Definition at line 40 of file indiusbdevice.h.

libusb_device_handle* INDI::USBDevice::usb_handle
protected

Definition at line 38 of file indiusbdevice.h.

int INDI::USBDevice::VendorId
protected

Definition at line 41 of file indiusbdevice.h.


The documentation for this class was generated from the following files: