diff options
| -rw-r--r-- | README | 5 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | include/libiphone/libiphone.h | 1 | ||||
| -rw-r--r-- | src/NotificationProxy.c | 1 | ||||
| -rw-r--r-- | src/iphone.c | 18 | ||||
| -rw-r--r-- | udev/89-libiphone.rules | 8 |
6 files changed, 20 insertions, 15 deletions
| @@ -24,10 +24,11 @@ To compile run: | |||
| 24 | ./configure | 24 | ./configure |
| 25 | make | 25 | make |
| 26 | sudo make install # (if you want to install it into your system directories) | 26 | sudo make install # (if you want to install it into your system directories) |
| 27 | libiphone-initconf # (as the user you intend to use the library) | ||
| 27 | 28 | ||
| 28 | On Ubuntu/Debian, you can do: | 29 | On Ubuntu/Debian, you can do: |
| 29 | sudo apt-get install build-essential automake autoconf libtool \ | 30 | sudo apt-get install build-essential automake autoconf libtool\ |
| 30 | libgnutls-dev libusb-dev libfuse-dev libglib2.0-dev \ | 31 | libgnutls-dev libusb-dev libfuse-dev libglib2.0-dev libxml2-dev \ |
| 31 | libreadline5-dev | 32 | libreadline5-dev |
| 32 | 33 | ||
| 33 | == Who/what/where? == | 34 | == Who/what/where? == |
diff --git a/configure.ac b/configure.ac index e2f98c7..a26be74 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -23,7 +23,7 @@ AM_PROG_CC_C_O | |||
| 23 | PKG_CHECK_MODULES(libusb, libusb >= 0.1.12) | 23 | PKG_CHECK_MODULES(libusb, libusb >= 0.1.12) |
| 24 | PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1) | 24 | PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1) |
| 25 | PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1) | 25 | PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1) |
| 26 | PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 gnutls <= 2.5.0 ) | 26 | PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 ) |
| 27 | PKG_CHECK_MODULES(libtasn1, libtasn1 >= 1.1) | 27 | PKG_CHECK_MODULES(libtasn1, libtasn1 >= 1.1) |
| 28 | PKG_CHECK_MODULES(libplist, libplist >= 0.10) | 28 | PKG_CHECK_MODULES(libplist, libplist >= 0.10) |
| 29 | 29 | ||
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 0035e2f..0d5257a 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h | |||
| @@ -96,6 +96,7 @@ void iphone_set_debug(int level); | |||
| 96 | 96 | ||
| 97 | //device related functions | 97 | //device related functions |
| 98 | iphone_error_t iphone_get_device ( iphone_device_t *device ); | 98 | iphone_error_t iphone_get_device ( iphone_device_t *device ); |
| 99 | iphone_error_t iphone_get_specific_device( unsigned int bus_n, int dev_n, iphone_device_t * device ); | ||
| 99 | iphone_error_t iphone_free_device ( iphone_device_t device ); | 100 | iphone_error_t iphone_free_device ( iphone_device_t device ); |
| 100 | 101 | ||
| 101 | 102 | ||
diff --git a/src/NotificationProxy.c b/src/NotificationProxy.c index 726852e..bf837bf 100644 --- a/src/NotificationProxy.c +++ b/src/NotificationProxy.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <string.h> | ||
| 22 | #include <stdio.h> | 23 | #include <stdio.h> |
| 23 | #include <plist/plist.h> | 24 | #include <plist/plist.h> |
| 24 | #include "NotificationProxy.h" | 25 | #include "NotificationProxy.h" |
diff --git a/src/iphone.c b/src/iphone.c index 6eb56f7..5076b48 100644 --- a/src/iphone.c +++ b/src/iphone.c | |||
| @@ -95,7 +95,7 @@ static void iphone_config_usb_device(iphone_device_t phone) | |||
| 95 | * descriptor on return. | 95 | * descriptor on return. |
| 96 | * @return IPHONE_E_SUCCESS if ok, otherwise an error code. | 96 | * @return IPHONE_E_SUCCESS if ok, otherwise an error code. |
| 97 | */ | 97 | */ |
| 98 | static iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device) | 98 | iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device) |
| 99 | { | 99 | { |
| 100 | struct usb_bus *bus, *busses; | 100 | struct usb_bus *bus, *busses; |
| 101 | struct usb_device *dev; | 101 | struct usb_device *dev; |
| @@ -230,13 +230,15 @@ iphone_error_t iphone_free_device(iphone_device_t device) | |||
| 230 | unsigned char buf[512]; | 230 | unsigned char buf[512]; |
| 231 | 231 | ||
| 232 | // read final package(s) | 232 | // read final package(s) |
| 233 | do { | 233 | if (device->device != NULL) { |
| 234 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800); | 234 | do { |
| 235 | if (bytes > 0) { | 235 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800); |
| 236 | log_debug_msg("iphone_free_device: final read returned\n"); | 236 | if (bytes > 0) { |
| 237 | log_debug_buffer(buf, bytes); | 237 | log_debug_msg("iphone_free_device: final read returned\n"); |
| 238 | } | 238 | log_debug_buffer(buf, bytes); |
| 239 | } while (bytes > 0); | 239 | } |
| 240 | } while (bytes > 0); | ||
| 241 | } | ||
| 240 | 242 | ||
| 241 | if (device->buffer) { | 243 | if (device->buffer) { |
| 242 | free(device->buffer); | 244 | free(device->buffer); |
diff --git a/udev/89-libiphone.rules b/udev/89-libiphone.rules index 0982d29..aeefc68 100644 --- a/udev/89-libiphone.rules +++ b/udev/89-libiphone.rules | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | ATTR{idVendor}!="05ac", GOTO="libiphone_rules_end" | 1 | ATTR{idVendor}!="05ac", GOTO="libiphone_rules_end" |
| 2 | 2 | ||
| 3 | # Forces iPhone 1.0, 3G and iPodTouch 1 and 2 to USB configuration 3 | 3 | # Forces iPhone 1.0, 3G and iPodTouch 1 and 2 to USB configuration 3 |
| 4 | KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1290", ACTION=="add", ATTR{bConfigurationValue}="3" | 4 | SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290", ACTION=="add", ATTR{bConfigurationValue}="3" |
| 5 | KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1291", ACTION=="add", ATTR{bConfigurationValue}="3" | 5 | SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1291", ACTION=="add", ATTR{bConfigurationValue}="3" |
| 6 | KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1292", ACTION=="add", ATTR{bConfigurationValue}="3" | 6 | SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1292", ACTION=="add", ATTR{bConfigurationValue}="3" |
| 7 | KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1293", ACTION=="add", ATTR{bConfigurationValue}="3" | 7 | SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1293", ACTION=="add", ATTR{bConfigurationValue}="3" |
| 8 | 8 | ||
| 9 | LABEL="libiphone_rules_end" | 9 | LABEL="libiphone_rules_end" |
