libmtp: /tmp/libmtp-0.2.6.1/src/libusb-glue.h Source File

# 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
    00040 typedef struct _PTP_USB PTP_USB;
    00041 struct _PTP_USB {
    00042   PTPParams *params;
    00043   usb_dev_handle* handle;
    00044   uint8_t interface;
    00045   int inep;
    00046   int inep_maxpacket;
    00047   int outep;
    00048   int outep_maxpacket;
    00049   int intep;
    00051   int callback_active;
    00052   uint64_t current_transfer_total;
    00053   uint64_t current_transfer_complete;
    00054   LIBMTP_progressfunc_t current_transfer_callback;
    00055   void const * current_transfer_callback_data;
    00057   uint32_t device_flags;
    00058 };
    00059
    00060 struct mtpdevice_list_struct {
    00061   struct usb_device *libusb_device;
    00062   PTPParams *params;
    00063   PTP_USB *ptp_usb;
    00064   struct mtpdevice_list_struct *next;
    00065 };
    00066 typedef struct mtpdevice_list_struct mtpdevice_list_t;
    00067
    00068 int open_device (int busn, int devn, short force, PTP_USB *ptp_usb, PTPParams *params, struct usb_device **dev);
    00069 void dump_usbinfo(PTP_USB *ptp_usb);
    00070 void close_device (PTP_USB *ptp_usb, PTPParams *params);
    00071 LIBMTP_error_number_t find_usb_devices(mtpdevice_list_t **devlist);
    00072 void free_mtpdevice_list(mtpdevice_list_t *devlist);
    00073
    00074 /* connect_first_device return codes */
    00075 #define PTP_CD_RC_CONNECTED     0
    00076 #define PTP_CD_RC_NO_DEVICES    1
    00077 #define PTP_CD_RC_ERROR_CONNECTING      2