summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README5
-rw-r--r--configure.ac2
-rw-r--r--include/libiphone/libiphone.h1
-rw-r--r--src/NotificationProxy.c1
-rw-r--r--src/iphone.c18
-rw-r--r--udev/89-libiphone.rules8
6 files changed, 20 insertions, 15 deletions
diff --git a/README b/README
index 7ee438a..699064d 100644
--- a/README
+++ b/README
@@ -24,10 +24,11 @@ To compile run:
./configure
make
sudo make install # (if you want to install it into your system directories)
+ libiphone-initconf # (as the user you intend to use the library)
On Ubuntu/Debian, you can do:
- sudo apt-get install build-essential automake autoconf libtool \
- libgnutls-dev libusb-dev libfuse-dev libglib2.0-dev \
+ sudo apt-get install build-essential automake autoconf libtool\
+ libgnutls-dev libusb-dev libfuse-dev libglib2.0-dev libxml2-dev \
libreadline5-dev
== 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
PKG_CHECK_MODULES(libusb, libusb >= 0.1.12)
PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1)
PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1)
-PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 gnutls <= 2.5.0 )
+PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 )
PKG_CHECK_MODULES(libtasn1, libtasn1 >= 1.1)
PKG_CHECK_MODULES(libplist, libplist >= 0.10)
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);
//device related functions
iphone_error_t iphone_get_device ( iphone_device_t *device );
+iphone_error_t iphone_get_specific_device( unsigned int bus_n, int dev_n, iphone_device_t * device );
iphone_error_t iphone_free_device ( iphone_device_t device );
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 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
#include <stdio.h>
#include <plist/plist.h>
#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)
* descriptor on return.
* @return IPHONE_E_SUCCESS if ok, otherwise an error code.
*/
-static iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device)
+iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device)
{
struct usb_bus *bus, *busses;
struct usb_device *dev;
@@ -230,13 +230,15 @@ iphone_error_t iphone_free_device(iphone_device_t device)
unsigned char buf[512];
// read final package(s)
- do {
- bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800);
- if (bytes > 0) {
- log_debug_msg("iphone_free_device: final read returned\n");
- log_debug_buffer(buf, bytes);
- }
- } while (bytes > 0);
+ if (device->device != NULL) {
+ do {
+ bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800);
+ if (bytes > 0) {
+ log_debug_msg("iphone_free_device: final read returned\n");
+ log_debug_buffer(buf, bytes);
+ }
+ } while (bytes > 0);
+ }
if (device->buffer) {
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 @@
ATTR{idVendor}!="05ac", GOTO="libiphone_rules_end"
# Forces iPhone 1.0, 3G and iPodTouch 1 and 2 to USB configuration 3
-KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1290", ACTION=="add", ATTR{bConfigurationValue}="3"
-KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1291", ACTION=="add", ATTR{bConfigurationValue}="3"
-KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1292", ACTION=="add", ATTR{bConfigurationValue}="3"
-KERNEL=="?-?", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1293", ACTION=="add", ATTR{bConfigurationValue}="3"
+SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290", ACTION=="add", ATTR{bConfigurationValue}="3"
+SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1291", ACTION=="add", ATTR{bConfigurationValue}="3"
+SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1292", ACTION=="add", ATTR{bConfigurationValue}="3"
+SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1293", ACTION=="add", ATTR{bConfigurationValue}="3"
LABEL="libiphone_rules_end"