<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libusb: libusb_transfer Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2 --> <script type="text/javascript"> <!-- function changeDisplayState (e){ var num=this.id.replace(/[^[0-9]/g,''); var button=this.firstChild; var sectionDiv=document.getElementById('dynsection'+num); if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ sectionDiv.style.display='block'; button.src='open.gif'; }else{ sectionDiv.style.display='none'; button.src='closed.gif'; } } function initDynSections(){ var divs=document.getElementsByTagName('div'); var sectionCounter=1; for(var i=0;i<divs.length-1;i++){ if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ var header=divs[i]; var section=divs[i+1]; var button=header.firstChild; if (button!='IMG'){ divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); button=document.createElement('img'); divs[i].insertBefore(button,divs[i].firstChild); } header.style.cursor='pointer'; header.onclick=changeDisplayState; header.id='dynheader'+sectionCounter; button.src='closed.gif'; section.id='dynsection'+sectionCounter; section.style.display='none'; section.style.marginLeft='14px'; sectionCounter++; } } } window.onload = initDynSections; --> </script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="classes.html"><span>Data Structure Index</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div> <div class="contents"> <h1>libusb_transfer Struct Reference<br/> <small> [<a class="el" href="group__asyncio.html">Asynchronous device I/O</a>]</small> </h1><!-- doxytag: class="libusb_transfer" --> <p>The generic USB transfer structure. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="libusb_8h_source.html">libusb.h</a>></code></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Data Fields</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adaaf06aeb5ab2a8819e75310ec253f7a"></a><!-- doxytag: member="libusb_transfer::dev_handle" ref="adaaf06aeb5ab2a8819e75310ec253f7a" args="" --> <a class="el" href="group__dev.html#ga7df95821d20d27b5597f1d783749d6a4">libusb_device_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#adaaf06aeb5ab2a8819e75310ec253f7a">dev_handle</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Handle of the device that this transfer will be submitted to. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#ae26c063df30c2e29835212aad98c6e06">flags</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A bitwise OR combination of <a class="el" href="group__asyncio.html#ga1fb47dd0f7c209b60a3609ff0c03d56d">libusb_transfer_flags</a>. <a href="#ae26c063df30c2e29835212aad98c6e06"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a0fcfd057f53b0e1bff6f1567761c231a">endpoint</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Address of the endpoint where this transfer will be sent. <a href="#a0fcfd057f53b0e1bff6f1567761c231a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c9fa575986fe9f23bbecb26b766dff1"></a><!-- doxytag: member="libusb_transfer::type" ref="a7c9fa575986fe9f23bbecb26b766dff1" args="" --> unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a7c9fa575986fe9f23bbecb26b766dff1">type</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Type of the endpoint from <a class="el" href="group__desc.html#gacb52027036a07de6ecc6c2bf07d07c71">libusb_transfer_type</a>. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a9a12af15ca5b482f5dcaebd26a848cbb">timeout</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Timeout for this transfer in millseconds. <a href="#a9a12af15ca5b482f5dcaebd26a848cbb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum <a class="el" href="group__asyncio.html#ga9fcb2aa23d342060ebda1d0cf7478856">libusb_transfer_status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a64b2e70e76d52a7cd23daa3cd4fb397e">status</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The status of the transfer. <a href="#a64b2e70e76d52a7cd23daa3cd4fb397e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68c023e1f40b50aa8604a2495b6a391e"></a><!-- doxytag: member="libusb_transfer::length" ref="a68c023e1f40b50aa8604a2495b6a391e" args="" --> int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a68c023e1f40b50aa8604a2495b6a391e">length</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Length of the data buffer. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a7e858f07c48a271a62209d11376ae607">actual_length</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Actual length of data that was transferred. <a href="#a7e858f07c48a271a62209d11376ae607"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__asyncio.html#ga62afeef38ae1003e14d2e8eb06462f25">libusb_transfer_cb_fn</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a69c6df011ec23ff3e481cc98bfff0623">callback</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Callback function. <a href="#a69c6df011ec23ff3e481cc98bfff0623"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#ab75ab3e7185f08e07a1ae858a35ebb7b">user_data</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">User context data to pass to the callback function. <a href="#ab75ab3e7185f08e07a1ae858a35ebb7b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7fa594567e074191ce8f28b5fb4a3bea"></a><!-- doxytag: member="libusb_transfer::buffer" ref="a7fa594567e074191ce8f28b5fb4a3bea" args="" --> unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a7fa594567e074191ce8f28b5fb4a3bea">buffer</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Data buffer. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a87d725a5521c26832fdc13611220014d">num_iso_packets</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Number of isochronous packets. <a href="#a87d725a5521c26832fdc13611220014d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlibusb__iso__packet__descriptor.html">libusb_iso_packet_descriptor</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__transfer.html#a0de0b13dfae411fc36217d35eb89b138">iso_packet_desc</a> [0]</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Isochronous packet descriptors, for isochronous transfers only. <a href="#a0de0b13dfae411fc36217d35eb89b138"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>The generic USB transfer structure. </p> <p>The user populates this structure and then submits it in order to request a transfer. After the transfer has completed, the library populates the transfer with the results and passes it back to the user. </p> <hr/><h2>Field Documentation</h2> <a class="anchor" id="ae26c063df30c2e29835212aad98c6e06"></a><!-- doxytag: member="libusb_transfer::flags" ref="ae26c063df30c2e29835212aad98c6e06" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint8_t <a class="el" href="structlibusb__transfer.html#ae26c063df30c2e29835212aad98c6e06">libusb_transfer::flags</a></td> </tr> </table> </div> <div class="memdoc"> <p>A bitwise OR combination of <a class="el" href="group__asyncio.html#ga1fb47dd0f7c209b60a3609ff0c03d56d">libusb_transfer_flags</a>. </p> </div> </div> <a class="anchor" id="a0fcfd057f53b0e1bff6f1567761c231a"></a><!-- doxytag: member="libusb_transfer::endpoint" ref="a0fcfd057f53b0e1bff6f1567761c231a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned char <a class="el" href="structlibusb__transfer.html#a0fcfd057f53b0e1bff6f1567761c231a">libusb_transfer::endpoint</a></td> </tr> </table> </div> <div class="memdoc"> <p>Address of the endpoint where this transfer will be sent. </p> </div> </div> <a class="anchor" id="a9a12af15ca5b482f5dcaebd26a848cbb"></a><!-- doxytag: member="libusb_transfer::timeout" ref="a9a12af15ca5b482f5dcaebd26a848cbb" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int <a class="el" href="structlibusb__transfer.html#a9a12af15ca5b482f5dcaebd26a848cbb">libusb_transfer::timeout</a></td> </tr> </table> </div> <div class="memdoc"> <p>Timeout for this transfer in millseconds. </p> <p>A value of 0 indicates no timeout. </p> </div> </div> <a class="anchor" id="a64b2e70e76d52a7cd23daa3cd4fb397e"></a><!-- doxytag: member="libusb_transfer::status" ref="a64b2e70e76d52a7cd23daa3cd4fb397e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__asyncio.html#ga9fcb2aa23d342060ebda1d0cf7478856">libusb_transfer_status</a> <a class="el" href="structlibusb__transfer.html#a64b2e70e76d52a7cd23daa3cd4fb397e">libusb_transfer::status</a></td> </tr> </table> </div> <div class="memdoc"> <p>The status of the transfer. </p> <p>Read-only, and only for use within transfer callback function.</p> <p>If this is an isochronous transfer, this field may read COMPLETED even if there were errors in the frames. Use the <a class="el" href="structlibusb__iso__packet__descriptor.html#aab21ee2a5835a0e53d7ac5844ee34371">status</a> field in each packet to determine if errors occurred. </p> </div> </div> <a class="anchor" id="a7e858f07c48a271a62209d11376ae607"></a><!-- doxytag: member="libusb_transfer::actual_length" ref="a7e858f07c48a271a62209d11376ae607" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structlibusb__transfer.html#a7e858f07c48a271a62209d11376ae607">libusb_transfer::actual_length</a></td> </tr> </table> </div> <div class="memdoc"> <p>Actual length of data that was transferred. </p> <p>Read-only, and only for use within transfer callback function. Not valid for isochronous endpoint transfers. </p> </div> </div> <a class="anchor" id="a69c6df011ec23ff3e481cc98bfff0623"></a><!-- doxytag: member="libusb_transfer::callback" ref="a69c6df011ec23ff3e481cc98bfff0623" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__asyncio.html#ga62afeef38ae1003e14d2e8eb06462f25">libusb_transfer_cb_fn</a> <a class="el" href="structlibusb__transfer.html#a69c6df011ec23ff3e481cc98bfff0623">libusb_transfer::callback</a></td> </tr> </table> </div> <div class="memdoc"> <p>Callback function. </p> <p>This will be invoked when the transfer completes, fails, or is cancelled. </p> </div> </div> <a class="anchor" id="ab75ab3e7185f08e07a1ae858a35ebb7b"></a><!-- doxytag: member="libusb_transfer::user_data" ref="ab75ab3e7185f08e07a1ae858a35ebb7b" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* <a class="el" href="structlibusb__transfer.html#ab75ab3e7185f08e07a1ae858a35ebb7b">libusb_transfer::user_data</a></td> </tr> </table> </div> <div class="memdoc"> <p>User context data to pass to the callback function. </p> </div> </div> <a class="anchor" id="a87d725a5521c26832fdc13611220014d"></a><!-- doxytag: member="libusb_transfer::num_iso_packets" ref="a87d725a5521c26832fdc13611220014d" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structlibusb__transfer.html#a87d725a5521c26832fdc13611220014d">libusb_transfer::num_iso_packets</a></td> </tr> </table> </div> <div class="memdoc"> <p>Number of isochronous packets. </p> <p>Only used for I/O with isochronous endpoints. </p> </div> </div> <a class="anchor" id="a0de0b13dfae411fc36217d35eb89b138"></a><!-- doxytag: member="libusb_transfer::iso_packet_desc" ref="a0de0b13dfae411fc36217d35eb89b138" args="[0]" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structlibusb__iso__packet__descriptor.html">libusb_iso_packet_descriptor</a> <a class="el" href="structlibusb__transfer.html#a0de0b13dfae411fc36217d35eb89b138">libusb_transfer::iso_packet_desc</a>[0]</td> </tr> </table> </div> <div class="memdoc"> <p>Isochronous packet descriptors, for isochronous transfers only. </p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="libusb_8h_source.html">libusb.h</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>