diff options
author | Paul Sladen | 2009-03-29 19:07:39 +0200 |
---|---|---|
committer | Nikias Bassen | 2009-03-29 19:07:39 +0200 |
commit | da537aae30386c8b3bdc5075b96971b5776a7176 (patch) | |
tree | a1f771c6920590684921ad8f7d5d1c9b6499686e | |
parent | 15ea7e8a03ab519115b19b4b84c2ead96bf6c88c (diff) | |
download | usbmuxd-da537aae30386c8b3bdc5075b96971b5776a7176.tar.gz usbmuxd-da537aae30386c8b3bdc5075b96971b5776a7176.tar.bz2 |
[PATCH] iproxy: print count and serial_number of device(s)
Signed-off-by: Nikias Bassen <nikias@gmx.li>
-rw-r--r-- | iproxy.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -143,6 +143,7 @@ void *acceptor_thread(void *arg) struct client_data *cdata; usbmuxd_scan_result *dev_list = NULL; pthread_t ctos; + int count; if (!arg) { fprintf(stderr, "invalid client_data provided!\n"); @@ -151,19 +152,21 @@ void *acceptor_thread(void *arg) cdata = (struct client_data*)arg; - if (usbmuxd_scan(&dev_list) < 0) { + if ((count = usbmuxd_scan(&dev_list)) < 0) { printf("Connecting to usbmuxd failed, terminating.\n"); free(dev_list); return NULL; } + fprintf(stdout, "Number of available devices == %d\n", count); + if (dev_list == NULL || dev_list[0].handle == 0) { printf("No connected device found, terminating.\n"); free(dev_list); return NULL; } - fprintf(stdout, "Requesting connecion to device handle == %d, port %d\n", dev_list[0].handle, device_port); + fprintf(stdout, "Requesting connecion to device handle == %d (serial: %s), port %d\n", dev_list[0].handle, dev_list[0].serial_number, device_port); cdata->sfd = usbmuxd_connect(dev_list[0].handle, device_port); free(dev_list); |