diff options
author | Martin Szulecki | 2013-08-05 20:07:04 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-08-05 20:07:04 +0200 |
commit | 3604756139b1a2dde383122745d37fe9d1c95f88 (patch) | |
tree | 84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/notification_proxy.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/notification_proxy.c')
-rw-r--r-- | src/notification_proxy.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index 410a519..88ff72b 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c @@ -117,6 +117,26 @@ np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t servic } /** + * Starts a new notification proxy service on the specified device and connects to it. + * + * @param device The device to connect to. + * @param client Pointer that will point to a newly allocated + * np_client_t upon successful return. Must be freed using + * np_client_free() after use. + * @param label The label to use for communication. Usually the program name. + * Pass NULL to disable sending the label in requests to lockdownd. + * + * @return NP_E_SUCCESS on success, or an NP_E_* error + * code otherwise. + */ +np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label) +{ + np_error_t err = NP_E_UNKNOWN_ERROR; + service_client_factory_start_service(device, NP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(np_client_new), &err); + return err; +} + +/** * Disconnects a notification_proxy client from the device and frees up the * notification_proxy client data. * |