diff options
| author | 2013-08-05 20:07:04 +0200 | |
|---|---|---|
| committer | 2013-08-05 20:07:04 +0200 | |
| commit | 3604756139b1a2dde383122745d37fe9d1c95f88 (patch) | |
| tree | 84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/mobilesync.c | |
| parent | d0635a7dc686e21d3eea6bf1c030657d6d575562 (diff) | |
| download | libimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.gz libimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.bz2 | |
Implement *_start_service() helper to simplify creation of service clients
Diffstat (limited to 'src/mobilesync.c')
| -rw-r--r-- | src/mobilesync.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mobilesync.c b/src/mobilesync.c index 0e98709..e9e05ee 100644 --- a/src/mobilesync.c +++ b/src/mobilesync.c | |||
| @@ -109,6 +109,26 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_des | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /** | 111 | /** |
| 112 | * Starts a new mobilesync service on the specified device and connects to it. | ||
| 113 | * | ||
| 114 | * @param device The device to connect to. | ||
| 115 | * @param client Pointer that will point to a newly allocated | ||
| 116 | * mobilesync_client_t upon successful return. Must be freed using | ||
| 117 | * mobilesync_client_free() after use. | ||
| 118 | * @param label The label to use for communication. Usually the program name. | ||
| 119 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 120 | * | ||
| 121 | * @return MOBILESYNC_E_SUCCESS on success, or an MOBILESYNC_E_* error | ||
| 122 | * code otherwise. | ||
| 123 | */ | ||
| 124 | mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label) | ||
| 125 | { | ||
| 126 | mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR; | ||
| 127 | service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err); | ||
| 128 | return err; | ||
| 129 | } | ||
| 130 | |||
| 131 | /** | ||
| 112 | * Disconnects a mobilesync client from the device and frees up the | 132 | * Disconnects a mobilesync client from the device and frees up the |
| 113 | * mobilesync client data. | 133 | * mobilesync client data. |
| 114 | * | 134 | * |
