summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Paul Sladen2009-03-29 19:07:39 +0200
committerGravatar Nikias Bassen2009-03-29 19:07:39 +0200
commitda537aae30386c8b3bdc5075b96971b5776a7176 (patch)
treea1f771c6920590684921ad8f7d5d1c9b6499686e
parent15ea7e8a03ab519115b19b4b84c2ead96bf6c88c (diff)
downloadusbmuxd-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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/iproxy.c b/iproxy.c
index 199c51e..56e30ed 100644
--- a/iproxy.c
+++ b/iproxy.c
@@ -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);