diff options
Diffstat (limited to 'include/libirecovery.h')
| -rw-r--r-- | include/libirecovery.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index 7c424f6..e3360f0 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h | |||
| @@ -35,18 +35,31 @@ enum { | |||
| 35 | kDfuMode = 0x1227 | 35 | kDfuMode = 0x1227 |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | typedef struct { | 38 | struct irecv_device; |
| 39 | typedef struct irecv_device irecv_device_t; | ||
| 40 | |||
| 41 | typedef int(*irecv_send_callback)(irecv_device_t* device, unsigned char* data, unsigned int size); | ||
| 42 | typedef int(*irecv_receive_callback)(irecv_device_t* device, unsigned char* data, unsigned int size); | ||
| 43 | |||
| 44 | struct irecv_device { | ||
| 39 | unsigned int mode; | 45 | unsigned int mode; |
| 46 | unsigned int debug; | ||
| 40 | struct libusb_context* context; | 47 | struct libusb_context* context; |
| 41 | struct libusb_device_handle* handle; | 48 | struct libusb_device_handle* handle; |
| 42 | } irecv_device; | 49 | irecv_receive_callback receive_callback; |
| 43 | 50 | irecv_send_callback send_callback; | |
| 44 | void irecv_set_debug(int level); | 51 | }; |
| 45 | int irecv_open(irecv_device* device); | 52 | |
| 46 | int irecv_exit(irecv_device* device); | 53 | irecv_device_t* irecv_init(); |
| 47 | int irecv_init(irecv_device** device); | 54 | int irecv_open(irecv_device_t* device); |
| 48 | int irecv_reset(irecv_device* device); | 55 | int irecv_exit(irecv_device_t* device); |
| 49 | int irecv_close(irecv_device* device); | 56 | int irecv_reset(irecv_device_t* device); |
| 50 | int irecv_send_file(irecv_device* device, const char* filename); | 57 | int irecv_close(irecv_device_t* device); |
| 51 | int irecv_send_command(irecv_device* device, const char* command); | 58 | void irecv_update(irecv_device_t* device); |
| 52 | int irecv_send_buffer(irecv_device* device, unsigned char* buffer, int length); | 59 | void irecv_set_debug(irecv_device_t* device, int level); |
| 60 | int irecv_send_file(irecv_device_t* device, const char* filename); | ||
| 61 | int irecv_send_command(irecv_device_t* device, unsigned char* command); | ||
| 62 | int irecv_send_buffer(irecv_device_t* device, unsigned char* buffer, int length); | ||
| 63 | int irecv_set_sender(irecv_device_t* device, irecv_send_callback callback); | ||
| 64 | int irecv_set_receiver(irecv_device_t* device, irecv_receive_callback callback); | ||
| 65 | |||
