libusb-glue.h

Go to the documentation of this file.
00001 
00030 #include "ptp.h"
00031 #include <usb.h>
00032 #include "libmtp.h"
00033 
00034 #define USB_BULK_READ usb_bulk_read
00035 #define USB_BULK_WRITE usb_bulk_write
00036 
00043 #define DEVICE_FLAG_NONE 0x00000000
00044 
00049 #define DEVICE_FLAG_DUALMODE 0x00000001
00050 
00055 #define DEVICE_FLAG_UNLOAD_DRIVER 0x00000002
00056 
00061 #define DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST 0x00000004
00062 
00077 #define DEVICE_FLAG_NO_ZERO_READS 0x00000008
00078 
00089 #define DEVICE_FLAG_IRIVER_OGG_ALZHEIMER 0x00000010
00090 
00094 typedef struct _PTP_USB PTP_USB;
00095 struct _PTP_USB {
00096   usb_dev_handle* handle;
00097   int interface;
00098   int inep;
00099   int inep_maxpacket;
00100   int outep;
00101   int outep_maxpacket;
00102   int intep;
00104   int callback_active;
00105   uint64_t current_transfer_total;
00106   uint64_t current_transfer_complete;
00107   LIBMTP_progressfunc_t current_transfer_callback;
00108   void const * current_transfer_callback_data;
00110   uint32_t device_flags;
00111 };
00112 
00113 struct mtpdevice_list_struct {
00114   struct usb_device *libusb_device;
00115   PTPParams *params;
00116   PTP_USB *ptp_usb;
00117   uint8_t interface_number;
00118   struct mtpdevice_list_struct *next;
00119 };
00120 typedef struct mtpdevice_list_struct mtpdevice_list_t;
00121 
00122 int open_device (int busn, int devn, short force, PTP_USB *ptp_usb, PTPParams *params, struct usb_device **dev);
00123 void dump_usbinfo(PTP_USB *ptp_usb);
00124 void close_device (PTP_USB *ptp_usb, PTPParams *params, uint8_t interfaceNumber);
00125 LIBMTP_error_number_t find_usb_devices(mtpdevice_list_t **devlist);
00126 void free_mtpdevice_list(mtpdevice_list_t *devlist);
00127 
00128 /* connect_first_device return codes */
00129 #define PTP_CD_RC_CONNECTED     0
00130 #define PTP_CD_RC_NO_DEVICES    1
00131 #define PTP_CD_RC_ERROR_CONNECTING      2

Generated on Fri Sep 14 22:09:20 2007 for libmtp by  doxygen 1.5.1