From 37fff2713545f7d660097842acfeb67e6eb5026c Mon Sep 17 00:00:00 2001
From: Patrick Walton <pcwalton@ucla.edu>
Date: Sun, 19 Oct 2008 01:21:42 -0700
Subject: [PATCH] Draft HAL

Fix fdi file
---
 Makefile.am                    |  2 +-
 configure.ac                   |  2 +-
 fdi/31-apple-mobile-device.fdi | 15 +++++++++++++++
 fdi/Makefile.am                |  3 +++
 include/libiphone/libiphone.h  |  1 +
 5 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 fdi/31-apple-mobile-device.fdi
 create mode 100644 fdi/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index 4ce113c..d2db548 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src include
+SUBDIRS = src include fdi
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libiphone-1.0.pc
diff --git a/configure.ac b/configure.ac
index bfb0378..7fc417c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,4 +38,4 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
 
-AC_OUTPUT(Makefile src/Makefile include/Makefile libiphone-1.0.pc)
+AC_OUTPUT(Makefile src/Makefile include/Makefile fdi/Makefile libiphone-1.0.pc)
diff --git a/fdi/31-apple-mobile-device.fdi b/fdi/31-apple-mobile-device.fdi
new file mode 100644
index 0000000..3e9ccc9
--- /dev/null
+++ b/fdi/31-apple-mobile-device.fdi
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<deviceinfo version="0.2">
+  <device>
+    <match key="info.subsystem" string="usb">
+      <match key="usb.vendor_id" int="0x05ac">
+        <match key="usb.product_id" compare_ge="0x1290">
+          <match key="usb.product_id" compare_le="0x1293">
+            <append key="info.capabilities" type="strlist">afc</append>
+          </match>
+        </match>
+      </match>
+    </match>
+  </device>
+</deviceinfo>
+
diff --git a/fdi/Makefile.am b/fdi/Makefile.am
new file mode 100644
index 0000000..31e716b
--- /dev/null
+++ b/fdi/Makefile.am
@@ -0,0 +1,3 @@
+freedesktopfdidir=$(prefix)/share/hal/fdi/information/20thirdparty/
+freedesktopfdi_DATA=31-apple-mobile-device.fdi
+
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index 2e66b5d..1a62e9d 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -77,6 +77,7 @@ struct iphone_afc_file_int;
 typedef struct iphone_afc_file_int *iphone_afc_file_t;
 
 //device related functions
+void iphone_set_debug(int level);
 iphone_error_t iphone_get_device ( iphone_device_t *device );
 iphone_error_t iphone_free_device ( iphone_device_t device );
 
-- 
2.18.1