diff options
author | Nikias Bassen | 2011-11-03 22:41:52 +0100 |
---|---|---|
committer | Nikias Bassen | 2011-11-03 22:41:52 +0100 |
commit | 15e2b3c5e6f7daf55da66756f9529bdeeb454197 (patch) | |
tree | ed9ee1312a8bc26e8c80481d5e1dbf83dbeaf91c | |
parent | bd7728153d4606c8271d152c6f08143bdd1c505e (diff) | |
download | libirecovery-15e2b3c5e6f7daf55da66756f9529bdeeb454197.tar.gz libirecovery-15e2b3c5e6f7daf55da66756f9529bdeeb454197.tar.bz2 |
add new device models
-rw-r--r-- | include/libirecovery.h | 12 | ||||
-rw-r--r-- | libirecovery.c | 29 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index 8f3208a..f62d599 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h @@ -46,6 +46,10 @@ extern "C" { #define CPID_IPOD4G 8930 #define CPID_APPLETV2 8930 #define CPID_IPHONE42 8930 +#define CPID_IPAD21 8940 +#define CPID_IPAD22 8940 +#define CPID_IPAD23 8940 +#define CPID_IPHONE4S 8940 #define BDID_UNKNOWN -1 #define BDID_IPHONE2G 0 @@ -59,6 +63,10 @@ extern "C" { #define BDID_IPOD4G 8 #define BDID_APPLETV2 10 #define BDID_IPHONE42 6 +#define BDID_IPAD21 4 +#define BDID_IPAD22 6 +#define BDID_IPAD23 2 +#define BDID_IPHONE4S 8 #define DEVICE_UNKNOWN -1 #define DEVICE_IPHONE2G 0 @@ -72,6 +80,10 @@ extern "C" { #define DEVICE_IPOD4G 8 #define DEVICE_APPLETV2 9 #define DEVICE_IPHONE42 10 +#define DEVICE_IPAD21 11 +#define DEVICE_IPAD22 12 +#define DEVICE_IPAD23 13 +#define DEVICE_IPHONE4S 14 enum { kRecoveryMode1 = 0x1280, diff --git a/libirecovery.c b/libirecovery.c index 614b81d..278a529 100644 --- a/libirecovery.c +++ b/libirecovery.c @@ -1224,6 +1224,35 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) { } break; + case CPID_IPAD21: + // iPad2,1 iPad2,2 iPad2,3 and iPhone4,1 share the same ChipID, so we need to check the BoardID + if (irecv_get_bdid(client, &bdid) < 0) { + break; + } + + switch (bdid) { + case BDID_IPAD21 + device_id = DEVICE_IPAD21; + break; + + case BDID_IPAD22 + device_id = DEVICE_IPAD22; + break; + + case BDID_IPAD23 + device_id = DEVICE_IPAD23; + break; + + case BDID_IPHONE4S + device_id = DEVICE_IPHONE4S; + break; + + default: + device_id = DEVICE_UNKNOWN; + break; + } + break; + default: device_id = DEVICE_UNKNOWN; break; |