summaryrefslogtreecommitdiffstats
path: root/src/usbmuxd.h
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-05-04 18:18:40 +0200
committerGravatar Nikias Bassen2009-05-04 18:18:40 +0200
commit7364e09f6849076c710ac9ce52a5d5fd2445e19c (patch)
treeb1435d14501f704900142c0a5f7b11ea5f3217fa /src/usbmuxd.h
parentcae80628faeeb19a88a28d7fb058e74f8b2743ed (diff)
downloadusbmuxd-7364e09f6849076c710ac9ce52a5d5fd2445e19c.tar.gz
usbmuxd-7364e09f6849076c710ac9ce52a5d5fd2445e19c.tar.bz2
Use autotools build system and add license
Signed-off-by: Nikias Bassen <nikias@gmx.li>
Diffstat (limited to 'src/usbmuxd.h')
-rw-r--r--src/usbmuxd.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/usbmuxd.h b/src/usbmuxd.h
new file mode 100644
index 0000000..15e97ee
--- /dev/null
+++ b/src/usbmuxd.h
@@ -0,0 +1,45 @@
1#ifndef __USBMUXD_H
2#define __USBMUXD_H
3
4/**
5 * Array entry returned by 'usbmuxd_scan()' scanning.
6 *
7 * If more than one device is available, 'product_id' and
8 * 'serial_number' and be analysed to help make a selection.
9 * The relevant 'handle' should be passed to 'usbmuxd_connect()', to
10 * start a proxy connection. The value 'handle' should be considered
11 * opaque and no presumption made about the meaning of its value.
12 */
13typedef struct {
14 int handle;
15 int product_id;
16 char serial_number[41];
17} usbmuxd_scan_result;
18
19/**
20 * Contacts usbmuxd and performs a scan for connected devices.
21 *
22 * @param available_devices pointer to array of usbmuxd_scan_result.
23 * Array of available devices. The required 'handle'
24 * should be passed to 'usbmuxd_connect()'. The returned array
25 * is zero-terminated for convenience; the final (unused)
26 * entry containing handle == 0. The returned array pointer
27 * should be freed by passing to 'free()' after use.
28 *
29 * @return number of available devices, zero on no devices, or negative on error
30 */
31int usbmuxd_scan(usbmuxd_scan_result **available_devices);
32
33/**
34 * Request proxy connect to
35 *
36 * @param handle returned by 'usbmuxd_scan()'
37 *
38 * @param tcp_port TCP port number on device, in range 0-65535.
39 * common values are 62078 for lockdown, and 22 for SSH.
40 *
41 * @return file descriptor socket of the connection, or -1 on error
42 */
43int usbmuxd_connect(const int handle, const unsigned short tcp_port);
44
45#endif /* __USBMUXD_H */