diff options
Diffstat (limited to 'include/libimobiledevice/libimobiledevice.h')
| -rw-r--r-- | include/libimobiledevice/libimobiledevice.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h index 73e82fe..0c6a08f 100644 --- a/include/libimobiledevice/libimobiledevice.h +++ b/include/libimobiledevice/libimobiledevice.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * @file libimobiledevice/libimobiledevice.h | 2 | * @file libimobiledevice/libimobiledevice.h |
| 3 | * @brief Common code and device handling | 3 | * @brief Device/Connection handling and communication |
| 4 | * \internal | 4 | * \internal |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. | 6 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. |
| @@ -32,7 +32,8 @@ extern "C" { | |||
| 32 | #include <sys/stat.h> | 32 | #include <sys/stat.h> |
| 33 | #include <plist/plist.h> | 33 | #include <plist/plist.h> |
| 34 | 34 | ||
| 35 | /* Error Codes */ | 35 | /** @name Error Codes */ |
| 36 | /*@{*/ | ||
| 36 | #define IDEVICE_E_SUCCESS 0 | 37 | #define IDEVICE_E_SUCCESS 0 |
| 37 | #define IDEVICE_E_INVALID_ARG -1 | 38 | #define IDEVICE_E_INVALID_ARG -1 |
| 38 | #define IDEVICE_E_UNKNOWN_ERROR -2 | 39 | #define IDEVICE_E_UNKNOWN_ERROR -2 |
| @@ -40,7 +41,9 @@ extern "C" { | |||
| 40 | #define IDEVICE_E_NOT_ENOUGH_DATA -4 | 41 | #define IDEVICE_E_NOT_ENOUGH_DATA -4 |
| 41 | #define IDEVICE_E_BAD_HEADER -5 | 42 | #define IDEVICE_E_BAD_HEADER -5 |
| 42 | #define IDEVICE_E_SSL_ERROR -6 | 43 | #define IDEVICE_E_SSL_ERROR -6 |
| 44 | /*@}*/ | ||
| 43 | 45 | ||
| 46 | /** Represents an error code. */ | ||
| 44 | typedef int16_t idevice_error_t; | 47 | typedef int16_t idevice_error_t; |
| 45 | 48 | ||
| 46 | typedef struct idevice_private idevice_private; | 49 | typedef struct idevice_private idevice_private; |
| @@ -53,23 +56,25 @@ typedef idevice_connection_private *idevice_connection_t; /**< The connection ha | |||
| 53 | void idevice_set_debug_level(int level); | 56 | void idevice_set_debug_level(int level); |
| 54 | 57 | ||
| 55 | /* discovery (events/asynchronous) */ | 58 | /* discovery (events/asynchronous) */ |
| 56 | // event type | 59 | /** The event type for device add or removal */ |
| 57 | enum idevice_event_type { | 60 | enum idevice_event_type { |
| 58 | IDEVICE_DEVICE_ADD = 1, | 61 | IDEVICE_DEVICE_ADD = 1, |
| 59 | IDEVICE_DEVICE_REMOVE | 62 | IDEVICE_DEVICE_REMOVE |
| 60 | }; | 63 | }; |
| 61 | 64 | ||
| 62 | // event data structure | 65 | /* event data structure */ |
| 66 | /** Provides information about the occoured event. */ | ||
| 63 | typedef struct { | 67 | typedef struct { |
| 64 | enum idevice_event_type event; | 68 | enum idevice_event_type event; /**< The event type. */ |
| 65 | const char *uuid; | 69 | const char *uuid; /**< The device unique id. */ |
| 66 | int conn_type; | 70 | int conn_type; /**< The connection type. Currently only 1 for usbmuxd. */ |
| 67 | } idevice_event_t; | 71 | } idevice_event_t; |
| 68 | 72 | ||
| 69 | // event callback function prototype | 73 | /* event callback function prototype */ |
| 74 | /** Callback to notifiy if a device was added or removed. */ | ||
| 70 | typedef void (*idevice_event_cb_t) (const idevice_event_t *event, void *user_data); | 75 | typedef void (*idevice_event_cb_t) (const idevice_event_t *event, void *user_data); |
| 71 | 76 | ||
| 72 | // functions | 77 | /* functions */ |
| 73 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); | 78 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); |
| 74 | idevice_error_t idevice_event_unsubscribe(); | 79 | idevice_error_t idevice_event_unsubscribe(); |
| 75 | 80 | ||
