libusb-glue.h
Go to the documentation of this file.
#include "ptp.h"
#include <usb.h>
#include "libmtp.h"
#define USB_BULK_READ usb_bulk_read
#define USB_BULK_WRITE usb_bulk_write
#define DEVICE_FLAG_NONE 0x00000000
#define DEVICE_FLAG_DUALMODE 0x00000001
#define DEVICE_FLAG_UNLOAD_DRIVER 0x00000002
#define DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST 0x00000004
#define DEVICE_FLAG_NO_ZERO_READS 0x00000008
typedef struct _PTP_USB PTP_USB;
struct _PTP_USB {
usb_dev_handle* handle;
int interface;
int inep;
int inep_maxpacket;
int outep;
int outep_maxpacket;
int intep;
int callback_active;
uint64_t current_transfer_total;
uint64_t current_transfer_complete;
LIBMTP_progressfunc_t current_transfer_callback;
void const * current_transfer_callback_data;
uint32_t device_flags;
};
struct mtpdevice_list_struct {
struct usb_device *libusb_device;
PTPParams *params;
PTP_USB *ptp_usb;
uint8_t interface_number;
struct mtpdevice_list_struct *next;
};
typedef struct mtpdevice_list_struct mtpdevice_list_t;
int open_device (int busn, int devn, short force, PTP_USB *ptp_usb, PTPParams *params, struct usb_device **dev);
void dump_usbinfo(PTP_USB *ptp_usb);
void close_device (PTP_USB *ptp_usb, PTPParams *params, uint8_t interfaceNumber);
LIBMTP_error_number_t find_usb_devices(mtpdevice_list_t **devlist);
void free_mtpdevice_list(mtpdevice_list_t *devlist);
/* connect_first_device return codes */
#define PTP_CD_RC_CONNECTED 0
#define PTP_CD_RC_NO_DEVICES 1
#define PTP_CD_RC_ERROR_CONNECTING 2
_PTP_USB::device_flags
uint32_t device_flags
Definition: libusb-glue.h:98
dump_usbinfo
void dump_usbinfo(PTP_USB *ptp_usb)
Definition: libusb-glue.c:529
find_usb_devices
LIBMTP_error_number_t find_usb_devices(mtpdevice_list_t **devlist)
Definition: libusb-glue.c:1618
LIBMTP_progressfunc_t
int(* LIBMTP_progressfunc_t)(uint64_t const sent, uint64_t const total, void const *const data)
Definition: libmtp.h:146
_PTP_USB::callback_active
int callback_active
Definition: libusb-glue.h:92
LIBMTP_error_number_t
LIBMTP_error_number_t
Definition: libmtp.h:114
mtpdevice_list_struct
Definition: libusb-glue.h:101
free_mtpdevice_list
void free_mtpdevice_list(mtpdevice_list_t *devlist)
Definition: libusb-glue.c:353
_PTPParams
Definition: ptp.h:1319
libmtp.h
_PTP_USB
Definition: libusb-glue.h:83