diff options
Diffstat (limited to 'include/libirecovery.h')
| -rw-r--r-- | include/libirecovery.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index 73fe6f0..201be0d 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | * libirecovery.h | 2 | * libirecovery.h |
| 3 | * Communication to iBoot/iBSS on Apple iOS devices via USB | 3 | * Communication to iBoot/iBSS on Apple iOS devices via USB |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2012-2019 Nikias Bassen <nikias@gmx.li> | ||
| 5 | * Copyright (c) 2012-2013 Martin Szulecki <m.szulecki@libimobiledevice.org> | 6 | * Copyright (c) 2012-2013 Martin Szulecki <m.szulecki@libimobiledevice.org> |
| 6 | * Copyright (c) 2012-2013 Nikias Bassen | ||
| 7 | * Copyright (c) 2010 Chronic-Dev Team | 7 | * Copyright (c) 2010 Chronic-Dev Team |
| 8 | * Copyright (c) 2010 Joshua Hill | 8 | * Copyright (c) 2010 Joshua Hill |
| 9 | * | 9 | * |
| @@ -27,7 +27,7 @@ extern "C" { | |||
| 27 | 27 | ||
| 28 | #include <stdint.h> | 28 | #include <stdint.h> |
| 29 | 29 | ||
| 30 | enum { | 30 | enum irecv_mode { |
| 31 | IRECV_K_RECOVERY_MODE_1 = 0x1280, | 31 | IRECV_K_RECOVERY_MODE_1 = 0x1280, |
| 32 | IRECV_K_RECOVERY_MODE_2 = 0x1281, | 32 | IRECV_K_RECOVERY_MODE_2 = 0x1281, |
| 33 | IRECV_K_RECOVERY_MODE_3 = 0x1282, | 33 | IRECV_K_RECOVERY_MODE_3 = 0x1282, |
| @@ -93,14 +93,25 @@ struct irecv_device_info { | |||
| 93 | unsigned int sep_nonce_size; | 93 | unsigned int sep_nonce_size; |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | typedef enum { | ||
| 97 | IRECV_DEVICE_ADD = 1, | ||
| 98 | IRECV_DEVICE_REMOVE = 2 | ||
| 99 | } irecv_device_event_type; | ||
| 100 | |||
| 101 | typedef struct { | ||
| 102 | irecv_device_event_type type; | ||
| 103 | enum irecv_mode mode; | ||
| 104 | struct irecv_device_info *device_info; | ||
| 105 | } irecv_device_event_t; | ||
| 106 | |||
| 96 | typedef struct irecv_client_private irecv_client_private; | 107 | typedef struct irecv_client_private irecv_client_private; |
| 97 | typedef irecv_client_private* irecv_client_t; | 108 | typedef irecv_client_private* irecv_client_t; |
| 98 | 109 | ||
| 99 | /* library */ | 110 | /* library */ |
| 100 | void irecv_set_debug_level(int level); | 111 | void irecv_set_debug_level(int level); |
| 101 | const char* irecv_strerror(irecv_error_t error); | 112 | const char* irecv_strerror(irecv_error_t error); |
| 102 | void irecv_init(void); | 113 | void irecv_init(void); /* deprecated: libirecovery has constructor now */ |
| 103 | void irecv_exit(void); | 114 | void irecv_exit(void); /* deprecated: libirecovery has destructor now */ |
| 104 | 115 | ||
| 105 | /* device connectivity */ | 116 | /* device connectivity */ |
| 106 | irecv_error_t irecv_open_with_ecid(irecv_client_t* client, unsigned long long ecid); | 117 | irecv_error_t irecv_open_with_ecid(irecv_client_t* client, unsigned long long ecid); |
| @@ -123,6 +134,10 @@ int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, u | |||
| 123 | int irecv_usb_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); | 134 | int irecv_usb_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); |
| 124 | 135 | ||
| 125 | /* events */ | 136 | /* events */ |
| 137 | typedef void(*irecv_device_event_cb_t)(const irecv_device_event_t* event, void *user_data); | ||
| 138 | typedef struct irecv_device_event_context* irecv_device_event_context_t; | ||
| 139 | irecv_error_t irecv_device_event_subscribe(irecv_device_event_context_t *context, irecv_device_event_cb_t callback, void *user_data); | ||
| 140 | irecv_error_t irecv_device_event_unsubscribe(irecv_device_event_context_t context); | ||
| 126 | typedef int(*irecv_event_cb_t)(irecv_client_t client, const irecv_event_t* event); | 141 | typedef int(*irecv_event_cb_t)(irecv_client_t client, const irecv_event_t* event); |
| 127 | irecv_error_t irecv_event_subscribe(irecv_client_t client, irecv_event_type type, irecv_event_cb_t callback, void *user_data); | 142 | irecv_error_t irecv_event_subscribe(irecv_client_t client, irecv_event_type type, irecv_event_cb_t callback, void *user_data); |
| 128 | irecv_error_t irecv_event_unsubscribe(irecv_client_t client, irecv_event_type type); | 143 | irecv_error_t irecv_event_unsubscribe(irecv_client_t client, irecv_event_type type); |
