.TH "libusb-glue.h" 3 "Version 1.1.22" "libmtp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
libusb-glue.h
.SH SYNOPSIS
.br
.PP
\fR#include 'ptp\&.h'\fP
.br
\fR#include 'libmtp\&.h'\fP
.br
\fR#include 'device\-flags\&.h'\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fB_PTP_USB\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBLIBMTP_USB_DEBUG\fP(format,  args\&.\&.\&.)"
.br
.ti -1c
.RI "#define \fBLIBMTP_USB_DATA\fP(buffer,  length,  base)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_MTPGETOBJPROPLIST_ALL\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_UNLOAD_DRIVER\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_MTPGETOBJPROPLIST\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_NO_ZERO_READS\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_IRIVER_OGG_ALZHEIMER\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_ONLY_7BIT_FILENAMES\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_NO_RELEASE_INTERFACE\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_IGNORE_HEADER_ERRORS\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_SET_OBJECT_PROPLIST\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_OGG_IS_UNKNOWN\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_SET_SAMPLE_DIMENSIONS\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_ALWAYS_PROBE_DESCRIPTOR\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_PLAYLIST_SPL_V1\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_PLAYLIST_SPL_V2\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_PLAYLIST_SPL\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_CANNOT_HANDLE_DATEMODIFIED\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_SEND_OBJECT_PROPLIST\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_BROKEN_BATTERY_LEVEL\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_FLAC_IS_UNKNOWN\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_UNIQUE_FILENAMES\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_SWITCH_MODE_BLACKBERRY\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_LONG_TIMEOUT\fP(a)"
.br
.ti -1c
.RI "#define \fBFLAG_FORCE_RESET_ON_CLOSE\fP(a)"
.br
.ti -1c
.RI "#define \fBPTP_CD_RC_CONNECTED\fP   0"
.br
.ti -1c
.RI "#define \fBPTP_CD_RC_NO_DEVICES\fP   1"
.br
.ti -1c
.RI "#define \fBPTP_CD_RC_ERROR_CONNECTING\fP   2"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef struct \fB_PTP_USB\fP \fBPTP_USB\fP"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBdump_usbinfo\fP (\fBPTP_USB\fP *ptp_usb)"
.br
.ti -1c
.RI "const char * \fBget_playlist_extension\fP (\fBPTP_USB\fP *ptp_usb)"
.br
.ti -1c
.RI "void \fBclose_device\fP (\fBPTP_USB\fP *ptp_usb, \fBPTPParams\fP *params)"
.br
.ti -1c
.RI "\fBLIBMTP_error_number_t\fP \fBconfigure_usb_device\fP (\fBLIBMTP_raw_device_t\fP *device, \fBPTPParams\fP *params, void **usbinfo)"
.br
.ti -1c
.RI "void \fBset_usb_device_timeout\fP (\fBPTP_USB\fP *ptp_usb, int timeout)"
.br
.ti -1c
.RI "void \fBget_usb_device_timeout\fP (\fBPTP_USB\fP *ptp_usb, int *timeout)"
.br
.ti -1c
.RI "int \fBguess_usb_speed\fP (\fBPTP_USB\fP *ptp_usb)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Low-level USB interface glue towards libusb\&.

.PP
Copyright (C) 2005-2007 Richard A\&. Low richard@wentnet.com Copyright (C) 2005-2012 Linus Walleij triad@df.lth.se Copyright (C) 2006-2011 Marcus Meissner Copyright (C) 2007 Ted Bullock Copyright (C) 2008 Chris Bagwell chris@cnpbagwell.com

.PP
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version\&.

.PP
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&. See the GNU Lesser General Public License for more details\&.

.PP
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc\&., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\&.

.PP
Created by Richard Low on 24/12/2005\&. Modified by Linus Walleij 
.SH "Macro Definition Documentation"
.PP 
.SS "#define FLAG_ALWAYS_PROBE_DESCRIPTOR( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR)
.PP
.fi

.SS "#define FLAG_BROKEN_BATTERY_LEVEL( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_BATTERY_LEVEL)
.PP
.fi

.SS "#define FLAG_BROKEN_MTPGETOBJPROPLIST( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST)
.PP
.fi

.SS "#define FLAG_BROKEN_MTPGETOBJPROPLIST_ALL( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL)
.PP
.fi

.SS "#define FLAG_BROKEN_SEND_OBJECT_PROPLIST( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_SEND_OBJECT_PROPLIST)
.PP
.fi

.SS "#define FLAG_BROKEN_SET_OBJECT_PROPLIST( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST)
.PP
.fi

.SS "#define FLAG_BROKEN_SET_SAMPLE_DIMENSIONS( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_BROKEN_SET_SAMPLE_DIMENSIONS)
.PP
.fi

.SS "#define FLAG_CANNOT_HANDLE_DATEMODIFIED( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED)
.PP
.fi

.SS "#define FLAG_FLAC_IS_UNKNOWN( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_FLAC_IS_UNKNOWN)
.PP
.fi

.SS "#define FLAG_FORCE_RESET_ON_CLOSE( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_FORCE_RESET_ON_CLOSE)
.PP
.fi

.SS "#define FLAG_IGNORE_HEADER_ERRORS( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_IGNORE_HEADER_ERRORS)
.PP
.fi

.SS "#define FLAG_IRIVER_OGG_ALZHEIMER( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_IRIVER_OGG_ALZHEIMER)
.PP
.fi

.SS "#define FLAG_LONG_TIMEOUT( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_LONG_TIMEOUT)
.PP
.fi

.SS "#define FLAG_NO_RELEASE_INTERFACE( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_NO_RELEASE_INTERFACE)
.PP
.fi

.SS "#define FLAG_NO_ZERO_READS( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_NO_ZERO_READS)
.PP
.fi

.SS "#define FLAG_OGG_IS_UNKNOWN( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_OGG_IS_UNKNOWN)
.PP
.fi

.SS "#define FLAG_ONLY_7BIT_FILENAMES( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_ONLY_7BIT_FILENAMES)
.PP
.fi

.SS "#define FLAG_PLAYLIST_SPL( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & (DEVICE_FLAG_PLAYLIST_SPL_V1 | DEVICE_FLAG_PLAYLIST_SPL_V2))
.PP
.fi

.SS "#define FLAG_PLAYLIST_SPL_V1( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_PLAYLIST_SPL_V1)
.PP
.fi

.SS "#define FLAG_PLAYLIST_SPL_V2( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_PLAYLIST_SPL_V2)
.PP
.fi

.SS "#define FLAG_SWITCH_MODE_BLACKBERRY( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_SWITCH_MODE_BLACKBERRY)
.PP
.fi

.SS "#define FLAG_UNIQUE_FILENAMES( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_UNIQUE_FILENAMES)
.PP
.fi

.SS "#define FLAG_UNLOAD_DRIVER( a)"
\fBValue:\fP
.nf
  ((a)\->rawdevice\&.device_entry\&.device_flags & DEVICE_FLAG_UNLOAD_DRIVER)
.PP
.fi

.SS "#define LIBMTP_USB_DATA( buffer,  length,  base)"
\fBValue:\fP
.nf
  do { \\
    if ((LIBMTP_debug & LIBMTP_DEBUG_DATA) != 0) \\
      data_dump_ascii (stdout, buffer, length, base); \\
  } while (0)
.PP
.fi

.SS "#define LIBMTP_USB_DEBUG( format,  args\&.\&.\&.)"
\fBValue:\fP
.nf
  do { \\
    if ((LIBMTP_debug & LIBMTP_DEBUG_USB) != 0) \\
      fprintf(stdout, "LIBMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \\
  } while (0)
.PP
.fi
Debug macro 
.SH "Typedef Documentation"
.PP 
.SS "typedef struct \fB_PTP_USB\fP \fBPTP_USB\fP"
Internal USB struct\&. 
.SH "Function Documentation"
.PP 
.SS "\fBLIBMTP_error_number_t\fP configure_usb_device (\fBLIBMTP_raw_device_t\fP * device, \fBPTPParams\fP * params, void ** usbinfo)"
This function assigns params and usbinfo given a raw device as input\&. 
.PP
\fBParameters\fP
.RS 4
\fIdevice\fP the device to be assigned\&. 
.br
\fIparams\fP current session parameters for this device\&. 
.br
\fIusbinfo\fP a pointer to the new usbinfo\&. 
.RE
.PP
\fBReturns\fP
.RS 4
an error code\&. 
.RE
.PP

.PP
References \fBLIBMTP_raw_device_struct::device_entry\fP, \fBLIBMTP_device_entry_struct::product_id\fP, \fB_PTP_USB::rawdevice\fP, and \fBLIBMTP_device_entry_struct::vendor_id\fP\&.
.SS "void dump_usbinfo (\fBPTP_USB\fP * ptp_usb)"
This routine just dumps out low-level USB information about the current device\&. 
.PP
\fBParameters\fP
.RS 4
\fIptp_usb\fP the USB device to get information from\&. 
.RE
.PP

.PP
References \fBLIBMTP_raw_device_struct::bus_location\fP, \fBLIBMTP_raw_device_struct::device_entry\fP, \fBLIBMTP_device_entry_struct::device_flags\fP, \fBLIBMTP_raw_device_struct::devnum\fP, \fBLIBMTP_device_entry_struct::product\fP, \fBLIBMTP_device_entry_struct::product_id\fP, \fB_PTP_USB::rawdevice\fP, \fBLIBMTP_device_entry_struct::vendor\fP, and \fBLIBMTP_device_entry_struct::vendor_id\fP\&.
.SS "const char * get_playlist_extension (\fBPTP_USB\fP * ptp_usb)"
Retrieve the appropriate playlist extension for this device\&. Rather hacky at the moment\&. This is probably desired by the managing software, but when creating lists on the device itself you notice certain preferences\&. 
.PP
\fBParameters\fP
.RS 4
\fIptp_usb\fP the USB device to get suggestion for\&. 
.RE
.PP
\fBReturns\fP
.RS 4
the suggested playlist extension\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for libmtp from the source code\&.