diff options
Diffstat (limited to 'src/webinspector.c')
| -rw-r--r-- | src/webinspector.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/webinspector.c b/src/webinspector.c index 14a8bd8..31c5b2c 100644 --- a/src/webinspector.c +++ b/src/webinspector.c | |||
| @@ -58,18 +58,6 @@ static webinspector_error_t webinspector_error(property_list_service_error_t err | |||
| 58 | return WEBINSPECTOR_E_UNKNOWN_ERROR; | 58 | return WEBINSPECTOR_E_UNKNOWN_ERROR; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | /** | ||
| 62 | * Connects to the webinspector service on the specified device. | ||
| 63 | * | ||
| 64 | * @param device The device to connect to. | ||
| 65 | * @param service The service descriptor returned by lockdownd_start_service. | ||
| 66 | * @param client Pointer that will point to a newly allocated | ||
| 67 | * webinspector_client_t upon successful return. Must be freed using | ||
| 68 | * webinspector_client_free() after use. | ||
| 69 | * | ||
| 70 | * @return WEBINSPECTOR_E_SUCCESS on success, WEBINSPECTOR_E_INVALID_ARG when | ||
| 71 | * client is NULL, or an WEBINSPECTOR_E_* error code otherwise. | ||
| 72 | */ | ||
| 73 | webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client) | 61 | webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client) |
| 74 | { | 62 | { |
| 75 | *client = NULL; | 63 | *client = NULL; |
| @@ -97,19 +85,6 @@ webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service | |||
| 97 | return 0; | 85 | return 0; |
| 98 | } | 86 | } |
| 99 | 87 | ||
| 100 | /** | ||
| 101 | * Starts a new webinspector service on the specified device and connects to it. | ||
| 102 | * | ||
| 103 | * @param device The device to connect to. | ||
| 104 | * @param client Pointer that will point to a newly allocated | ||
| 105 | * webinspector_client_t upon successful return. Must be freed using | ||
| 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. | ||
| 109 | * | ||
| 110 | * @return WEBINSPECTOR_E_SUCCESS on success, or an WEBINSPECTOR_E_* error | ||
| 111 | * code otherwise. | ||
| 112 | */ | ||
| 113 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label) | 88 | webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label) |
| 114 | { | 89 | { |
| 115 | webinspector_error_t err = WEBINSPECTOR_E_UNKNOWN_ERROR; | 90 | webinspector_error_t err = WEBINSPECTOR_E_UNKNOWN_ERROR; |
| @@ -117,15 +92,6 @@ webinspector_error_t webinspector_client_start_service(idevice_t device, webinsp | |||
| 117 | return err; | 92 | return err; |
| 118 | } | 93 | } |
| 119 | 94 | ||
| 120 | /** | ||
| 121 | * Disconnects a webinspector client from the device and frees up the | ||
| 122 | * webinspector client data. | ||
| 123 | * | ||
| 124 | * @param client The webinspector client to disconnect and free. | ||
| 125 | * | ||
| 126 | * @return WEBINSPECTOR_E_SUCCESS on success, WEBINSPECTOR_E_INVALID_ARG when | ||
| 127 | * client is NULL, or an WEBINSPECTOR_E_* error code otherwise. | ||
| 128 | */ | ||
| 129 | webinspector_error_t webinspector_client_free(webinspector_client_t client) | 95 | webinspector_error_t webinspector_client_free(webinspector_client_t client) |
| 130 | { | 96 | { |
| 131 | if (!client) | 97 | if (!client) |
| @@ -137,15 +103,6 @@ webinspector_error_t webinspector_client_free(webinspector_client_t client) | |||
| 137 | return err; | 103 | return err; |
| 138 | } | 104 | } |
| 139 | 105 | ||
| 140 | /** | ||
| 141 | * Sends a plist to the service. | ||
| 142 | * | ||
| 143 | * @param client The webinspector client | ||
| 144 | * @param plist The plist to send | ||
| 145 | * | ||
| 146 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 147 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client or plist is NULL | ||
| 148 | */ | ||
| 149 | webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist) | 106 | webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist) |
| 150 | { | 107 | { |
| 151 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; | 108 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; |
| @@ -203,35 +160,11 @@ webinspector_error_t webinspector_send(webinspector_client_t client, plist_t pli | |||
| 203 | return res; | 160 | return res; |
| 204 | } | 161 | } |
| 205 | 162 | ||
| 206 | /** | ||
| 207 | * Receives a plist from the service. | ||
| 208 | * | ||
| 209 | * @param client The webinspector client | ||
| 210 | * @param plist The plist to store the received data | ||
| 211 | * | ||
| 212 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 213 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client or plist is NULL | ||
| 214 | */ | ||
| 215 | webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist) | 163 | webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist) |
| 216 | { | 164 | { |
| 217 | return webinspector_receive_with_timeout(client, plist, 5000); | 165 | return webinspector_receive_with_timeout(client, plist, 5000); |
| 218 | } | 166 | } |
| 219 | 167 | ||
| 220 | /** | ||
| 221 | * Receives a plist using the given webinspector client. | ||
| 222 | * | ||
| 223 | * @param client The webinspector client to use for receiving | ||
| 224 | * @param plist pointer to a plist_t that will point to the received plist | ||
| 225 | * upon successful return | ||
| 226 | * @param timeout Maximum time in milliseconds to wait for data. | ||
| 227 | * | ||
| 228 | * @return WEBINSPECTOR_E_SUCCESS on success, | ||
| 229 | * WEBINSPECTOR_E_INVALID_ARG when client or *plist is NULL, | ||
| 230 | * WEBINSPECTOR_E_PLIST_ERROR when the received data cannot be | ||
| 231 | * converted to a plist, WEBINSPECTOR_E_MUX_ERROR when a | ||
| 232 | * communication error occurs, or WEBINSPECTOR_E_UNKNOWN_ERROR | ||
| 233 | * when an unspecified error occurs. | ||
| 234 | */ | ||
| 235 | webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms) | 168 | webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms) |
| 236 | { | 169 | { |
| 237 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; | 170 | webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR; |
