diff options
| author | 2013-08-05 20:07:04 +0200 | |
|---|---|---|
| committer | 2013-08-05 20:07:04 +0200 | |
| commit | 3604756139b1a2dde383122745d37fe9d1c95f88 (patch) | |
| tree | 84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/house_arrest.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/house_arrest.c')
| -rw-r--r-- | src/house_arrest.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/house_arrest.c b/src/house_arrest.c index 4eaf5e3..f4314e7 100644 --- a/src/house_arrest.c +++ b/src/house_arrest.c | |||
| @@ -83,6 +83,26 @@ house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service | |||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
| 86 | * Starts a new house_arrest service on the specified device and connects to it. | ||
| 87 | * | ||
| 88 | * @param device The device to connect to. | ||
| 89 | * @param client Pointer that will point to a newly allocated | ||
| 90 | * house_arrest_client_t upon successful return. Must be freed using | ||
| 91 | * house_arrest_client_free() after use. | ||
| 92 | * @param label The label to use for communication. Usually the program name. | ||
| 93 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 94 | * | ||
| 95 | * @return HOUSE_ARREST_E_SUCCESS on success, or an HOUSE_ARREST_E_* error | ||
| 96 | * code otherwise. | ||
| 97 | */ | ||
| 98 | house_arrest_error_t house_arrest_client_start_service(idevice_t device, house_arrest_client_t * client, const char* label) | ||
| 99 | { | ||
| 100 | house_arrest_error_t err = HOUSE_ARREST_E_UNKNOWN_ERROR; | ||
| 101 | service_client_factory_start_service(device, HOUSE_ARREST_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(house_arrest_client_new), &err); | ||
| 102 | return err; | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 86 | * Disconnects an house_arrest client from the device and frees up the | 106 | * Disconnects an house_arrest client from the device and frees up the |
| 87 | * house_arrest client data. | 107 | * house_arrest client data. |
| 88 | * | 108 | * |
