summaryrefslogtreecommitdiffstats
path: root/usbmuxd/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'usbmuxd/client.h')
-rw-r--r--usbmuxd/client.h50
1 files changed, 2 insertions, 48 deletions
diff --git a/usbmuxd/client.h b/usbmuxd/client.h
index 0cda676..4fc1ab4 100644
--- a/usbmuxd/client.h
+++ b/usbmuxd/client.h
@@ -22,62 +22,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22#define __CLIENT_H__ 22#define __CLIENT_H__
23 23
24#include <stdint.h> 24#include <stdint.h>
25#include "usbmuxd-proto.h"
25 26
26struct device_info; 27struct device_info;
27struct mux_client; 28struct mux_client;
28 29
29enum client_result {
30 RESULT_OK = 0,
31 RESULT_BADCOMMAND = 1,
32 RESULT_BADDEV = 2,
33 RESULT_CONNREFUSED = 3,
34 // ???
35 // ???
36 RESULT_BADVERSION = 6,
37};
38
39enum client_msgtype {
40 MESSAGE_RESULT = 1,
41 MESSAGE_CONNECT = 2,
42 MESSAGE_LISTEN = 3,
43 MESSAGE_DEVICE_ADD = 4,
44 MESSAGE_DEVICE_REMOVE = 5,
45 //???
46 //???
47 //MESSAGE_PLIST = 8,
48};
49
50#define CLIENT_PROTOCOL_VERSION 0
51
52struct client_header {
53 uint32_t length;
54 uint32_t version;
55 uint32_t message;
56 uint32_t tag;
57};
58
59struct client_msg_result {
60 uint32_t result;
61};
62
63struct client_msg_connect {
64 uint32_t device_id;
65 uint16_t port;
66};
67
68struct client_msg_dev {
69 uint32_t device_id;
70 uint16_t device_pid;
71 char device_serial[256];
72 uint16_t padding;
73 uint32_t location;
74};
75
76int client_read(struct mux_client *client, void *buffer, int len); 30int client_read(struct mux_client *client, void *buffer, int len);
77int client_write(struct mux_client *client, void *buffer, int len); 31int client_write(struct mux_client *client, void *buffer, int len);
78int client_set_events(struct mux_client *client, short events); 32int client_set_events(struct mux_client *client, short events);
79void client_close(struct mux_client *client); 33void client_close(struct mux_client *client);
80int client_notify_connect(struct mux_client *client, enum client_result result); 34int client_notify_connect(struct mux_client *client, enum usbmuxd_result result);
81 35
82void client_device_add(struct device_info *dev); 36void client_device_add(struct device_info *dev);
83void client_device_remove(int device_id); 37void client_device_remove(int device_id);