summaryrefslogtreecommitdiffstats
path: root/src/idevice.c
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2014-03-27 10:07:09 -0400
committerGravatar Aaron Burghardt2014-03-27 21:40:43 -0400
commit2342dc5b4ef148b993fbe3816f3facdef8365546 (patch)
tree69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /src/idevice.c
parentee82e861a8c942b5013accd7589cf898d1f97167 (diff)
downloadlibimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz
libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2
Moved Doxygen comments from source files to public headers.
Conflicts: include/libimobiledevice/afc.h
Diffstat (limited to 'src/idevice.c')
-rw-r--r--src/idevice.c132
1 files changed, 0 insertions, 132 deletions
diff --git a/src/idevice.c b/src/idevice.c
index 0577815..eed02fc 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -142,16 +142,6 @@ static void usbmux_event_cb(const usbmuxd_event_t *event, void *user_data)
142 } 142 }
143} 143}
144 144
145/**
146 * Register a callback function that will be called when device add/remove
147 * events occur.
148 *
149 * @param callback Callback function to call.
150 * @param user_data Application-specific data passed as parameter
151 * to the registered callback function.
152 *
153 * @return IDEVICE_E_SUCCESS on success or an error value when an error occured.
154 */
155idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data) 145idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data)
156{ 146{
157 event_cb = callback; 147 event_cb = callback;
@@ -164,12 +154,6 @@ idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_
164 return IDEVICE_E_SUCCESS; 154 return IDEVICE_E_SUCCESS;
165} 155}
166 156
167/**
168 * Release the event callback function that has been registered with
169 * idevice_event_subscribe().
170 *
171 * @return IDEVICE_E_SUCCESS on success or an error value when an error occured.
172 */
173idevice_error_t idevice_event_unsubscribe() 157idevice_error_t idevice_event_unsubscribe()
174{ 158{
175 event_cb = NULL; 159 event_cb = NULL;
@@ -181,15 +165,6 @@ idevice_error_t idevice_event_unsubscribe()
181 return IDEVICE_E_SUCCESS; 165 return IDEVICE_E_SUCCESS;
182} 166}
183 167
184/**
185 * Get a list of currently available devices.
186 *
187 * @param devices List of udids of devices that are currently available.
188 * This list is terminated by a NULL pointer.
189 * @param count Number of devices found.
190 *
191 * @return IDEVICE_E_SUCCESS on success or an error value when an error occured.
192 */
193idevice_error_t idevice_get_device_list(char ***devices, int *count) 168idevice_error_t idevice_get_device_list(char ***devices, int *count)
194{ 169{
195 usbmuxd_device_info_t *dev_list; 170 usbmuxd_device_info_t *dev_list;
@@ -220,13 +195,6 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count)
220 return IDEVICE_E_SUCCESS; 195 return IDEVICE_E_SUCCESS;
221} 196}
222 197
223/**
224 * Free a list of device udids.
225 *
226 * @param devices List of udids to free.
227 *
228 * @return Always returnes IDEVICE_E_SUCCESS.
229 */
230idevice_error_t idevice_device_list_free(char **devices) 198idevice_error_t idevice_device_list_free(char **devices)
231{ 199{
232 if (devices) { 200 if (devices) {
@@ -240,19 +208,6 @@ idevice_error_t idevice_device_list_free(char **devices)
240 return IDEVICE_E_SUCCESS; 208 return IDEVICE_E_SUCCESS;
241} 209}
242 210
243/**
244 * Creates an idevice_t structure for the device specified by udid,
245 * if the device is available.
246 *
247 * @note The resulting idevice_t structure has to be freed with
248 * idevice_free() if it is no longer used.
249 *
250 * @param device Upon calling this function, a pointer to a location of type
251 * idevice_t. On successful return, this location will be populated.
252 * @param udid The UDID to match.
253 *
254 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
255 */
256idevice_error_t idevice_new(idevice_t * device, const char *udid) 211idevice_error_t idevice_new(idevice_t * device, const char *udid)
257{ 212{
258 usbmuxd_device_info_t muxdev; 213 usbmuxd_device_info_t muxdev;
@@ -270,13 +225,6 @@ idevice_error_t idevice_new(idevice_t * device, const char *udid)
270 return IDEVICE_E_NO_DEVICE; 225 return IDEVICE_E_NO_DEVICE;
271} 226}
272 227
273/**
274 * Cleans up an idevice structure, then frees the structure itself.
275 * This is a library-level function; deals directly with the device to tear
276 * down relations, but otherwise is mostly internal.
277 *
278 * @param device idevice_t to free.
279 */
280idevice_error_t idevice_free(idevice_t device) 228idevice_error_t idevice_free(idevice_t device)
281{ 229{
282 if (!device) 230 if (!device)
@@ -297,16 +245,6 @@ idevice_error_t idevice_free(idevice_t device)
297 return ret; 245 return ret;
298} 246}
299 247
300/**
301 * Set up a connection to the given device.
302 *
303 * @param device The device to connect to.
304 * @param port The destination port to connect to.
305 * @param connection Pointer to an idevice_connection_t that will be filled
306 * with the necessary data of the connection.
307 *
308 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
309 */
310idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) 248idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection)
311{ 249{
312 if (!device) { 250 if (!device) {
@@ -333,13 +271,6 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect
333 return IDEVICE_E_UNKNOWN_ERROR; 271 return IDEVICE_E_UNKNOWN_ERROR;
334} 272}
335 273
336/**
337 * Disconnect from the device and clean up the connection structure.
338 *
339 * @param connection The connection to close.
340 *
341 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
342 */
343idevice_error_t idevice_disconnect(idevice_connection_t connection) 274idevice_error_t idevice_disconnect(idevice_connection_t connection)
344{ 275{
345 if (!connection) { 276 if (!connection) {
@@ -390,17 +321,6 @@ static idevice_error_t internal_connection_send(idevice_connection_t connection,
390 321
391} 322}
392 323
393/**
394 * Send data to a device via the given connection.
395 *
396 * @param connection The connection to send data over.
397 * @param data Buffer with data to send.
398 * @param len Size of the buffer to send.
399 * @param sent_bytes Pointer to an uint32_t that will be filled
400 * with the number of bytes actually sent.
401 *
402 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
403 */
404idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes) 324idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes)
405{ 325{
406 if (!connection || !data || (connection->ssl_data && !connection->ssl_data->session)) { 326 if (!connection || !data || (connection->ssl_data && !connection->ssl_data->session)) {
@@ -447,21 +367,6 @@ static idevice_error_t internal_connection_receive_timeout(idevice_connection_t
447 return IDEVICE_E_UNKNOWN_ERROR; 367 return IDEVICE_E_UNKNOWN_ERROR;
448} 368}
449 369
450/**
451 * Receive data from a device via the given connection.
452 * This function will return after the given timeout even if no data has been
453 * received.
454 *
455 * @param connection The connection to receive data from.
456 * @param data Buffer that will be filled with the received data.
457 * This buffer has to be large enough to hold len bytes.
458 * @param len Buffer size or number of bytes to receive.
459 * @param recv_bytes Number of bytes actually received.
460 * @param timeout Timeout in milliseconds after which this function should
461 * return even if no data has been received.
462 *
463 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
464 */
465idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout) 370idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout)
466{ 371{
467 if (!connection || (connection->ssl_data && !connection->ssl_data->session)) { 372 if (!connection || (connection->ssl_data && !connection->ssl_data->session)) {
@@ -516,19 +421,6 @@ static idevice_error_t internal_connection_receive(idevice_connection_t connecti
516 return IDEVICE_E_UNKNOWN_ERROR; 421 return IDEVICE_E_UNKNOWN_ERROR;
517} 422}
518 423
519/**
520 * Receive data from a device via the given connection.
521 * This function is like idevice_connection_receive_timeout, but with a
522 * predefined reasonable timeout.
523 *
524 * @param connection The connection to receive data from.
525 * @param data Buffer that will be filled with the received data.
526 * This buffer has to be large enough to hold len bytes.
527 * @param len Buffer size or number of bytes to receive.
528 * @param recv_bytes Number of bytes actually received.
529 *
530 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
531 */
532idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes) 424idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes)
533{ 425{
534 if (!connection || (connection->ssl_data && !connection->ssl_data->session)) { 426 if (!connection || (connection->ssl_data && !connection->ssl_data->session)) {
@@ -552,9 +444,6 @@ idevice_error_t idevice_connection_receive(idevice_connection_t connection, char
552 return internal_connection_receive(connection, data, len, recv_bytes); 444 return internal_connection_receive(connection, data, len, recv_bytes);
553} 445}
554 446
555/**
556 * Gets the handle of the device. Depends on the connection type.
557 */
558idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) 447idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
559{ 448{
560 if (!device) 449 if (!device)
@@ -569,9 +458,6 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
569 return IDEVICE_E_UNKNOWN_ERROR; 458 return IDEVICE_E_UNKNOWN_ERROR;
570} 459}
571 460
572/**
573 * Gets the unique id for the device.
574 */
575idevice_error_t idevice_get_udid(idevice_t device, char **udid) 461idevice_error_t idevice_get_udid(idevice_t device, char **udid)
576{ 462{
577 if (!device || !udid) 463 if (!device || !udid)
@@ -741,15 +627,6 @@ static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t
741} 627}
742#endif 628#endif
743 629
744/**
745 * Enables SSL for the given connection.
746 *
747 * @param connection The connection to enable SSL for.
748 *
749 * @return IDEVICE_E_SUCCESS on success, IDEVICE_E_INVALID_ARG when connection
750 * is NULL or connection->ssl_data is non-NULL, or IDEVICE_E_SSL_ERROR when
751 * SSL initialization, setup, or handshake fails.
752 */
753idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) 630idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
754{ 631{
755 if (!connection || connection->ssl_data) 632 if (!connection || connection->ssl_data)
@@ -888,15 +765,6 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
888 return ret; 765 return ret;
889} 766}
890 767
891/**
892 * Disable SSL for the given connection.
893 *
894 * @param connection The connection to disable SSL for.
895 *
896 * @return IDEVICE_E_SUCCESS on success, IDEVICE_E_INVALID_ARG when connection
897 * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not
898 * enabled and does no further error checking on cleanup.
899 */
900idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection) 768idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection)
901{ 769{
902 if (!connection) 770 if (!connection)