summaryrefslogtreecommitdiffstats
path: root/src/mobilebackup.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-08-05 20:07:04 +0200
committerGravatar Martin Szulecki2013-08-05 20:07:04 +0200
commit3604756139b1a2dde383122745d37fe9d1c95f88 (patch)
tree84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/mobilebackup.c
parentd0635a7dc686e21d3eea6bf1c030657d6d575562 (diff)
downloadlibimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.gz
libimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.bz2
Implement *_start_service() helper to simplify creation of service clients
Diffstat (limited to 'src/mobilebackup.c')
-rw-r--r--src/mobilebackup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mobilebackup.c b/src/mobilebackup.c
index 6382b94..c53a2cb 100644
--- a/src/mobilebackup.c
+++ b/src/mobilebackup.c
@@ -100,6 +100,26 @@ mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service
100} 100}
101 101
102/** 102/**
103 * Starts a new mobilebackup service on the specified device and connects to it.
104 *
105 * @param device The device to connect to.
106 * @param client Pointer that will point to a newly allocated
107 * mobilebackup_client_t upon successful return. Must be freed using
108 * mobilebackup_client_free() after use.
109 * @param label The label to use for communication. Usually the program name.
110 * Pass NULL to disable sending the label in requests to lockdownd.
111 *
112 * @return MOBILEBACKUP_E_SUCCESS on success, or an MOBILEBACKUP_E_* error
113 * code otherwise.
114 */
115mobilebackup_error_t mobilebackup_client_start_service(idevice_t device, mobilebackup_client_t * client, const char* label)
116{
117 mobilebackup_error_t err = MOBILEBACKUP_E_UNKNOWN_ERROR;
118 service_client_factory_start_service(device, MOBILEBACKUP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup_client_new), &err);
119 return err;
120}
121
122/**
103 * Disconnects a mobilebackup client from the device and frees up the 123 * Disconnects a mobilebackup client from the device and frees up the
104 * mobilebackup client data. 124 * mobilebackup client data.
105 * 125 *