summaryrefslogtreecommitdiffstats
path: root/src/mobilesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mobilesync.c')
-rw-r--r--src/mobilesync.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/mobilesync.c b/src/mobilesync.c
index 88d8497..47fcfdf 100644
--- a/src/mobilesync.c
+++ b/src/mobilesync.c
@@ -59,6 +59,18 @@ static mobilesync_error_t mobilesync_error(device_link_service_error_t err)
59 return MOBILESYNC_E_UNKNOWN_ERROR; 59 return MOBILESYNC_E_UNKNOWN_ERROR;
60} 60}
61 61
62/**
63 * Connects to the mobilesync service on the specified device.
64 *
65 * @param device The device to connect to.
66 * @param port Destination port (usually given by lockdownd_start_service).
67 * @param client Pointer that will be set to a newly allocated
68 * mobilesync_client_t upon successful return.
69 *
70 * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID ARG if one
71 * or more parameters are invalid, or DEVICE_LINK_SERVICE_E_BAD_VERSION if
72 * the mobilesync version on the device is newer.
73 */
62mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, 74mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port,
63 mobilesync_client_t * client) 75 mobilesync_client_t * client)
64{ 76{
@@ -87,6 +99,15 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port,
87 return ret; 99 return ret;
88} 100}
89 101
102/**
103 * Disconnects a mobilesync client from the device and frees up the
104 * mobilesync client data.
105 *
106 * @param client The mobilesync client to disconnect and free.
107 *
108 * @return MOBILESYNC_E_SUCCESS on success, or MOBILESYNC_E_INVALID_ARG
109 * if client is NULL.
110 */
90mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) 111mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
91{ 112{
92 if (!client) 113 if (!client)
@@ -97,9 +118,10 @@ mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
97 return err; 118 return err;
98} 119}
99 120
100/** Polls the device for MobileSync data. 121/**
122 * Polls the device for mobilesync data.
101 * 123 *
102 * @param client The MobileSync client 124 * @param client The mobilesync client
103 * @param plist A pointer to the location where the plist should be stored 125 * @param plist A pointer to the location where the plist should be stored
104 * 126 *
105 * @return an error code 127 * @return an error code
@@ -112,12 +134,13 @@ mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plis
112 return ret; 134 return ret;
113} 135}
114 136
115/** Sends MobileSync data to the device 137/**
138 * Sends mobilesync data to the device
116 * 139 *
117 * @note This function is low-level and should only be used if you need to send 140 * @note This function is low-level and should only be used if you need to send
118 * a new type of message. 141 * a new type of message.
119 * 142 *
120 * @param client The MobileSync client 143 * @param client The mobilesync client
121 * @param plist The location of the plist to send 144 * @param plist The location of the plist to send
122 * 145 *
123 * @return an error code 146 * @return an error code