Update sixaxis pairing plugin patch

This commit is contained in:
Bastien Nocera 2011-12-30 12:37:18 +01:00
parent c30b00a67c
commit ede760a18d

View File

@ -1,7 +1,7 @@
From 3c2e6dab927acfa3dfbeb7b9bc910d6a9780b095 Mon Sep 17 00:00:00 2001 From ed744e12108008e6be2f7ec811c6969f9ed08405 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net> From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 1 Sep 2009 17:32:48 +0100 Date: Fri, 30 Dec 2011 12:34:29 +0100
Subject: [PATCH 1/2] Add sixaxis cable-pairing plugin Subject: [PATCH] Add sixaxis cable-pairing plugin
Implement the old "sixpair" using libudev and libusb-1.0. Implement the old "sixpair" using libudev and libusb-1.0.
@ -19,10 +19,10 @@ address, and added to the database of the current default adapter.
create mode 100644 plugins/cable.c create mode 100644 plugins/cable.c
diff --git a/Makefile.am b/Makefile.am diff --git a/Makefile.am b/Makefile.am
index 7eadf82..aecc8f2 100644 index f907f41..5646f7f 100644
--- a/Makefile.am --- a/Makefile.am
+++ b/Makefile.am +++ b/Makefile.am
@@ -223,6 +223,11 @@ builtin_sources += thermometer/main.c \ @@ -249,6 +249,11 @@ builtin_sources += thermometer/main.c \
thermometer/thermometer.h thermometer/thermometer.c thermometer/thermometer.h thermometer/thermometer.c
endif endif
@ -34,26 +34,26 @@ index 7eadf82..aecc8f2 100644
builtin_modules += hciops mgmtops builtin_modules += hciops mgmtops
builtin_sources += plugins/hciops.c plugins/mgmtops.c builtin_sources += plugins/hciops.c plugins/mgmtops.c
@@ -282,7 +287,7 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \ @@ -316,7 +321,7 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
src/event.h src/event.c \ src/event.h src/event.c \
src/oob.h src/oob.c src/eir.h src/eir.c src/oob.h src/oob.c src/eir.h src/eir.c
src_bluetoothd_LDADD = lib/libbluetooth.la @GLIB_LIBS@ @DBUS_LIBS@ \ src_bluetoothd_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @DBUS_LIBS@ \
- @CAPNG_LIBS@ -ldl -lrt - @CAPNG_LIBS@ -ldl -lrt
+ @CAPNG_LIBS@ @CABLE_LIBS@ -ldl -lrt + @CAPNG_LIBS@ @CABLE_LIBS@ -ldl -lrt
src_bluetoothd_LDFLAGS = -Wl,--export-dynamic \ src_bluetoothd_LDFLAGS = -Wl,--export-dynamic \
-Wl,--version-script=$(srcdir)/src/bluetooth.ver -Wl,--version-script=$(srcdir)/src/bluetooth.ver
@@ -397,7 +402,7 @@ EXTRA_DIST += doc/manager-api.txt \ @@ -452,7 +457,7 @@ EXTRA_DIST += doc/manager-api.txt \
AM_YFLAGS = -d AM_YFLAGS = -d
-AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ \ -AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@
+AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @CABLE_CFLAGS@ \ +AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @CABLE_CFLAGS@
-DBLUETOOTH_PLUGIN_BUILTIN -DPLUGINDIR=\""$(plugindir)"\"
INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \ INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
-I$(srcdir)/audio -I$(srcdir)/sbc -I$(srcdir)/gdbus \
diff --git a/acinclude.m4 b/acinclude.m4 diff --git a/acinclude.m4 b/acinclude.m4
index 3cb9459..c23368b 100644 index 2097d77..3cfe3e3 100644
--- a/acinclude.m4 --- a/acinclude.m4
+++ b/acinclude.m4 +++ b/acinclude.m4
@@ -155,6 +155,12 @@ AC_DEFUN([AC_PATH_UDEV], [ @@ -155,6 +155,12 @@ AC_DEFUN([AC_PATH_UDEV], [
@ -77,7 +77,7 @@ index 3cb9459..c23368b 100644
alsa_enable=${alsa_found} alsa_enable=${alsa_found}
gstreamer_enable=${gstreamer_found} gstreamer_enable=${gstreamer_found}
audio_enable=yes audio_enable=yes
@@ -286,6 +293,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ @@ -296,6 +303,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
usb_enable=${enableval} usb_enable=${enableval}
]) ])
@ -88,7 +88,7 @@ index 3cb9459..c23368b 100644
AC_ARG_ENABLE(tracer, AC_HELP_STRING([--enable-tracer], [install Tracing daemon]), [ AC_ARG_ENABLE(tracer, AC_HELP_STRING([--enable-tracer], [install Tracing daemon]), [
tracer_enable=${enableval} tracer_enable=${enableval}
]) ])
@@ -385,6 +396,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ @@ -395,6 +406,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.]) AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
fi fi
@ -99,17 +99,17 @@ index 3cb9459..c23368b 100644
AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes") AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes") AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(SBC, test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes" || AM_CONDITIONAL(SBC, test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes" ||
@@ -421,4 +436,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [ @@ -433,4 +448,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes") AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes") AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes") AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
+ AM_CONDITIONAL(CABLE, test "${cable_enable}" = "yes" && test "${cable_found}" = "yes") + AM_CONDITIONAL(CABLE, test "${cable_enable}" = "yes" && test "${cable_found}" = "yes")
]) ])
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 908ad55..bc2658c 100644 index 581b222..524b179 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -46,6 +46,7 @@ AC_PATH_GSTREAMER @@ -48,6 +48,7 @@ AC_PATH_GSTREAMER
AC_PATH_USB AC_PATH_USB
AC_PATH_UDEV AC_PATH_UDEV
AC_PATH_SNDFILE AC_PATH_SNDFILE
@ -506,10 +506,10 @@ index 0000000..e8cff76
+BLUETOOTH_PLUGIN_DEFINE(cable, VERSION, +BLUETOOTH_PLUGIN_DEFINE(cable, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, cable_init, cable_exit) + BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, cable_init, cable_exit)
diff --git a/src/adapter.c b/src/adapter.c diff --git a/src/adapter.c b/src/adapter.c
index 4c88a0e..09d8392 100644 index a776997..9c6d1e3 100644
--- a/src/adapter.c --- a/src/adapter.c
+++ b/src/adapter.c +++ b/src/adapter.c
@@ -1092,6 +1092,25 @@ static struct btd_device *adapter_create_device(DBusConnection *conn, @@ -1098,6 +1098,25 @@ static struct btd_device *adapter_create_device(DBusConnection *conn,
return device; return device;
} }
@ -536,10 +536,10 @@ index 4c88a0e..09d8392 100644
struct btd_device *device, struct btd_device *device,
gboolean remove_storage) gboolean remove_storage)
diff --git a/src/adapter.h b/src/adapter.h diff --git a/src/adapter.h b/src/adapter.h
index 687275a..7f7cb55 100644 index 23bc8a5..88b625c 100644
--- a/src/adapter.h --- a/src/adapter.h
+++ b/src/adapter.h +++ b/src/adapter.h
@@ -116,6 +116,9 @@ void adapter_update_found_devices(struct btd_adapter *adapter, bdaddr_t *bdaddr, @@ -116,6 +116,9 @@ void adapter_update_found_devices(struct btd_adapter *adapter,
int adapter_remove_found_device(struct btd_adapter *adapter, bdaddr_t *bdaddr); int adapter_remove_found_device(struct btd_adapter *adapter, bdaddr_t *bdaddr);
void adapter_emit_device_found(struct btd_adapter *adapter, void adapter_emit_device_found(struct btd_adapter *adapter,
struct remote_dev_info *dev); struct remote_dev_info *dev);
@ -547,8 +547,8 @@ index 687275a..7f7cb55 100644
+ struct btd_adapter *adapter, + struct btd_adapter *adapter,
+ struct btd_device *device); + struct btd_device *device);
void adapter_mode_changed(struct btd_adapter *adapter, uint8_t scan_mode); void adapter_mode_changed(struct btd_adapter *adapter, uint8_t scan_mode);
int adapter_update_local_name(struct btd_adapter *adapter, const char *name); int adapter_set_name(struct btd_adapter *adapter, const char *name);
void adapter_service_insert(struct btd_adapter *adapter, void *rec); void adapter_name_changed(struct btd_adapter *adapter, const char *name);
-- --
1.7.6 1.7.7.3