summaryrefslogtreecommitdiffstats
path: root/src/mobilebackup2.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/mobilebackup2.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/mobilebackup2.c')
-rw-r--r--src/mobilebackup2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c
index c1159e1..594ba84 100644
--- a/src/mobilebackup2.c
+++ b/src/mobilebackup2.c
@@ -102,6 +102,26 @@ mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_servi
102} 102}
103 103
104/** 104/**
105 * Starts a new mobilebackup2 service on the specified device and connects to it.
106 *
107 * @param device The device to connect to.
108 * @param client Pointer that will point to a newly allocated
109 * mobilebackup2_client_t upon successful return. Must be freed using
110 * mobilebackup2_client_free() after use.
111 * @param label The label to use for communication. Usually the program name.
112 * Pass NULL to disable sending the label in requests to lockdownd.
113 *
114 * @return MOBILEBACKUP2_E_SUCCESS on success, or an MOBILEBACKUP2_E_* error
115 * code otherwise.
116 */
117mobilebackup2_error_t mobilebackup2_client_start_service(idevice_t device, mobilebackup2_client_t * client, const char* label)
118{
119 mobilebackup2_error_t err = MOBILEBACKUP2_E_UNKNOWN_ERROR;
120 service_client_factory_start_service(device, MOBILEBACKUP2_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup2_client_new), &err);
121 return err;
122}
123
124/**
105 * Disconnects a mobilebackup2 client from the device and frees up the 125 * Disconnects a mobilebackup2 client from the device and frees up the
106 * mobilebackup2 client data. 126 * mobilebackup2 client data.
107 * 127 *