summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-03-22 12:04:50 +0100
committerGravatar Nikias Bassen2024-03-22 12:04:50 +0100
commit90cd5efc8fd8ce31ede6121d691324ca2d588436 (patch)
tree73dfa6d84c887ccff6829c7973a1860581176987 /include
parentd3198a50e51674e0ec19284f44f4aeb027d160a3 (diff)
downloadlibirecovery-90cd5efc8fd8ce31ede6121d691324ca2d588436.tar.gz
libirecovery-90cd5efc8fd8ce31ede6121d691324ca2d588436.tar.bz2
Change irecv_send_buffer to accept an options bitfield instead of just one value
This allows to specify different options. To not break existing behavior, a value of 1 or (1 << 0) means IRECV_SEND_OPT_DFU_NOTIFY_FINISH which is used extensively in e.g. idevicerestore. Other options are IRECV_SEND_OPT_DFU_FORCE_ZLP which I don't remember what it was added for, and a new option IRECV_SEND_OPT_DFU_SMALL_PKT which needed for upload in port DFU mode, as it won't accept packets with more than 64 bytes data and also doesn't like a CRC attached to it.
Diffstat (limited to 'include')
-rw-r--r--include/libirecovery.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index 04892c4..ec9255b 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -122,6 +122,13 @@ typedef struct {
typedef struct irecv_client_private irecv_client_private;
typedef irecv_client_private* irecv_client_t;
+enum {
+ IRECV_SEND_OPT_NONE = 0,
+ IRECV_SEND_OPT_DFU_NOTIFY_FINISH = (1 << 0),
+ IRECV_SEND_OPT_DFU_FORCE_ZLP = (1 << 1),
+ IRECV_SEND_OPT_DFU_SMALL_PKT = (1 << 2)
+};
+
/* library */
IRECV_API void irecv_set_debug_level(int level);
IRECV_API const char* irecv_strerror(irecv_error_t error);
@@ -160,10 +167,10 @@ IRECV_API irecv_error_t irecv_event_subscribe(irecv_client_t client, irecv_event
IRECV_API irecv_error_t irecv_event_unsubscribe(irecv_client_t client, irecv_event_type type);
/* I/O */
-IRECV_API irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int dfu_notify_finished);
+IRECV_API irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, unsigned int options);
IRECV_API irecv_error_t irecv_send_command(irecv_client_t client, const char* command);
IRECV_API irecv_error_t irecv_send_command_breq(irecv_client_t client, const char* command, uint8_t b_request);
-IRECV_API irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, int dfu_notify_finished);
+IRECV_API irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, unsigned int options);
IRECV_API irecv_error_t irecv_recv_buffer(irecv_client_t client, char* buffer, unsigned long length);
/* commands */