diff options
| author | 2014-03-27 10:07:09 -0400 | |
|---|---|---|
| committer | 2014-03-27 21:40:43 -0400 | |
| commit | 2342dc5b4ef148b993fbe3816f3facdef8365546 (patch) | |
| tree | 69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /include/libimobiledevice/libimobiledevice.h | |
| parent | ee82e861a8c942b5013accd7589cf898d1f97167 (diff) | |
| download | libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2 | |
Moved Doxygen comments from source files to public headers.
Conflicts:
include/libimobiledevice/afc.h
Diffstat (limited to 'include/libimobiledevice/libimobiledevice.h')
| -rw-r--r-- | include/libimobiledevice/libimobiledevice.h | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h index e33715f..3cbb96b 100644 --- a/include/libimobiledevice/libimobiledevice.h +++ b/include/libimobiledevice/libimobiledevice.h | |||
| @@ -75,30 +75,177 @@ typedef struct { | |||
| 75 | 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); |
| 76 | 76 | ||
| 77 | /* functions */ | 77 | /* functions */ |
| 78 | |||
| 79 | /** | ||
| 80 | * Register a callback function that will be called when device add/remove | ||
| 81 | * events occur. | ||
| 82 | * | ||
| 83 | * @param callback Callback function to call. | ||
| 84 | * @param user_data Application-specific data passed as parameter | ||
| 85 | * to the registered callback function. | ||
| 86 | * | ||
| 87 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occured. | ||
| 88 | */ | ||
| 78 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); | 89 | idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data); |
| 90 | |||
| 91 | /** | ||
| 92 | * Release the event callback function that has been registered with | ||
| 93 | * idevice_event_subscribe(). | ||
| 94 | * | ||
| 95 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occured. | ||
| 96 | */ | ||
| 79 | idevice_error_t idevice_event_unsubscribe(); | 97 | idevice_error_t idevice_event_unsubscribe(); |
| 80 | 98 | ||
| 81 | /* discovery (synchronous) */ | 99 | /* discovery (synchronous) */ |
| 100 | |||
| 101 | /** | ||
| 102 | * Get a list of currently available devices. | ||
| 103 | * | ||
| 104 | * @param devices List of udids of devices that are currently available. | ||
| 105 | * This list is terminated by a NULL pointer. | ||
| 106 | * @param count Number of devices found. | ||
| 107 | * | ||
| 108 | * @return IDEVICE_E_SUCCESS on success or an error value when an error occured. | ||
| 109 | */ | ||
| 82 | idevice_error_t idevice_get_device_list(char ***devices, int *count); | 110 | idevice_error_t idevice_get_device_list(char ***devices, int *count); |
| 111 | |||
| 112 | /** | ||
| 113 | * Free a list of device udids. | ||
| 114 | * | ||
| 115 | * @param devices List of udids to free. | ||
| 116 | * | ||
| 117 | * @return Always returnes IDEVICE_E_SUCCESS. | ||
| 118 | */ | ||
| 83 | idevice_error_t idevice_device_list_free(char **devices); | 119 | idevice_error_t idevice_device_list_free(char **devices); |
| 84 | 120 | ||
| 85 | /* device structure creation and destruction */ | 121 | /* device structure creation and destruction */ |
| 122 | |||
| 123 | /** | ||
| 124 | * Creates an idevice_t structure for the device specified by udid, | ||
| 125 | * if the device is available. | ||
| 126 | * | ||
| 127 | * @note The resulting idevice_t structure has to be freed with | ||
| 128 | * idevice_free() if it is no longer used. | ||
| 129 | * | ||
| 130 | * @param device Upon calling this function, a pointer to a location of type | ||
| 131 | * idevice_t. On successful return, this location will be populated. | ||
| 132 | * @param udid The UDID to match. | ||
| 133 | * | ||
| 134 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 135 | */ | ||
| 86 | idevice_error_t idevice_new(idevice_t *device, const char *udid); | 136 | idevice_error_t idevice_new(idevice_t *device, const char *udid); |
| 137 | |||
| 138 | /** | ||
| 139 | * Cleans up an idevice structure, then frees the structure itself. | ||
| 140 | * This is a library-level function; deals directly with the device to tear | ||
| 141 | * down relations, but otherwise is mostly internal. | ||
| 142 | * | ||
| 143 | * @param device idevice_t to free. | ||
| 144 | */ | ||
| 87 | idevice_error_t idevice_free(idevice_t device); | 145 | idevice_error_t idevice_free(idevice_t device); |
| 88 | 146 | ||
| 89 | /* connection/disconnection */ | 147 | /* connection/disconnection */ |
| 148 | |||
| 149 | /** | ||
| 150 | * Set up a connection to the given device. | ||
| 151 | * | ||
| 152 | * @param device The device to connect to. | ||
| 153 | * @param port The destination port to connect to. | ||
| 154 | * @param connection Pointer to an idevice_connection_t that will be filled | ||
| 155 | * with the necessary data of the connection. | ||
| 156 | * | ||
| 157 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 158 | */ | ||
| 90 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection); | 159 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection); |
| 160 | |||
| 161 | /** | ||
| 162 | * Disconnect from the device and clean up the connection structure. | ||
| 163 | * | ||
| 164 | * @param connection The connection to close. | ||
| 165 | * | ||
| 166 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 167 | */ | ||
| 91 | idevice_error_t idevice_disconnect(idevice_connection_t connection); | 168 | idevice_error_t idevice_disconnect(idevice_connection_t connection); |
| 92 | 169 | ||
| 93 | /* communication */ | 170 | /* communication */ |
| 171 | |||
| 172 | /** | ||
| 173 | * Send data to a device via the given connection. | ||
| 174 | * | ||
| 175 | * @param connection The connection to send data over. | ||
| 176 | * @param data Buffer with data to send. | ||
| 177 | * @param len Size of the buffer to send. | ||
| 178 | * @param sent_bytes Pointer to an uint32_t that will be filled | ||
| 179 | * with the number of bytes actually sent. | ||
| 180 | * | ||
| 181 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 182 | */ | ||
| 94 | idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); | 183 | idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); |
| 184 | |||
| 185 | /** | ||
| 186 | * Receive data from a device via the given connection. | ||
| 187 | * This function will return after the given timeout even if no data has been | ||
| 188 | * received. | ||
| 189 | * | ||
| 190 | * @param connection The connection to receive data from. | ||
| 191 | * @param data Buffer that will be filled with the received data. | ||
| 192 | * This buffer has to be large enough to hold len bytes. | ||
| 193 | * @param len Buffer size or number of bytes to receive. | ||
| 194 | * @param recv_bytes Number of bytes actually received. | ||
| 195 | * @param timeout Timeout in milliseconds after which this function should | ||
| 196 | * return even if no data has been received. | ||
| 197 | * | ||
| 198 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 199 | */ | ||
| 95 | idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); | 200 | idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); |
| 201 | |||
| 202 | /** | ||
| 203 | * Receive data from a device via the given connection. | ||
| 204 | * This function is like idevice_connection_receive_timeout, but with a | ||
| 205 | * predefined reasonable timeout. | ||
| 206 | * | ||
| 207 | * @param connection The connection to receive data from. | ||
| 208 | * @param data Buffer that will be filled with the received data. | ||
| 209 | * This buffer has to be large enough to hold len bytes. | ||
| 210 | * @param len Buffer size or number of bytes to receive. | ||
| 211 | * @param recv_bytes Number of bytes actually received. | ||
| 212 | * | ||
| 213 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | ||
| 214 | */ | ||
| 96 | idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes); | 215 | idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes); |
| 216 | |||
| 217 | /** | ||
| 218 | * Enables SSL for the given connection. | ||
| 219 | * | ||
| 220 | * @param connection The connection to enable SSL for. | ||
| 221 | * | ||
| 222 | * @return IDEVICE_E_SUCCESS on success, IDEVICE_E_INVALID_ARG when connection | ||
| 223 | * is NULL or connection->ssl_data is non-NULL, or IDEVICE_E_SSL_ERROR when | ||
| 224 | * SSL initialization, setup, or handshake fails. | ||
| 225 | */ | ||
| 97 | idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection); | 226 | idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection); |
| 227 | |||
| 228 | /** | ||
| 229 | * Disable SSL for the given connection. | ||
| 230 | * | ||
| 231 | * @param connection The connection to disable SSL for. | ||
| 232 | * | ||
| 233 | * @return IDEVICE_E_SUCCESS on success, IDEVICE_E_INVALID_ARG when connection | ||
| 234 | * is NULL. This function also returns IDEVICE_E_SUCCESS when SSL is not | ||
| 235 | * enabled and does no further error checking on cleanup. | ||
| 236 | */ | ||
| 98 | idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection); | 237 | idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection); |
| 99 | 238 | ||
| 100 | /* misc */ | 239 | /* misc */ |
| 240 | |||
| 241 | /** | ||
| 242 | * Gets the handle of the device. Depends on the connection type. | ||
| 243 | */ | ||
| 101 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); | 244 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); |
| 245 | |||
| 246 | /** | ||
| 247 | * Gets the unique id for the device. | ||
| 248 | */ | ||
| 102 | idevice_error_t idevice_get_udid(idevice_t device, char **udid); | 249 | idevice_error_t idevice_get_udid(idevice_t device, char **udid); |
| 103 | 250 | ||
| 104 | #ifdef __cplusplus | 251 | #ifdef __cplusplus |
