diff options
author | Ben Wagner | 2020-02-11 14:45:46 -0500 |
---|---|---|
committer | Nikias Bassen | 2022-03-29 12:11:18 +0200 |
commit | 2f1e0660ef0a3dcfa35c8003b0806bae3acd411d (patch) | |
tree | 75fdfa5356f92dbae0b71bb7d308a6a8be64db63 /include | |
parent | 66a56a1e37e6df108c8dbcd99b7f60dec1fe4622 (diff) | |
download | libimobiledevice-2f1e0660ef0a3dcfa35c8003b0806bae3acd411d.tar.gz libimobiledevice-2f1e0660ef0a3dcfa35c8003b0806bae3acd411d.tar.bz2 |
Add timeout and interrupt handling to debugserver. Fix debugserver_client_handle_response
Diffstat (limited to 'include')
-rw-r--r-- | include/libimobiledevice/debugserver.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/libimobiledevice/debugserver.h b/include/libimobiledevice/debugserver.h index ce8176c..03f97a4 100644 --- a/include/libimobiledevice/debugserver.h +++ b/include/libimobiledevice/debugserver.h @@ -119,7 +119,8 @@ debugserver_error_t debugserver_client_send(debugserver_client_t client, const c * @return DEBUGSERVER_E_SUCCESS on success, * DEBUGSERVER_E_INVALID_ARG when one or more parameters are * invalid, DEBUGSERVER_E_MUX_ERROR when a communication error - * occurs, or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified + * occurs, DEBUGSERVER_E_TIMEOUT when the timeout is reached, + * or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified * error occurs. */ debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout); @@ -178,6 +179,20 @@ debugserver_error_t debugserver_client_receive_response(debugserver_client_t cli debugserver_error_t debugserver_client_set_ack_mode(debugserver_client_t client, int enabled); /** + * Sets behavior when awaiting a response from the server. + * + * @see debugserver_client_send_command, debugserver_client_receive_response, debugserver_client_receive + * + * @param client The debugserver client + * @param cancel_receive A function pointer that will be called approximately every receive_loop_timeout milliseconds; the function should return a boolean flag specifying whether to stop waiting for a response. If NULL, behaves as if it always returns true. + * @param receive_loop_timeout Time in milliseconds between calls to cancel_receive. + * + * @return DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error + * code otherwise. + */ +debugserver_error_t debugserver_client_set_receive_params(debugserver_client_t client, int (*cancel_receive)(), int receive_loop_timeout); + +/** * Sets the argv which launches an app. * * @param client The debugserver client |