diff options
author | Joshua Hill | 2010-05-16 12:45:00 -0400 |
---|---|---|
committer | Joshua Hill | 2010-05-16 12:45:00 -0400 |
commit | e7cc5716d941ee2c1ec554926e76448092d9e0c5 (patch) | |
tree | a55f73699d385670b0f1106e6378fc2ac3a554b6 /include | |
parent | ebaf0a72d826a4c8f09d965cd2863d1848a999db (diff) | |
download | libirecovery-e7cc5716d941ee2c1ec554926e76448092d9e0c5.tar.gz libirecovery-e7cc5716d941ee2c1ec554926e76448092d9e0c5.tar.bz2 |
Added send and receive callbacks in libirecovery and added history saving into irecovery.c
Diffstat (limited to 'include')
-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 { kDfuMode = 0x1227 }; -typedef struct { +struct irecv_device; +typedef struct irecv_device irecv_device_t; + +typedef int(*irecv_send_callback)(irecv_device_t* device, unsigned char* data, unsigned int size); +typedef int(*irecv_receive_callback)(irecv_device_t* device, unsigned char* data, unsigned int size); + +struct irecv_device { unsigned int mode; + unsigned int debug; struct libusb_context* context; struct libusb_device_handle* handle; -} irecv_device; - -void irecv_set_debug(int level); -int irecv_open(irecv_device* device); -int irecv_exit(irecv_device* device); -int irecv_init(irecv_device** device); -int irecv_reset(irecv_device* device); -int irecv_close(irecv_device* device); -int irecv_send_file(irecv_device* device, const char* filename); -int irecv_send_command(irecv_device* device, const char* command); -int irecv_send_buffer(irecv_device* device, unsigned char* buffer, int length); + irecv_receive_callback receive_callback; + irecv_send_callback send_callback; +}; + +irecv_device_t* irecv_init(); +int irecv_open(irecv_device_t* device); +int irecv_exit(irecv_device_t* device); +int irecv_reset(irecv_device_t* device); +int irecv_close(irecv_device_t* device); +void irecv_update(irecv_device_t* device); +void irecv_set_debug(irecv_device_t* device, int level); +int irecv_send_file(irecv_device_t* device, const char* filename); +int irecv_send_command(irecv_device_t* device, unsigned char* command); +int irecv_send_buffer(irecv_device_t* device, unsigned char* buffer, int length); +int irecv_set_sender(irecv_device_t* device, irecv_send_callback callback); +int irecv_set_receiver(irecv_device_t* device, irecv_receive_callback callback); + |