summaryrefslogtreecommitdiffstats
path: root/include/libirecovery.h
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-05-20 13:10:26 +0200
committerGravatar Martin Szulecki2010-05-20 13:10:26 +0200
commitfdbdb9f9e964528d08038e51cd57f9545cef294a (patch)
tree9f8b43a2d95121973d48c2c23c26d732168069cb /include/libirecovery.h
parentcf12a431935f814b6f0b98fe43915c48fde2fcf0 (diff)
downloadlibirecovery-fdbdb9f9e964528d08038e51cd57f9545cef294a.tar.gz
libirecovery-fdbdb9f9e964528d08038e51cd57f9545cef294a.tar.bz2
Improve irecv_open()'s device selection logic and allow opening by uuid
Previous code did attempt to open anything with an Apple vendor id. Now it also verifies if the USB device is within a mode we know and also allows targeting a specific device by it's UUID.
Diffstat (limited to 'include/libirecovery.h')
-rw-r--r--include/libirecovery.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index 680448f..f977ebb 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -32,10 +32,13 @@ typedef enum {
IRECV_ERROR_USB_CONFIGURATION = -10
} irecv_error_t;
+#define APPLE_VENDOR_ID 0x05AC
+
typedef enum {
- kAppleId = 0x05AC,
- kKernelMode = 0x1294,
- kRecoveryMode = 0x1281,
+ kRecoveryMode1 = 0x1280,
+ kRecoveryMode2 = 0x1281,
+ kRecoveryMode3 = 0x1282,
+ kRecoveryMode4 = 0x1283,
kDfuMode = 0x1227
} irecv_mode_t;
@@ -50,6 +53,7 @@ struct irecv_device {
int config;
int interface;
int alt_interface;
+ char *uuid;
irecv_mode_t mode;
libusb_context* context;
libusb_device_handle* handle;
@@ -59,7 +63,7 @@ struct irecv_device {
irecv_device_t* irecv_init();
const char* irecv_strerror(irecv_error_t error);
-irecv_error_t irecv_open(irecv_device_t* device);
+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);