summaryrefslogtreecommitdiffstats
path: root/src/idevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idevice.c')
-rw-r--r--src/idevice.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/idevice.c b/src/idevice.c
index d2769de..a6091f2 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -49,7 +49,7 @@ static void usbmux_event_cb(const usbmuxd_event_t *event, void *user_data)
49 idevice_event_t ev; 49 idevice_event_t ev;
50 50
51 ev.event = event->event; 51 ev.event = event->event;
52 ev.uuid = event->device.uuid; 52 ev.udid = event->device.uuid;
53 ev.conn_type = CONNECTION_USBMUXD; 53 ev.conn_type = CONNECTION_USBMUXD;
54 54
55 if (event_cb) { 55 if (event_cb) {
@@ -99,7 +99,7 @@ idevice_error_t idevice_event_unsubscribe()
99/** 99/**
100 * Get a list of currently available devices. 100 * Get a list of currently available devices.
101 * 101 *
102 * @param devices List of uuids of devices that are currently available. 102 * @param devices List of udids of devices that are currently available.
103 * This list is terminated by a NULL pointer. 103 * This list is terminated by a NULL pointer.
104 * @param count Number of devices found. 104 * @param count Number of devices found.
105 * 105 *
@@ -136,9 +136,9 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count)
136} 136}
137 137
138/** 138/**
139 * Free a list of device uuids. 139 * Free a list of device udids.
140 * 140 *
141 * @param devices List of uuids to free. 141 * @param devices List of udids to free.
142 * 142 *
143 * @return Always returnes IDEVICE_E_SUCCESS. 143 * @return Always returnes IDEVICE_E_SUCCESS.
144 */ 144 */
@@ -156,7 +156,7 @@ idevice_error_t idevice_device_list_free(char **devices)
156} 156}
157 157
158/** 158/**
159 * Creates an idevice_t structure for the device specified by uuid, 159 * Creates an idevice_t structure for the device specified by udid,
160 * if the device is available. 160 * if the device is available.
161 * 161 *
162 * @note The resulting idevice_t structure has to be freed with 162 * @note The resulting idevice_t structure has to be freed with
@@ -164,17 +164,17 @@ idevice_error_t idevice_device_list_free(char **devices)
164 * 164 *
165 * @param device Upon calling this function, a pointer to a location of type 165 * @param device Upon calling this function, a pointer to a location of type
166 * idevice_t. On successful return, this location will be populated. 166 * idevice_t. On successful return, this location will be populated.
167 * @param uuid The UUID to match. 167 * @param udid The UDID to match.
168 * 168 *
169 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. 169 * @return IDEVICE_E_SUCCESS if ok, otherwise an error code.
170 */ 170 */
171idevice_error_t idevice_new(idevice_t * device, const char *uuid) 171idevice_error_t idevice_new(idevice_t * device, const char *udid)
172{ 172{
173 usbmuxd_device_info_t muxdev; 173 usbmuxd_device_info_t muxdev;
174 int res = usbmuxd_get_device_by_uuid(uuid, &muxdev); 174 int res = usbmuxd_get_device_by_uuid(udid, &muxdev);
175 if (res > 0) { 175 if (res > 0) {
176 idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private)); 176 idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private));
177 phone->uuid = strdup(muxdev.uuid); 177 phone->udid = strdup(muxdev.uuid);
178 phone->conn_type = CONNECTION_USBMUXD; 178 phone->conn_type = CONNECTION_USBMUXD;
179 phone->conn_data = (void*)(long)muxdev.handle; 179 phone->conn_data = (void*)(long)muxdev.handle;
180 *device = phone; 180 *device = phone;
@@ -200,7 +200,7 @@ idevice_error_t idevice_free(idevice_t device)
200 200
201 ret = IDEVICE_E_SUCCESS; 201 ret = IDEVICE_E_SUCCESS;
202 202
203 free(device->uuid); 203 free(device->udid);
204 204
205 if (device->conn_type == CONNECTION_USBMUXD) { 205 if (device->conn_type == CONNECTION_USBMUXD) {
206 device->conn_data = 0; 206 device->conn_data = 0;
@@ -471,12 +471,12 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
471/** 471/**
472 * Gets the unique id for the device. 472 * Gets the unique id for the device.
473 */ 473 */
474idevice_error_t idevice_get_uuid(idevice_t device, char **uuid) 474idevice_error_t idevice_get_udid(idevice_t device, char **udid)
475{ 475{
476 if (!device || !uuid) 476 if (!device || !udid)
477 return IDEVICE_E_INVALID_ARG; 477 return IDEVICE_E_INVALID_ARG;
478 478
479 *uuid = strdup(device->uuid); 479 *udid = strdup(device->udid);
480 return IDEVICE_E_SUCCESS; 480 return IDEVICE_E_SUCCESS;
481} 481}
482 482