summaryrefslogtreecommitdiffstats
path: root/src/usbmuxd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/usbmuxd.h')
-rw-r--r--src/usbmuxd.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/usbmuxd.h b/src/usbmuxd.h
index 15e97ee..ba45ec3 100644
--- a/src/usbmuxd.h
+++ b/src/usbmuxd.h
@@ -42,4 +42,50 @@ int usbmuxd_scan(usbmuxd_scan_result **available_devices);
42 */ 42 */
43int usbmuxd_connect(const int handle, const unsigned short tcp_port); 43int usbmuxd_connect(const int handle, const unsigned short tcp_port);
44 44
45/**
46 * Disconnect. For now, this just closes the socket file descriptor.
47 *
48 * @param sfd socker file descriptor returned by usbmuxd_connect()
49 *
50 * @return 0 on success, -1 on error.
51 */
52int usbmuxd_disconnect(int sfd);
53
54/**
55 * Send data to the specified socket.
56 *
57 * @param sfd socket file descriptor returned by usbmuxd_connect()
58 * @param data buffer to send
59 * @param len size of buffer to send
60 * @param sent_bytes how many bytes sent
61 *
62 * @return 0 on success, a negative errno value otherwise.
63 */
64int usbmuxd_send(int sfd, const char *data, uint32_t len, uint32_t *sent_bytes);
65
66/**
67 * Receive data from the specified socket.
68 *
69 * @param sfd socket file descriptor returned by usbmuxd_connect()
70 * @param data buffer to put the data to
71 * @param len number of bytes to receive
72 * @param recv_bytes number of bytes received
73 * @param timeout how many milliseconds to wait for data
74 *
75 * @return 0 on success, a negative errno value otherwise.
76 */
77int usbmuxd_recv_timeout(int sfd, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout);
78
79/**
80 * Receive data from the specified socket with a default timeout.
81 *
82 * @param sfd socket file descriptor returned by usbmuxd_connect()
83 * @param data buffer to put the data to
84 * @param len number of bytes to receive
85 * @param recv_bytes number of bytes received
86 *
87 * @return 0 on success, a negative errno value otherwise.
88 */
89int usbmuxd_recv(int sfd, char *data, uint32_t len, uint32_t *recv_bytes);
90
45#endif /* __USBMUXD_H */ 91#endif /* __USBMUXD_H */