summaryrefslogtreecommitdiffstats
path: root/src/mobilebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mobilebackup.c')
-rw-r--r--src/mobilebackup.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/mobilebackup.c b/src/mobilebackup.c
index c5f0a84..15da0a1 100644
--- a/src/mobilebackup.c
+++ b/src/mobilebackup.c
@@ -59,6 +59,18 @@ static mobilebackup_error_t mobilebackup_error(device_link_service_error_t err)
59 return MOBILEBACKUP_E_UNKNOWN_ERROR; 59 return MOBILEBACKUP_E_UNKNOWN_ERROR;
60} 60}
61 61
62/**
63 * Connects to the mobilebackup 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 * mobilebackup_client_t upon successful return.
69 *
70 * @return MOBILEBACKUP_E_SUCCESS on success, MOBILEBACKUP_E_INVALID ARG if one
71 * or more parameters are invalid, or DEVICE_LINK_SERVICE_E_BAD_VERSION if
72 * the mobilebackup version on the device is newer.
73 */
62mobilebackup_error_t mobilebackup_client_new(idevice_t device, uint16_t port, 74mobilebackup_error_t mobilebackup_client_new(idevice_t device, uint16_t port,
63 mobilebackup_client_t * client) 75 mobilebackup_client_t * client)
64{ 76{
@@ -87,6 +99,15 @@ mobilebackup_error_t mobilebackup_client_new(idevice_t device, uint16_t port,
87 return ret; 99 return ret;
88} 100}
89 101
102/**
103 * Disconnects a mobilebackup client from the device and frees up the
104 * mobilebackup client data.
105 *
106 * @param client The mobilebackup client to disconnect and free.
107 *
108 * @return MOBILEBACKUP_E_SUCCESS on success, or MOBILEBACKUP_E_INVALID_ARG
109 * if client is NULL.
110 */
90mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client) 111mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client)
91{ 112{
92 if (!client) 113 if (!client)
@@ -97,9 +118,10 @@ mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client)
97 return err; 118 return err;
98} 119}
99 120
100/** Polls the device for MobileBackup data. 121/**
122 * Polls the device for mobilebackup data.
101 * 123 *
102 * @param client The MobileBackup client 124 * @param client The mobilebackup 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 @@ mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t
112 return ret; 134 return ret;
113} 135}
114 136
115/** Sends MobileBackup data to the device 137/**
138 * Sends mobilebackup 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 MobileBackup client 143 * @param client The mobilebackup 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