diff options
| -rw-r--r-- | dev/ideviceheartbeat.c | 2 | ||||
| -rw-r--r-- | include/libimobiledevice/heartbeat.h | 2 | ||||
| -rw-r--r-- | include/libimobiledevice/webinspector.h | 2 | ||||
| -rw-r--r-- | src/heartbeat.c | 6 | ||||
| -rw-r--r-- | src/webinspector.c | 6 |
5 files changed, 11 insertions, 7 deletions
diff --git a/dev/ideviceheartbeat.c b/dev/ideviceheartbeat.c index 4fb56ff..89fe742 100644 --- a/dev/ideviceheartbeat.c +++ b/dev/ideviceheartbeat.c | |||
| @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) | |||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /* start heartbeat service on device */ | 103 | /* start heartbeat service on device */ |
| 104 | heartbeat_client_start_service(device, &heartbeat); | 104 | heartbeat_client_start_service(device, &heartbeat, "ideviceheartbeat"); |
| 105 | 105 | ||
| 106 | if (heartbeat) { | 106 | if (heartbeat) { |
| 107 | printf("< heartbeat started, listening...\n"); | 107 | printf("< heartbeat started, listening...\n"); |
diff --git a/include/libimobiledevice/heartbeat.h b/include/libimobiledevice/heartbeat.h index 611a2dd..8db2941 100644 --- a/include/libimobiledevice/heartbeat.h +++ b/include/libimobiledevice/heartbeat.h | |||
| @@ -49,7 +49,7 @@ typedef struct heartbeat_client_private heartbeat_client_private; | |||
| 49 | typedef heartbeat_client_private *heartbeat_client_t; /**< The client handle. */ | 49 | typedef heartbeat_client_private *heartbeat_client_t; /**< The client handle. */ |
| 50 | 50 | ||
| 51 | heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client); | 51 | heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client); |
| 52 | heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client); | 52 | heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label); |
| 53 | heartbeat_error_t heartbeat_client_free(heartbeat_client_t client); | 53 | heartbeat_error_t heartbeat_client_free(heartbeat_client_t client); |
| 54 | 54 | ||
| 55 | heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist); | 55 | heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist); |
diff --git a/include/libimobiledevice/webinspector.h b/include/libimobiledevice/webinspector.h index a6e8541..dfd4dd2 100644 --- a/include/libimobiledevice/webinspector.h +++ b/include/libimobiledevice/webinspector.h | |||
| @@ -49,7 +49,7 @@ typedef struct webinspector_client_private webinspector_client_private; | |||
| 49 | typedef webinspector_client_private *webinspector_client_t; /**< The client handle. */ | 49 | typedef webinspector_client_private *webinspector_client_t; /**< The client handle. */ |
| 50 | 50 | ||
| 51 | webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client); | 51 | webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client); |
| 52 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client); | 52 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label); |
| 53 | webinspector_error_t webinspector_client_free(webinspector_client_t client); | 53 | webinspector_error_t webinspector_client_free(webinspector_client_t client); |
| 54 | 54 | ||
| 55 | webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist); | 55 | webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist); |
diff --git a/src/heartbeat.c b/src/heartbeat.c index 30fb8af..817c6ad 100644 --- a/src/heartbeat.c +++ b/src/heartbeat.c | |||
| @@ -104,16 +104,18 @@ heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descr | |||
| 104 | * @param client Pointer that will point to a newly allocated | 104 | * @param client Pointer that will point to a newly allocated |
| 105 | * heartbeat_client_t upon successful return. Must be freed using | 105 | * heartbeat_client_t upon successful return. Must be freed using |
| 106 | * heartbeat_client_free() after use. | 106 | * heartbeat_client_free() after use. |
| 107 | * @param label The label to use for communication. Usually the program name. | ||
| 108 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 107 | * | 109 | * |
| 108 | * @return HEARTBEAT_E_SUCCESS on success, or an HEARTBEAT_E_* error | 110 | * @return HEARTBEAT_E_SUCCESS on success, or an HEARTBEAT_E_* error |
| 109 | * code otherwise. | 111 | * code otherwise. |
| 110 | */ | 112 | */ |
| 111 | heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client) | 113 | heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label) |
| 112 | { | 114 | { |
| 113 | *client = NULL; | 115 | *client = NULL; |
| 114 | 116 | ||
| 115 | lockdownd_client_t lckd = NULL; | 117 | lockdownd_client_t lckd = NULL; |
| 116 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { | 118 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, label)) { |
| 117 | idevice_free(device); | 119 | idevice_free(device); |
| 118 | debug_info("Could not create a lockdown client."); | 120 | debug_info("Could not create a lockdown client."); |
| 119 | return HEARTBEAT_E_UNKNOWN_ERROR; | 121 | return HEARTBEAT_E_UNKNOWN_ERROR; |
diff --git a/src/webinspector.c b/src/webinspector.c index 1b39ea0..8d05082 100644 --- a/src/webinspector.c +++ b/src/webinspector.c | |||
| @@ -104,16 +104,18 @@ webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service | |||
| 104 | * @param client Pointer that will point to a newly allocated | 104 | * @param client Pointer that will point to a newly allocated |
| 105 | * webinspector_client_t upon successful return. Must be freed using | 105 | * webinspector_client_t upon successful return. Must be freed using |
| 106 | * webinspector_client_free() after use. | 106 | * webinspector_client_free() after use. |
| 107 | * @param label The label to use for communication. Usually the program name. | ||
| 108 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 107 | * | 109 | * |
| 108 | * @return WEBINSPECTOR_E_SUCCESS on success, or an WEBINSPECTOR_E_* error | 110 | * @return WEBINSPECTOR_E_SUCCESS on success, or an WEBINSPECTOR_E_* error |
| 109 | * code otherwise. | 111 | * code otherwise. |
| 110 | */ | 112 | */ |
| 111 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client) | 113 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label) |
| 112 | { | 114 | { |
| 113 | *client = NULL; | 115 | *client = NULL; |
| 114 | 116 | ||
| 115 | lockdownd_client_t lckd = NULL; | 117 | lockdownd_client_t lckd = NULL; |
| 116 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { | 118 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, label)) { |
| 117 | idevice_free(device); | 119 | idevice_free(device); |
| 118 | debug_info("Could not create a lockdown client."); | 120 | debug_info("Could not create a lockdown client."); |
| 119 | return WEBINSPECTOR_E_UNKNOWN_ERROR; | 121 | return WEBINSPECTOR_E_UNKNOWN_ERROR; |
