diff options
| author | 2013-08-05 20:07:04 +0200 | |
|---|---|---|
| committer | 2013-08-05 20:07:04 +0200 | |
| commit | 3604756139b1a2dde383122745d37fe9d1c95f88 (patch) | |
| tree | 84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/sbservices.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/sbservices.c')
| -rw-r--r-- | src/sbservices.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sbservices.c b/src/sbservices.c index dde8b9d..9b66c7f 100644 --- a/src/sbservices.c +++ b/src/sbservices.c | |||
| @@ -104,6 +104,26 @@ sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_des | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | /** | 106 | /** |
| 107 | * Starts a new sbservices service on the specified device and connects to it. | ||
| 108 | * | ||
| 109 | * @param device The device to connect to. | ||
| 110 | * @param client Pointer that will point to a newly allocated | ||
| 111 | * sbservices_client_t upon successful return. Must be freed using | ||
| 112 | * sbservices_client_free() after use. | ||
| 113 | * @param label The label to use for communication. Usually the program name. | ||
| 114 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 115 | * | ||
| 116 | * @return SBSERVICES_E_SUCCESS on success, or an SBSERVICES_E_* error | ||
| 117 | * code otherwise. | ||
| 118 | */ | ||
| 119 | sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t * client, const char* label) | ||
| 120 | { | ||
| 121 | sbservices_error_t err = SBSERVICES_E_UNKNOWN_ERROR; | ||
| 122 | service_client_factory_start_service(device, SBSERVICES_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(sbservices_client_new), &err); | ||
| 123 | return err; | ||
| 124 | } | ||
| 125 | |||
| 126 | /** | ||
| 107 | * Disconnects an sbservices client from the device and frees up the | 127 | * Disconnects an sbservices client from the device and frees up the |
| 108 | * sbservices client data. | 128 | * sbservices client data. |
| 109 | * | 129 | * |
