diff options
| author | 2013-08-05 20:07:04 +0200 | |
|---|---|---|
| committer | 2013-08-05 20:07:04 +0200 | |
| commit | 3604756139b1a2dde383122745d37fe9d1c95f88 (patch) | |
| tree | 84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/diagnostics_relay.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/diagnostics_relay.c')
| -rw-r--r-- | src/diagnostics_relay.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/diagnostics_relay.c b/src/diagnostics_relay.c index 6069169..9786f0e 100644 --- a/src/diagnostics_relay.c +++ b/src/diagnostics_relay.c | |||
| @@ -102,6 +102,26 @@ diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdow | |||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | /** | 104 | /** |
| 105 | * Starts a new diagnostics_relay 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 | * diagnostics_relay_client_t upon successful return. Must be freed using | ||
| 110 | * diagnostics_relay_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 DIAGNOSTICS_RELAY_E_SUCCESS on success, or an DIAGNOSTICS_RELAY_E_* error | ||
| 115 | * code otherwise. | ||
| 116 | */ | ||
| 117 | diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t * client, const char* label) | ||
| 118 | { | ||
| 119 | diagnostics_relay_error_t err = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | ||
| 120 | service_client_factory_start_service(device, DIAGNOSTICS_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(diagnostics_relay_client_new), &err); | ||
| 121 | return err; | ||
| 122 | } | ||
| 123 | |||
| 124 | /** | ||
| 105 | * Disconnects a diagnostics_relay client from the device and frees up the | 125 | * Disconnects a diagnostics_relay client from the device and frees up the |
| 106 | * diagnostics_relay client data. | 126 | * diagnostics_relay client data. |
| 107 | * | 127 | * |
