summaryrefslogtreecommitdiffstats
path: root/src/usbmuxd.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-05-18 00:39:41 +0200
committerGravatar Nikias Bassen2009-05-18 00:39:41 +0200
commitce97f25e9ab038f8a96b6d9c9f1b9d247aeec11c (patch)
tree0903d06a654eda8265a142bcb11cd6c0f7ce7503 /src/usbmuxd.h
parenta04c396a21d29da832de21c693da18e6cbf56a13 (diff)
downloadusbmuxd-ce97f25e9ab038f8a96b6d9c9f1b9d247aeec11c.tar.gz
usbmuxd-ce97f25e9ab038f8a96b6d9c9f1b9d247aeec11c.tar.bz2
Added usbmuxd_recv, usbmuxd_recv_timeout, usbmuxd_send, and usbmuxd_disconnect
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);
*/
int usbmuxd_connect(const int handle, const unsigned short tcp_port);
+/**
+ * Disconnect. For now, this just closes the socket file descriptor.
+ *
+ * @param sfd socker file descriptor returned by usbmuxd_connect()
+ *
+ * @return 0 on success, -1 on error.
+ */
+int usbmuxd_disconnect(int sfd);
+
+/**
+ * Send data to the specified socket.
+ *
+ * @param sfd socket file descriptor returned by usbmuxd_connect()
+ * @param data buffer to send
+ * @param len size of buffer to send
+ * @param sent_bytes how many bytes sent
+ *
+ * @return 0 on success, a negative errno value otherwise.
+ */
+int usbmuxd_send(int sfd, const char *data, uint32_t len, uint32_t *sent_bytes);
+
+/**
+ * Receive data from the specified socket.
+ *
+ * @param sfd socket file descriptor returned by usbmuxd_connect()
+ * @param data buffer to put the data to
+ * @param len number of bytes to receive
+ * @param recv_bytes number of bytes received
+ * @param timeout how many milliseconds to wait for data
+ *
+ * @return 0 on success, a negative errno value otherwise.
+ */
+int usbmuxd_recv_timeout(int sfd, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout);
+
+/**
+ * Receive data from the specified socket with a default timeout.
+ *
+ * @param sfd socket file descriptor returned by usbmuxd_connect()
+ * @param data buffer to put the data to
+ * @param len number of bytes to receive
+ * @param recv_bytes number of bytes received
+ *
+ * @return 0 on success, a negative errno value otherwise.
+ */
+int usbmuxd_recv(int sfd, char *data, uint32_t len, uint32_t *recv_bytes);
+
#endif /* __USBMUXD_H */