From 15ea7e8a03ab519115b19b4b84c2ead96bf6c88c Mon Sep 17 00:00:00 2001 From: Paul Sladen Date: Sun, 29 Mar 2009 19:04:38 +0200 Subject: [PATCH] usbmuxd/libusbmuxd.h: separate logic from implementation tweak public parameter and struct names for clarity fix usbmuxd_scan() to return number of devices per documentation expand public documentation in libusbmux.h Signed-off-by: Nikias Bassen --- iproxy.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'iproxy.c') diff --git a/iproxy.c b/iproxy.c index 896dbff..199c51e 100644 --- a/iproxy.c +++ b/iproxy.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "sock_stuff.h" #include "libusbmuxd.h" @@ -142,7 +141,7 @@ void *run_ctos_loop(void *arg) void *acceptor_thread(void *arg) { struct client_data *cdata; - usbmuxd_device_t *dev_list = NULL; + usbmuxd_scan_result *dev_list = NULL; pthread_t ctos; if (!arg) { @@ -152,21 +151,21 @@ void *acceptor_thread(void *arg) cdata = (struct client_data*)arg; - if (usbmuxd_scan(&dev_list) != 0) { + if (usbmuxd_scan(&dev_list) < 0) { printf("Connecting to usbmuxd failed, terminating.\n"); free(dev_list); return NULL; } - if (!dev_list || dev_list[0].device_id == 0) { + 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 %d port %d\n", dev_list[0].device_id, device_port); + fprintf(stdout, "Requesting connecion to device handle == %d, port %d\n", dev_list[0].handle, device_port); - cdata->sfd = usbmuxd_connect(dev_list[0].device_id, device_port); + cdata->sfd = usbmuxd_connect(dev_list[0].handle, device_port); free(dev_list); if (cdata->sfd < 0) { fprintf(stderr, "Error connecting to device!\n"); @@ -191,7 +190,7 @@ int main(int argc, char **argv) int mysock = -1; if (argc != 3) { - printf("usage: %s LOCAL_PORT DEVICE_PORT\n", argv[0]); + printf("usage: %s LOCAL_TCP_PORT DEVICE_TCP_PORT\n", argv[0]); return 0; } -- cgit v1.1-32-gdbae