<!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>libimobiledevice: libimobiledevice/libimobiledevice.h File 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.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="contents"> <h1>libimobiledevice/libimobiledevice.h File Reference</h1> <p>Device/Connection handling and communication. <a href="#_details">More...</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Data Structures</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structidevice__event__t.html">idevice_event_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides information about the occured event. <a href="structidevice__event__t.html#_details">More...</a><br/></td></tr> <tr><td colspan="2"><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef int16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Represents an error code. <a href="#ad65987d858c9c01954fa887710c7820a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structidevice__private.html">idevice_private</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#ae5bc0e9aa2f3b5023755f5e1c5039a60">idevice_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The device handle. <a href="#ae5bc0e9aa2f3b5023755f5e1c5039a60"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> <a class="el" href="structidevice__connection__private.html">idevice_connection_private</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a01e577b2574f08fb2f252607e274ba1b">idevice_connection_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The connection handle. <a href="#a01e577b2574f08fb2f252607e274ba1b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#aad94d91260a90c2bfad72f1ce8ad1dfd">idevice_event_cb_t</a> )(const <a class="el" href="structidevice__event__t.html">idevice_event_t</a> *event, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Callback to notifiy if a device was added or removed. <a href="#aad94d91260a90c2bfad72f1ce8ad1dfd"></a><br/></td></tr> <tr><td colspan="2"><h2>Enumerations</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#af71b326f7e0b62d61be32f02c620d8d9">idevice_event_type</a> { <br/> <b>IDEVICE_DEVICE_ADD</b> = 1, <br/> <b>IDEVICE_DEVICE_REMOVE</b> <br/> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><p>The event type for device add or removal. </p> <br/></td></tr> <tr><td colspan="2"><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#aa7ff5b795b752bd2086f433317ccc32a">idevice_set_debug_level</a> (int level)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the level of debugging. <a href="#aa7ff5b795b752bd2086f433317ccc32a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#ae3be327d9198b7a7071b709866cfd670">idevice_event_subscribe</a> (<a class="el" href="libimobiledevice_8h.html#aad94d91260a90c2bfad72f1ce8ad1dfd">idevice_event_cb_t</a> callback, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Register a callback function that will be called when device add/remove events occur. <a href="#ae3be327d9198b7a7071b709866cfd670"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a9134eaf37c2a9c9a2cd9cba4eadeaae9">idevice_event_unsubscribe</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Release the event callback function that has been registered with <a class="el" href="libimobiledevice_8h.html#ae3be327d9198b7a7071b709866cfd670" title="Register a callback function that will be called when device add/remove events occur...">idevice_event_subscribe()</a>. <a href="#a9134eaf37c2a9c9a2cd9cba4eadeaae9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#af4d17b7a056088f366967f2f13f0700b">idevice_get_device_list</a> (char ***devices, int *count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get a list of currently available devices. <a href="#af4d17b7a056088f366967f2f13f0700b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a22f6dd94a426ef0bb01e2a48a0dc76e2">idevice_device_list_free</a> (char **devices)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Free a list of device uuids. <a href="#a22f6dd94a426ef0bb01e2a48a0dc76e2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#aeb5d5abd03acd9bad2d8964526a73252">idevice_new</a> (<a class="el" href="structidevice__private.html">idevice_t</a> *device, const char *uuid)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an idevice_t structure for the device specified by uuid, if the device is available. <a href="#aeb5d5abd03acd9bad2d8964526a73252"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a98caab570c77156838829f760560f81a">idevice_free</a> (<a class="el" href="structidevice__private.html">idevice_t</a> device)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Cleans up an idevice structure, then frees the structure itself. <a href="#a98caab570c77156838829f760560f81a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a487774a7f9ae8f617cbe7f8eef68596b">idevice_connect</a> (<a class="el" href="structidevice__private.html">idevice_t</a> device, uint16_t port, <a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> *connection)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set up a connection to the given device. <a href="#a487774a7f9ae8f617cbe7f8eef68596b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a3744a4f4c4655ae9c12c373dc58ac144">idevice_disconnect</a> (<a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> connection)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Disconnect from the device and clean up the connection structure. <a href="#a3744a4f4c4655ae9c12c373dc58ac144"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a2bf12d601c1f1744e479a3fd379f5b0c">idevice_connection_send</a> (<a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> connection, const char *data, uint32_t len, uint32_t *sent_bytes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Send data to a device via the given connection. <a href="#a2bf12d601c1f1744e479a3fd379f5b0c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a8e243f912679771b7b12ff93758c9d4b">idevice_connection_receive_timeout</a> (<a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Receive data from a device via the given connection. <a href="#a8e243f912679771b7b12ff93758c9d4b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a0f40ec458db4f77449f67e41bd14170d">idevice_connection_receive</a> (<a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> connection, char *data, uint32_t len, uint32_t *recv_bytes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Receive data from a device via the given connection. <a href="#a0f40ec458db4f77449f67e41bd14170d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a15a523978dd85aece5c28efa961a63fe">idevice_get_handle</a> (<a class="el" href="structidevice__private.html">idevice_t</a> device, uint32_t *handle)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the handle of the device. <a href="#a15a523978dd85aece5c28efa961a63fe"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ce36b4c98e035c30ff4c2d959c899e0"></a><!-- doxytag: member="libimobiledevice.h::idevice_get_uuid" ref="a9ce36b4c98e035c30ff4c2d959c899e0" args="(idevice_t device, char **uuid)" --> <a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="libimobiledevice_8h.html#a9ce36b4c98e035c30ff4c2d959c899e0">idevice_get_uuid</a> (<a class="el" href="structidevice__private.html">idevice_t</a> device, char **uuid)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the unique id for the device. <br/></td></tr> <tr><td colspan="2"><h2>Error Codes</h2></td></tr> <tr><td colspan="2"><p><a class="anchor" id="amgrp5c244138ac975df1b1cec1afc71a6c9a"></a> </p> <br/><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab47a2c5f17030dec55cd354c38a64384"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_SUCCESS" ref="ab47a2c5f17030dec55cd354c38a64384" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_SUCCESS</b> 0</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1afaea0a32011789d2e92f8708fe2643"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_INVALID_ARG" ref="a1afaea0a32011789d2e92f8708fe2643" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_INVALID_ARG</b> -1</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ff90408a018d825aafc407d0b97a9e9"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_UNKNOWN_ERROR" ref="a8ff90408a018d825aafc407d0b97a9e9" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_UNKNOWN_ERROR</b> -2</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed37c7aafcae7c6ef07551b772f4c828"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_NO_DEVICE" ref="aed37c7aafcae7c6ef07551b772f4c828" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_NO_DEVICE</b> -3</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa929001d32c5a7b34019ab200ff8c649"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_NOT_ENOUGH_DATA" ref="aa929001d32c5a7b34019ab200ff8c649" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_NOT_ENOUGH_DATA</b> -4</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0eac7200812801c39e45b3e1e2d24f9b"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_BAD_HEADER" ref="a0eac7200812801c39e45b3e1e2d24f9b" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_BAD_HEADER</b> -5</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae8b3210daafbf1555925d6029701b8b2"></a><!-- doxytag: member="libimobiledevice.h::IDEVICE_E_SSL_ERROR" ref="ae8b3210daafbf1555925d6029701b8b2" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>IDEVICE_E_SSL_ERROR</b> -6</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Device/Connection handling and communication. </p> <hr/><h2>Typedef Documentation</h2> <a class="anchor" id="a01e577b2574f08fb2f252607e274ba1b"></a><!-- doxytag: member="libimobiledevice.h::idevice_connection_t" ref="a01e577b2574f08fb2f252607e274ba1b" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="structidevice__connection__private.html">idevice_connection_private</a>* <a class="el" href="structidevice__connection__private.html">idevice_connection_t</a></td> </tr> </table> </div> <div class="memdoc"> <p>The connection handle. </p> </div> </div> <a class="anchor" id="ad65987d858c9c01954fa887710c7820a"></a><!-- doxytag: member="libimobiledevice.h::idevice_error_t" ref="ad65987d858c9c01954fa887710c7820a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int16_t <a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a></td> </tr> </table> </div> <div class="memdoc"> <p>Represents an error code. </p> </div> </div> <a class="anchor" id="aad94d91260a90c2bfad72f1ce8ad1dfd"></a><!-- doxytag: member="libimobiledevice.h::idevice_event_cb_t" ref="aad94d91260a90c2bfad72f1ce8ad1dfd" args=")(const idevice_event_t *event, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef void(* <a class="el" href="libimobiledevice_8h.html#aad94d91260a90c2bfad72f1ce8ad1dfd">idevice_event_cb_t</a>)(const <a class="el" href="structidevice__event__t.html">idevice_event_t</a> *event, void *user_data)</td> </tr> </table> </div> <div class="memdoc"> <p>Callback to notifiy if a device was added or removed. </p> </div> </div> <a class="anchor" id="ae5bc0e9aa2f3b5023755f5e1c5039a60"></a><!-- doxytag: member="libimobiledevice.h::idevice_t" ref="ae5bc0e9aa2f3b5023755f5e1c5039a60" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="structidevice__private.html">idevice_private</a>* <a class="el" href="structidevice__private.html">idevice_t</a></td> </tr> </table> </div> <div class="memdoc"> <p>The device handle. </p> </div> </div> <hr/><h2>Function Documentation</h2> <a class="anchor" id="a487774a7f9ae8f617cbe7f8eef68596b"></a><!-- doxytag: member="libimobiledevice.h::idevice_connect" ref="a487774a7f9ae8f617cbe7f8eef68596b" args="(idevice_t device, uint16_t port, idevice_connection_t *connection)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_connect </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__private.html">idevice_t</a> </td> <td class="paramname"> <em>device</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>port</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> * </td> <td class="paramname"> <em>connection</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Set up a connection to the given device. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>device</em> </td><td>The device to connect to. </td></tr> <tr><td valign="top"></td><td valign="top"><em>port</em> </td><td>The destination port to connect to. </td></tr> <tr><td valign="top"></td><td valign="top"><em>connection</em> </td><td>Pointer to an idevice_connection_t that will be filled with the necessary data of the connection.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="a0f40ec458db4f77449f67e41bd14170d"></a><!-- doxytag: member="libimobiledevice.h::idevice_connection_receive" ref="a0f40ec458db4f77449f67e41bd14170d" args="(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_connection_receive </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> </td> <td class="paramname"> <em>connection</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"> <em>len</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t * </td> <td class="paramname"> <em>recv_bytes</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Receive data from a device via the given connection. </p> <p>This function is like idevice_connection_receive_timeout, but with a predefined reasonable timeout.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>connection</em> </td><td>The connection to receive data from. </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Buffer that will be filled with the received data. This buffer has to be large enough to hold len bytes. </td></tr> <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Buffer size or number of bytes to receive. </td></tr> <tr><td valign="top"></td><td valign="top"><em>recv_bytes</em> </td><td>Number of bytes actually received.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="a8e243f912679771b7b12ff93758c9d4b"></a><!-- doxytag: member="libimobiledevice.h::idevice_connection_receive_timeout" ref="a8e243f912679771b7b12ff93758c9d4b" args="(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_connection_receive_timeout </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> </td> <td class="paramname"> <em>connection</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"> <em>len</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t * </td> <td class="paramname"> <em>recv_bytes</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>timeout</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Receive data from a device via the given connection. </p> <p>This function will return after the given timeout even if no data has been received.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>connection</em> </td><td>The connection to receive data from. </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Buffer that will be filled with the received data. This buffer has to be large enough to hold len bytes. </td></tr> <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Buffer size or number of bytes to receive. </td></tr> <tr><td valign="top"></td><td valign="top"><em>recv_bytes</em> </td><td>Number of bytes actually received. </td></tr> <tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>Timeout in milliseconds after which this function should return even if no data has been received.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="a2bf12d601c1f1744e479a3fd379f5b0c"></a><!-- doxytag: member="libimobiledevice.h::idevice_connection_send" ref="a2bf12d601c1f1744e479a3fd379f5b0c" args="(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_connection_send </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> </td> <td class="paramname"> <em>connection</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"> <em>len</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t * </td> <td class="paramname"> <em>sent_bytes</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Send data to a device via the given connection. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>connection</em> </td><td>The connection to send data over. </td></tr> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Buffer with data to send. </td></tr> <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Size of the buffer to send. </td></tr> <tr><td valign="top"></td><td valign="top"><em>sent_bytes</em> </td><td>Pointer to an uint32_t that will be filled with the number of bytes actually sent.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="a22f6dd94a426ef0bb01e2a48a0dc76e2"></a><!-- doxytag: member="libimobiledevice.h::idevice_device_list_free" ref="a22f6dd94a426ef0bb01e2a48a0dc76e2" args="(char **devices)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_device_list_free </td> <td>(</td> <td class="paramtype">char ** </td> <td class="paramname"> <em>devices</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Free a list of device uuids. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>devices</em> </td><td>List of uuids to free.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Always returnes IDEVICE_E_SUCCESS. </dd></dl> </div> </div> <a class="anchor" id="a3744a4f4c4655ae9c12c373dc58ac144"></a><!-- doxytag: member="libimobiledevice.h::idevice_disconnect" ref="a3744a4f4c4655ae9c12c373dc58ac144" args="(idevice_connection_t connection)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_disconnect </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__connection__private.html">idevice_connection_t</a> </td> <td class="paramname"> <em>connection</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Disconnect from the device and clean up the connection structure. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>connection</em> </td><td>The connection to close.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="ae3be327d9198b7a7071b709866cfd670"></a><!-- doxytag: member="libimobiledevice.h::idevice_event_subscribe" ref="ae3be327d9198b7a7071b709866cfd670" args="(idevice_event_cb_t callback, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_event_subscribe </td> <td>(</td> <td class="paramtype"><a class="el" href="libimobiledevice_8h.html#aad94d91260a90c2bfad72f1ce8ad1dfd">idevice_event_cb_t</a> </td> <td class="paramname"> <em>callback</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>user_data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Register a callback function that will be called when device add/remove events occur. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>Callback function to call. </td></tr> <tr><td valign="top"></td><td valign="top"><em>user_data</em> </td><td>Application-specific data passed as parameter to the registered callback function.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS on success or an error value when an error occured. </dd></dl> </div> </div> <a class="anchor" id="a9134eaf37c2a9c9a2cd9cba4eadeaae9"></a><!-- doxytag: member="libimobiledevice.h::idevice_event_unsubscribe" ref="a9134eaf37c2a9c9a2cd9cba4eadeaae9" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_event_unsubscribe </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Release the event callback function that has been registered with <a class="el" href="libimobiledevice_8h.html#ae3be327d9198b7a7071b709866cfd670" title="Register a callback function that will be called when device add/remove events occur...">idevice_event_subscribe()</a>. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS on success or an error value when an error occured. </dd></dl> </div> </div> <a class="anchor" id="a98caab570c77156838829f760560f81a"></a><!-- doxytag: member="libimobiledevice.h::idevice_free" ref="a98caab570c77156838829f760560f81a" args="(idevice_t device)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_free </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__private.html">idevice_t</a> </td> <td class="paramname"> <em>device</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Cleans up an idevice structure, then frees the structure itself. </p> <p>This is a library-level function; deals directly with the device to tear down relations, but otherwise is mostly internal.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>device</em> </td><td>idevice_t to free. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="af4d17b7a056088f366967f2f13f0700b"></a><!-- doxytag: member="libimobiledevice.h::idevice_get_device_list" ref="af4d17b7a056088f366967f2f13f0700b" args="(char ***devices, int *count)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_get_device_list </td> <td>(</td> <td class="paramtype">char *** </td> <td class="paramname"> <em>devices</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int * </td> <td class="paramname"> <em>count</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Get a list of currently available devices. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>devices</em> </td><td>List of uuids of devices that are currently available. This list is terminated by a NULL pointer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>count</em> </td><td>Number of devices found.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS on success or an error value when an error occured. </dd></dl> </div> </div> <a class="anchor" id="a15a523978dd85aece5c28efa961a63fe"></a><!-- doxytag: member="libimobiledevice.h::idevice_get_handle" ref="a15a523978dd85aece5c28efa961a63fe" args="(idevice_t device, uint32_t *handle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_get_handle </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__private.html">idevice_t</a> </td> <td class="paramname"> <em>device</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t * </td> <td class="paramname"> <em>handle</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Gets the handle of the device. </p> <p>Depends on the connection type. </p> </div> </div> <a class="anchor" id="aeb5d5abd03acd9bad2d8964526a73252"></a><!-- doxytag: member="libimobiledevice.h::idevice_new" ref="aeb5d5abd03acd9bad2d8964526a73252" args="(idevice_t *device, const char *uuid)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="libimobiledevice_8h.html#ad65987d858c9c01954fa887710c7820a">idevice_error_t</a> idevice_new </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__private.html">idevice_t</a> * </td> <td class="paramname"> <em>device</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>uuid</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an idevice_t structure for the device specified by uuid, if the device is available. </p> <dl class="note"><dt><b>Note:</b></dt><dd>The resulting idevice_t structure has to be freed with <a class="el" href="libimobiledevice_8h.html#a98caab570c77156838829f760560f81a" title="Cleans up an idevice structure, then frees the structure itself.">idevice_free()</a> if it is no longer used.</dd></dl> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>device</em> </td><td>Upon calling this function, a pointer to a location of type idevice_t. On successful return, this location will be populated. </td></tr> <tr><td valign="top"></td><td valign="top"><em>uuid</em> </td><td>The UUID to match.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>IDEVICE_E_SUCCESS if ok, otherwise an error code. </dd></dl> </div> </div> <a class="anchor" id="aa7ff5b795b752bd2086f433317ccc32a"></a><!-- doxytag: member="libimobiledevice.h::idevice_set_debug_level" ref="aa7ff5b795b752bd2086f433317ccc32a" args="(int level)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void idevice_set_debug_level </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>level</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the level of debugging. </p> <p>Currently the only acceptable values are 0 and 1.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Set to 0 for no debugging or 1 for debugging. </td></tr> </table> </dd> </dl> </div> </div> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Nov 27 19:58:07 2010 for libimobiledevice by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>