diff options
author | Joshua Hill | 2010-05-13 05:59:36 -0400 |
---|---|---|
committer | Joshua Hill | 2010-05-13 05:59:36 -0400 |
commit | a57e39d7180ae1c7ce28105fb0c735121dec6f0d (patch) | |
tree | f435bddb3658cb310cb9f5e57b20775f32ec26c7 /include/libirecovery.h | |
parent | 2e8feabfe1ec82e75434663d5e3128e1769f34c5 (diff) | |
download | libirecovery-a57e39d7180ae1c7ce28105fb0c735121dec6f0d.tar.gz libirecovery-a57e39d7180ae1c7ce28105fb0c735121dec6f0d.tar.bz2 |
Began work. Added basic Makefile and implemented irecv_init(), irecv_open(), irecv_close(), and irecv_exit()
Needs to be tested on MacOSX and Windows, and Makefile needs to be updated for these platforms.
Diffstat (limited to 'include/libirecovery.h')
-rw-r--r-- | include/libirecovery.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h new file mode 100644 index 0000000..c94a3e6 --- /dev/null +++ b/include/libirecovery.h @@ -0,0 +1,43 @@ +/** + * iRecovery - Utility for DFU 2.0, WTF and Recovery Mode + * Copyright (C) 2008 - 2009 westbaer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + +#include <libusb-1.0/libusb.h> + +#define kAppleVendorId 0x05AC + +#define IRECV_SUCCESS 0 +#define IRECV_ERROR_NO_DEVICE -1 +#define IRECV_ERROR_OUT_OF_MEMORY -2 +#define IRECV_ERROR_UNABLE_TO_CONNECT -3 + +enum { + kKernelMode = 0x1294, + kRecoveryMode = 0x1281, + kDfuMode = 0x1227 +}; + +typedef struct { + unsigned int mode; + struct libusb_context* context; + struct libusb_device_handle* handle; +} irecv_device; + +int irecv_init(irecv_device** device); +int irecv_open(irecv_device* device); +int irecv_close(irecv_device* device); +int irecv_exit(irecv_device* device); |