summaryrefslogtreecommitdiffstats
path: root/include/libirecovery.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libirecovery.h')
-rw-r--r--include/libirecovery.h63
1 files changed, 31 insertions, 32 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index f977ebb..9d30497 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -19,17 +19,17 @@
#include <libusb-1.0/libusb.h>
typedef enum {
- IRECV_SUCCESS = 0,
- IRECV_ERROR_NO_DEVICE = -1,
- IRECV_ERROR_OUT_OF_MEMORY = -2,
- IRECV_ERROR_UNABLE_TO_CONNECT = -3,
- IRECV_ERROR_INVALID_INPUT = -4,
- IRECV_ERROR_UNKNOWN = -5,
- IRECV_ERROR_FILE_NOT_FOUND = -6,
- IRECV_ERROR_USB_UPLOAD = -7,
- IRECV_ERROR_USB_STATUS = -8,
- IRECV_ERROR_USB_INTERFACE = -9,
- IRECV_ERROR_USB_CONFIGURATION = -10
+ IRECV_E_SUCCESS = 0,
+ IRECV_E_NO_DEVICE = -1,
+ IRECV_E_OUT_OF_MEMORY = -2,
+ IRECV_E_UNABLE_TO_CONNECT = -3,
+ IRECV_E_INVALID_INPUT = -4,
+ IRECV_E_UNKNOWN = -5,
+ IRECV_E_FILE_NOT_FOUND = -6,
+ IRECV_E_USB_UPLOAD = -7,
+ IRECV_E_USB_STATUS = -8,
+ IRECV_E_USB_INTERFACE = -9,
+ IRECV_E_USB_CONFIGURATION = -10
} irecv_error_t;
#define APPLE_VENDOR_ID 0x05AC
@@ -42,13 +42,13 @@ typedef enum {
kDfuMode = 0x1227
} irecv_mode_t;
-struct irecv_device;
-typedef struct irecv_device irecv_device_t;
+struct irecv_client;
+typedef struct irecv_client* irecv_client_t;
-typedef int(*irecv_send_callback)(irecv_device_t* device, unsigned char* data, int size);
-typedef int(*irecv_receive_callback)(irecv_device_t* device, unsigned char* data, int size);
+typedef int(*irecv_send_callback)(irecv_client_t client, unsigned char* data, int size);
+typedef int(*irecv_receive_callback)(irecv_client_t client, unsigned char* data, int size);
-struct irecv_device {
+struct irecv_client {
int debug;
int config;
int interface;
@@ -61,21 +61,20 @@ struct irecv_device {
irecv_receive_callback receive_callback;
};
-irecv_device_t* irecv_init();
const char* irecv_strerror(irecv_error_t error);
-irecv_error_t irecv_open(irecv_device_t* device, const char *uuid);
-irecv_error_t irecv_exit(irecv_device_t* device);
-irecv_error_t irecv_reset(irecv_device_t* device);
-irecv_error_t irecv_close(irecv_device_t* device);
-irecv_error_t irecv_receive(irecv_device_t* device);
-irecv_error_t irecv_set_debug(irecv_device_t* device, int level);
-irecv_error_t irecv_getenv(irecv_device_t* device, unsigned char** var);
-irecv_error_t irecv_send(irecv_device_t* device, unsigned char* command);
-irecv_error_t irecv_send_file(irecv_device_t* device, const char* filename);
-irecv_error_t irecv_send_command(irecv_device_t* device, unsigned char* command);
-irecv_error_t irecv_set_configuration(irecv_device_t* device, int configuration);
-irecv_error_t irecv_set_sender(irecv_device_t* device, irecv_send_callback callback);
-irecv_error_t irecv_set_receiver(irecv_device_t* device, irecv_receive_callback callback);
-irecv_error_t irecv_set_interface(irecv_device_t* device, int interface, int alt_interface);
-irecv_error_t irecv_send_buffer(irecv_device_t* device, unsigned char* buffer, unsigned int length);
+irecv_error_t irecv_open(irecv_client_t* client, const char *uuid);
+irecv_error_t irecv_reset(irecv_client_t client);
+irecv_error_t irecv_close(irecv_client_t client);
+irecv_error_t irecv_receive(irecv_client_t client);
+irecv_error_t irecv_set_debug(irecv_client_t client, int level);
+irecv_error_t irecv_getenv(irecv_client_t client, unsigned char** var);
+irecv_error_t irecv_get_ecid(irecv_client_t client, unsigned long long* pecid);
+irecv_error_t irecv_send(irecv_client_t client, unsigned char* command);
+irecv_error_t irecv_send_file(irecv_client_t client, const char* filename);
+irecv_error_t irecv_send_command(irecv_client_t client, unsigned char* command);
+irecv_error_t irecv_set_configuration(irecv_client_t client, int configuration);
+irecv_error_t irecv_set_sender(irecv_client_t client, irecv_send_callback callback);
+irecv_error_t irecv_set_receiver(irecv_client_t client, irecv_receive_callback callback);
+irecv_error_t irecv_set_interface(irecv_client_t client, int interface, int alt_interface);
+irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned int length);