00001
00025 #ifndef _USBP_LIBUSB_H_
00026 #define _USBP_LIBUSB_H_
00027
00028 #include "usb.h"
00029 #include "usbp_iusb_driver.h"
00030
00031 class CUsbpLibUSB : public iUSB_Driver
00032 {
00033
00034 private:
00035
00036 protected:
00037
00038 public:
00039 usb_dev_handle *USBDevice;
00040 struct usb_bus *busses;
00041
00042 CUsbpLibUSB(){
00043 USBDevice = NULL;
00044 busses = NULL;
00045 }
00046
00047 virtual ~CUsbpLibUSB(){
00048 if(USBDevice)
00049 delete USBDevice;
00050 busses = NULL;
00051 }
00052
00053 int deviceInfo(void);
00054 int deviceInfo(int vid, int pid);
00055 int deviceOpen(int vid, int pid);
00056 int deviceStatus(void);
00057 int deviceCheck(void);
00058 int deviceClose(int vid, int pid);
00059
00060 int controlWrite(byte reqCode,
00061 unsigned short value,
00062 unsigned short index,
00063 byte *b, int len, int timeout);
00064
00065 int bulkRead(int ep, int size, byte *b);
00066 int bulkWrite(int ep, int size, byte *b);
00067 int bulkWriteRead(int ep_out, int ep_in, int size, byte *b);
00068
00069 int assignEpt(void);
00070
00071 };
00072
00073 #endif