- Remove obsoleted patches
- Add another CUPS backend patch - Update cable pairing patch for new build system
This commit is contained in:
parent
aad373c338
commit
ad8c9b3f5a
@ -1,6 +1,6 @@
|
|||||||
From f23a9556acf6308e217b11e0a882e89d799f2517 Mon Sep 17 00:00:00 2001
|
From 0f3b73be98d0f933970b87eda3fc6128de3788ab Mon Sep 17 00:00:00 2001
|
||||||
From: Bastien Nocera <hadess@hadess.net>
|
From: Bastien Nocera <hadess@hadess.net>
|
||||||
Date: Thu, 4 Jun 2009 10:23:58 +0100
|
Date: Tue, 1 Sep 2009 17:32:48 +0100
|
||||||
Subject: [PATCH] Add sixaxis cable-pairing plugin
|
Subject: [PATCH] Add sixaxis cable-pairing plugin
|
||||||
|
|
||||||
Implement the old "sixpair" using gudev (a GObject layer on top
|
Implement the old "sixpair" using gudev (a GObject layer on top
|
||||||
@ -10,18 +10,91 @@ When a Sixaxis device is plugged in, events are filtered, and
|
|||||||
the device is selected, poked around to set the default Bluetooth
|
the device is selected, poked around to set the default Bluetooth
|
||||||
address, and added to the database of the current default adapter.
|
address, and added to the database of the current default adapter.
|
||||||
---
|
---
|
||||||
|
Makefile.am | 11 ++-
|
||||||
acinclude.m4 | 16 +++
|
acinclude.m4 | 16 +++
|
||||||
configure.ac | 1 +
|
configure.ac | 1 +
|
||||||
plugins/Makefile.am | 11 ++-
|
plugins/cable.c | 361 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
plugins/cable.c | 361 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
4 files changed, 388 insertions(+), 1 deletions(-)
|
4 files changed, 388 insertions(+), 1 deletions(-)
|
||||||
create mode 100644 plugins/cable.c
|
create mode 100644 plugins/cable.c
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index 09eb7ec..cc8381e 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -162,6 +162,15 @@ builtin_modules += service
|
||||||
|
builtin_sources += plugins/service.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
+if CABLE
|
||||||
|
+plugin_LTLIBRARIES += plugins/cable.la
|
||||||
|
+
|
||||||
|
+plugins_cable_la_LIBADD = @CABLE_LIBS@
|
||||||
|
+plugins_cable_la_LDFLAGS = -module -avoid-version -no-undefined
|
||||||
|
+plugins_cable_la_CFLAGS = -fvisibility=hidden @DBUS_CFLAGS@ \
|
||||||
|
+ @GLIB_CFLAGS@ @CABLE_CFLAGS@
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
builtin_modules += hciops
|
||||||
|
builtin_sources += plugins/hciops.c
|
||||||
|
|
||||||
|
diff --git a/acinclude.m4 b/acinclude.m4
|
||||||
|
index 44f7c72..465fb67 100644
|
||||||
|
--- a/acinclude.m4
|
||||||
|
+++ b/acinclude.m4
|
||||||
|
@@ -142,6 +142,12 @@ AC_DEFUN([AC_PATH_USB], [
|
||||||
|
[Define to 1 if you need the usb_interrupt_read() function.]))
|
||||||
|
])
|
||||||
|
|
||||||
|
+AC_DEFUN([AC_PATH_CABLE], [
|
||||||
|
+ PKG_CHECK_MODULES(CABLE, gudev-1.0 libusb-1.0, cable_found=yes, cable_found=no)
|
||||||
|
+ AC_SUBST(CABLE_CFLAGS)
|
||||||
|
+ AC_SUBST(CABLE_LIBS)
|
||||||
|
+])
|
||||||
|
+
|
||||||
|
AC_DEFUN([AC_PATH_NETLINK], [
|
||||||
|
PKG_CHECK_MODULES(NETLINK, libnl-1, netlink_found=yes, netlink_found=no)
|
||||||
|
AC_SUBST(NETLINK_CFLAGS)
|
||||||
|
@@ -163,6 +169,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
||||||
|
netlink_enable=no
|
||||||
|
hal_enable=${hal_found}
|
||||||
|
usb_enable=${usb_found}
|
||||||
|
+ cable_enable=${cable_found}
|
||||||
|
alsa_enable=${alsa_found}
|
||||||
|
gstreamer_enable=${gstreamer_found}
|
||||||
|
audio_enable=yes
|
||||||
|
@@ -228,6 +235,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
||||||
|
usb_enable=${enableval}
|
||||||
|
])
|
||||||
|
|
||||||
|
+ AC_ARG_ENABLE(cable, AC_HELP_STRING([--enable-cable], [enable DeviceKit support]), [
|
||||||
|
+ cable_enable=${enableval}
|
||||||
|
+ ])
|
||||||
|
+
|
||||||
|
AC_ARG_ENABLE(netlink, AC_HELP_STRING([--enable-netlink], [enable NETLINK support]), [
|
||||||
|
netlink_enable=${enableval}
|
||||||
|
])
|
||||||
|
@@ -311,6 +322,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
||||||
|
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
+ if (test "${cable_enable}" = "yes" && test "${cable_found}" = "yes"); then
|
||||||
|
+ AC_DEFINE(HAVE_CABLE, 1, [Define to 1 if you have libcable.])
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
|
||||||
|
AM_CONDITIONAL(NETLINK, test "${netlink_enable}" = "yes" && test "${netlink_found}" = "yes")
|
||||||
|
AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
|
||||||
|
@@ -335,4 +350,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
||||||
|
AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
|
||||||
|
AM_CONDITIONAL(UDEVRULES, test "${udevrules_enable}" = "yes")
|
||||||
|
AM_CONDITIONAL(CONFIGFILES, test "${configfiles_enable}" = "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 1686d18..339d45c 100644
|
index 9e5279d..8b17659 100644
|
||||||
--- a/configure.ac
|
--- a/configure.ac
|
||||||
+++ b/configure.ac
|
+++ b/configure.ac
|
||||||
@@ -36,6 +36,7 @@ AC_PATH_GLIB
|
@@ -40,6 +40,7 @@ AC_PATH_GLIB
|
||||||
AC_PATH_ALSA
|
AC_PATH_ALSA
|
||||||
AC_PATH_GSTREAMER
|
AC_PATH_GSTREAMER
|
||||||
AC_PATH_USB
|
AC_PATH_USB
|
||||||
@ -29,59 +102,9 @@ index 1686d18..339d45c 100644
|
|||||||
AC_PATH_NETLINK
|
AC_PATH_NETLINK
|
||||||
AC_PATH_SNDFILE
|
AC_PATH_SNDFILE
|
||||||
|
|
||||||
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
|
|
||||||
index 9d9f970..e43584a 100644
|
|
||||||
--- a/plugins/Makefile.am
|
|
||||||
+++ b/plugins/Makefile.am
|
|
||||||
@@ -26,10 +26,16 @@ builtin_sources += hal.c
|
|
||||||
builtin_modules += storage
|
|
||||||
builtin_sources += storage.c
|
|
||||||
|
|
||||||
+if CABLE
|
|
||||||
+plugin_LTLIBRARIES += cable.la
|
|
||||||
+cable_la_LIBADD = @CABLE_CFLAGS@
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
noinst_LTLIBRARIES = libbuiltin.la echo.la
|
|
||||||
|
|
||||||
libbuiltin_la_SOURCES = $(builtin_sources)
|
|
||||||
libbuiltin_la_LDFLAGS =
|
|
||||||
+libbuiltin_la_LIBADD = @CABLE_LIBS@
|
|
||||||
libbuiltin_la_CFLAGS = $(AM_CFLAGS) \
|
|
||||||
$(builtin_cflags) -DBLUETOOTH_PLUGIN_BUILTIN
|
|
||||||
|
|
||||||
@@ -40,7 +46,7 @@ nodist_libbuiltin_la_SOURCES = $(BUILT_SOURCES)
|
|
||||||
AM_LDFLAGS = -module -avoid-version -no-undefined
|
|
||||||
|
|
||||||
AM_CFLAGS = -fvisibility=hidden @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ \
|
|
||||||
- @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @NETLINK_CFLAGS@
|
|
||||||
+ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @NETLINK_CFLAGS@ @CABLE_CFLAGS@
|
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src
|
|
||||||
|
|
||||||
@@ -49,6 +55,7 @@ CLEANFILES = $(BUILT_SOURCES)
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
|
||||||
|
|
||||||
builtin.h:
|
|
||||||
+ echo $(builtin_modules)
|
|
||||||
echo "" > $@
|
|
||||||
list='$(builtin_modules)'; for i in $$list; \
|
|
||||||
do echo "extern struct bluetooth_plugin_desc __bluetooth_builtin_$$i;" >> $@; done
|
|
||||||
@@ -63,9 +70,11 @@ all-local:
|
|
||||||
@$(LN_S) -f $(top_srcdir)/audio/.libs/audio.so
|
|
||||||
@$(LN_S) -f $(top_srcdir)/serial/.libs/serial.so
|
|
||||||
@$(LN_S) -f $(top_srcdir)/network/.libs/network.so
|
|
||||||
+ @$(LN_S) -f $(top_srcdir)/plugins/.libs/cable.so
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
@rm -f network.so
|
|
||||||
@rm -f serial.so
|
|
||||||
@rm -f audio.so
|
|
||||||
@rm -f input.so
|
|
||||||
+ @rm -f cable.so
|
|
||||||
diff --git a/plugins/cable.c b/plugins/cable.c
|
diff --git a/plugins/cable.c b/plugins/cable.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..9f24b55
|
index 0000000..9179c62
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/plugins/cable.c
|
+++ b/plugins/cable.c
|
||||||
@@ -0,0 +1,361 @@
|
@@ -0,0 +1,361 @@
|
||||||
@ -447,56 +470,5 @@ index 0000000..9f24b55
|
|||||||
+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)
|
||||||
--
|
--
|
||||||
1.6.0.6
|
1.6.2.5
|
||||||
|
|
||||||
--- bluez-4.43.old/acinclude.m4 2009-07-02 23:43:14.000000000 +0100
|
|
||||||
+++ bluez-4.43/acinclude.m4 2009-07-03 12:18:46.000000000 +0100
|
|
||||||
@@ -162,6 +162,12 @@ AC_DEFUN([AC_PATH_USB], [
|
|
||||||
[Define to 1 if you need the usb_interrupt_read() function.]))
|
|
||||||
])
|
|
||||||
|
|
||||||
+AC_DEFUN([AC_PATH_CABLE], [
|
|
||||||
+ PKG_CHECK_MODULES(CABLE, gudev-1.0 libusb-1.0, cable_found=yes, cable_found=no)
|
|
||||||
+ AC_SUBST(CABLE_CFLAGS)
|
|
||||||
+ AC_SUBST(CABLE_LIBS)
|
|
||||||
+])
|
|
||||||
+
|
|
||||||
AC_DEFUN([AC_PATH_NETLINK], [
|
|
||||||
PKG_CHECK_MODULES(NETLINK, libnl-1, netlink_found=yes, netlink_found=no)
|
|
||||||
AC_SUBST(NETLINK_CFLAGS)
|
|
||||||
@@ -182,6 +188,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
|
||||||
netlink_enable=no
|
|
||||||
hal_enable=${hal_found}
|
|
||||||
usb_enable=${usb_found}
|
|
||||||
+ cable_enable=${cable_found}
|
|
||||||
alsa_enable=${alsa_found}
|
|
||||||
gstreamer_enable=${gstreamer_found}
|
|
||||||
audio_enable=yes
|
|
||||||
@@ -244,6 +251,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
|
||||||
usb_enable=${enableval}
|
|
||||||
])
|
|
||||||
|
|
||||||
+ AC_ARG_ENABLE(cable, AC_HELP_STRING([--enable-cable], [enable DeviceKit support]), [
|
|
||||||
+ cable_enable=${enableval}
|
|
||||||
+ ])
|
|
||||||
+
|
|
||||||
AC_ARG_ENABLE(netlink, AC_HELP_STRING([--enable-netlink], [enable NETLINK support]), [
|
|
||||||
netlink_enable=${enableval}
|
|
||||||
])
|
|
||||||
@@ -327,6 +338,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
|
||||||
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
+ if (test "${cable_enable}" = "yes" && test "${cable_found}" = "yes"); then
|
|
||||||
+ AC_DEFINE(HAVE_CABLE, 1, [Define to 1 if you have libcable.])
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
AC_SUBST([BLUEZ_CFLAGS], ['-I$(top_builddir)/include'])
|
|
||||||
AC_SUBST([BLUEZ_LIBS], ['$(top_builddir)/lib/libbluetooth.la'])
|
|
||||||
|
|
||||||
@@ -360,4 +375,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
|
|
||||||
AM_CONDITIONAL(MANPAGES, test "${manpages_enable}" = "yes")
|
|
||||||
AM_CONDITIONAL(UDEVRULES, test "${udevrules_enable}" = "yes")
|
|
||||||
AM_CONDITIONAL(CONFIGFILES, test "${configfiles_enable}" = "yes")
|
|
||||||
+ AM_CONDITIONAL(CABLE, test "${cable_enable}" = "yes" && test "${cable_found}" = "yes")
|
|
||||||
])
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
From b2d24735492e6a71f3441720940ac55c33fa0838 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Till Kamppeter <till.kamppeter@gmail.com>
|
|
||||||
Date: Tue, 11 Aug 2009 14:04:05 +0100
|
|
||||||
Subject: [PATCH 1/2] Allow lp (CUPS) to talk to bluetoothd
|
|
||||||
|
|
||||||
CUPS runs its backend helpers as the "lp" user, so we should
|
|
||||||
allow CUPS to talk to bluetoothd to enumerate printers.
|
|
||||||
---
|
|
||||||
src/bluetooth.conf | 6 ++++++
|
|
||||||
1 files changed, 6 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
|
|
||||||
index c047623..315009c 100644
|
|
||||||
--- a/src/bluetooth.conf
|
|
||||||
+++ b/src/bluetooth.conf
|
|
||||||
@@ -17,6 +17,12 @@
|
|
||||||
<allow send_destination="org.bluez"/>
|
|
||||||
</policy>
|
|
||||||
|
|
||||||
+ <!-- allow users of lp group (printing subsystem) to
|
|
||||||
+ communicate with bluetoothd -->
|
|
||||||
+ <policy group="lp">
|
|
||||||
+ <allow send_destination="org.bluez"/>
|
|
||||||
+ </policy>
|
|
||||||
+
|
|
||||||
<policy context="default">
|
|
||||||
<deny send_destination="org.bluez"/>
|
|
||||||
</policy>
|
|
||||||
--
|
|
||||||
1.6.2.5
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
From 35ffd5a6dafd7e38c7d8c9502608314a44919302 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Bastien Nocera <hadess@hadess.net>
|
|
||||||
Date: Tue, 11 Aug 2009 12:23:39 +0100
|
|
||||||
Subject: [PATCH 1/2] Don't abort cups backend on property change
|
|
||||||
|
|
||||||
Make sure the cups backend doesn't abort when trying to
|
|
||||||
access a property that's not Discovering.
|
|
||||||
---
|
|
||||||
cups/main.c | 3 +++
|
|
||||||
1 files changed, 3 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cups/main.c b/cups/main.c
|
|
||||||
index 2fbfe7e..9c24734 100644
|
|
||||||
--- a/cups/main.c
|
|
||||||
+++ b/cups/main.c
|
|
||||||
@@ -506,6 +506,9 @@ static DBusHandlerResult filter_func(DBusConnection *connection, DBusMessage *me
|
|
||||||
|
|
||||||
dbus_message_iter_init(message, &iter);
|
|
||||||
dbus_message_iter_get_basic(&iter, &name);
|
|
||||||
+ if (name == NULL ||
|
|
||||||
+ strcmp(name, "Discovering") != 0)
|
|
||||||
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
|
||||||
dbus_message_iter_next(&iter);
|
|
||||||
dbus_message_iter_recurse(&iter, &value_iter);
|
|
||||||
dbus_message_iter_get_basic(&value_iter, &discovering);
|
|
||||||
--
|
|
||||||
1.6.2.5
|
|
||||||
|
|
140
0001-Make-discovery-mode-of-bluetooth-CUPS-backend-work-w.patch
Normal file
140
0001-Make-discovery-mode-of-bluetooth-CUPS-backend-work-w.patch
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
From fdf7b75f5fc8a9726db6756bcddff6aa74b42ba0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Till Kamppeter <till.kamppeter@gmail.com>
|
||||||
|
Date: Thu, 27 Aug 2009 09:07:49 +0200
|
||||||
|
Subject: [PATCH] Make discovery mode of bluetooth CUPS backend work with CUPS 1.4.0
|
||||||
|
|
||||||
|
The new CUPS 1.4.x does device discovery only for a given time frame
|
||||||
|
requested by the client (printer setup tool, "lpinfo" command). CUPS's
|
||||||
|
default for CUPS-1.3.x-ish requests without timeout specification
|
||||||
|
seems to be 10 seconds. CUPS starts all backends at once in the
|
||||||
|
beginning (in parallel) and kills every backend which remains running
|
||||||
|
at the end of the timeout. It accepts output from the backends
|
||||||
|
whenever it occurs not only when the backend finishes, so a backend
|
||||||
|
can search for printers infinitely long if it outputs every found
|
||||||
|
device immediately. Then all printers found during CUPS' timeout are
|
||||||
|
taken into account.
|
||||||
|
|
||||||
|
The bluetooth backend of 4.48 asks the Bluetooth daemon for printers
|
||||||
|
and collects results for 10 seconds and after that it outputs
|
||||||
|
them. This takes a total of 10.5 sec and so CUPS kills the backend
|
||||||
|
right before it answers (at least with the 10-second default timeout),
|
||||||
|
resulting in Bluetooth printers never being discovered by CUPS.
|
||||||
|
|
||||||
|
This change fixes it by making each new printer added to the list
|
||||||
|
being output immediately. Note that the list structure cannot be
|
||||||
|
removed from cups/main.c as otherwise we would get duplicate
|
||||||
|
listings. Also important is the addition of unbuffered output on
|
||||||
|
stdout.
|
||||||
|
---
|
||||||
|
ChangeLog | 2 +
|
||||||
|
cups/main.c | 63 +++++++++++++++++++++++-----------------------------------
|
||||||
|
2 files changed, 27 insertions(+), 38 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ChangeLog b/ChangeLog
|
||||||
|
index d06f494..6c170f6 100644
|
||||||
|
--- a/ChangeLog
|
||||||
|
+++ b/ChangeLog
|
||||||
|
@@ -1,3 +1,5 @@
|
||||||
|
+ver 4.51:
|
||||||
|
+ Make discovery mode of bluetooth CUPS backend work with CUPS 1.4.0.
|
||||||
|
ver 4.50:
|
||||||
|
Fix issue with missing manual pages in distribution.
|
||||||
|
Fix issue with the configuration and state directories.
|
||||||
|
diff --git a/cups/main.c b/cups/main.c
|
||||||
|
index da757b0..1bbc78c 100644
|
||||||
|
--- a/cups/main.c
|
||||||
|
+++ b/cups/main.c
|
||||||
|
@@ -185,6 +185,27 @@ static char *device_get_ieee1284_id(const char *adapter, const char *device)
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void print_printer_details(const char *name, const char *bdaddr, const char *id)
|
||||||
|
+{
|
||||||
|
+ char *uri, *escaped;
|
||||||
|
+
|
||||||
|
+ escaped = g_strdelimit(g_strdup(name), "\"", '\'');
|
||||||
|
+ uri = g_strdup_printf("bluetooth://%c%c%c%c%c%c%c%c%c%c%c%c",
|
||||||
|
+ bdaddr[0], bdaddr[1],
|
||||||
|
+ bdaddr[3], bdaddr[4],
|
||||||
|
+ bdaddr[6], bdaddr[7],
|
||||||
|
+ bdaddr[9], bdaddr[10],
|
||||||
|
+ bdaddr[12], bdaddr[13],
|
||||||
|
+ bdaddr[15], bdaddr[16]);
|
||||||
|
+ printf("direct %s \"%s\" \"%s (Bluetooth)\"", uri, escaped, escaped);
|
||||||
|
+ if (id != NULL)
|
||||||
|
+ printf(" \"%s\"\n", id);
|
||||||
|
+ else
|
||||||
|
+ printf("\n");
|
||||||
|
+ g_free(escaped);
|
||||||
|
+ g_free(uri);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void add_device_to_list(const char *name, const char *bdaddr, const char *id)
|
||||||
|
{
|
||||||
|
struct cups_device *device;
|
||||||
|
@@ -212,27 +233,7 @@ static void add_device_to_list(const char *name, const char *bdaddr, const char
|
||||||
|
device->id = g_strdup(id);
|
||||||
|
|
||||||
|
device_list = g_slist_prepend(device_list, device);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void print_printer_details(const char *name, const char *bdaddr, const char *id)
|
||||||
|
-{
|
||||||
|
- char *uri, *escaped;
|
||||||
|
-
|
||||||
|
- escaped = g_strdelimit(g_strdup(name), "\"", '\'');
|
||||||
|
- uri = g_strdup_printf("bluetooth://%c%c%c%c%c%c%c%c%c%c%c%c",
|
||||||
|
- bdaddr[0], bdaddr[1],
|
||||||
|
- bdaddr[3], bdaddr[4],
|
||||||
|
- bdaddr[6], bdaddr[7],
|
||||||
|
- bdaddr[9], bdaddr[10],
|
||||||
|
- bdaddr[12], bdaddr[13],
|
||||||
|
- bdaddr[15], bdaddr[16]);
|
||||||
|
- printf("direct %s \"%s\" \"%s (Bluetooth)\"", uri, escaped, escaped);
|
||||||
|
- if (id != NULL)
|
||||||
|
- printf(" \"%s\"\n", id);
|
||||||
|
- else
|
||||||
|
- printf("\n");
|
||||||
|
- g_free(escaped);
|
||||||
|
- g_free(uri);
|
||||||
|
+ print_printer_details(device->name, device->bdaddr, device->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean parse_device_properties(DBusMessageIter *reply_iter, char **name, char **bdaddr)
|
||||||
|
@@ -384,23 +385,6 @@ static void remote_device_found(const char *adapter, const char *bdaddr, const c
|
||||||
|
|
||||||
|
static void discovery_completed(void)
|
||||||
|
{
|
||||||
|
- GSList *l;
|
||||||
|
-
|
||||||
|
- for (l = device_list; l != NULL; l = l->next) {
|
||||||
|
- struct cups_device *device = (struct cups_device *) l->data;
|
||||||
|
-
|
||||||
|
- if (device->name == NULL)
|
||||||
|
- device->name = g_strdelimit(g_strdup(device->bdaddr), ":", '-');
|
||||||
|
- /* Give another try to getting an ID for the device */
|
||||||
|
- if (device->id == NULL)
|
||||||
|
- remote_device_found(NULL, device->bdaddr, device->name);
|
||||||
|
- print_printer_details(device->name, device->bdaddr, device->id);
|
||||||
|
- g_free(device->name);
|
||||||
|
- g_free(device->bdaddr);
|
||||||
|
- g_free(device->id);
|
||||||
|
- g_free(device);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
g_slist_free(device_list);
|
||||||
|
device_list = NULL;
|
||||||
|
|
||||||
|
@@ -638,6 +622,9 @@ int main(int argc, char *argv[])
|
||||||
|
/* Make sure status messages are not buffered */
|
||||||
|
setbuf(stderr, NULL);
|
||||||
|
|
||||||
|
+ /* Make sure output is not buffered */
|
||||||
|
+ setbuf(stdout, NULL);
|
||||||
|
+
|
||||||
|
/* Ignore SIGPIPE signals */
|
||||||
|
#ifdef HAVE_SIGSET
|
||||||
|
sigset(SIGPIPE, SIG_IGN);
|
||||||
|
--
|
||||||
|
1.6.3.3
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
From b29e1cb433454391da92720c3ff87373d9d60500 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Bastien Nocera <hadess@hadess.net>
|
|
||||||
Date: Tue, 11 Aug 2009 12:24:58 +0100
|
|
||||||
Subject: [PATCH 2/2] Actually read the CreateDevice reply
|
|
||||||
|
|
||||||
Fixes aborts when the printer isn't a known device.
|
|
||||||
---
|
|
||||||
cups/main.c | 6 +++---
|
|
||||||
1 files changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cups/main.c b/cups/main.c
|
|
||||||
index 9c24734..ba9864f 100644
|
|
||||||
--- a/cups/main.c
|
|
||||||
+++ b/cups/main.c
|
|
||||||
@@ -371,9 +371,9 @@ static void remote_device_found(const char *adapter, const char *bdaddr, const c
|
|
||||||
|
|
||||||
if (!reply)
|
|
||||||
return;
|
|
||||||
- } else {
|
|
||||||
- if (dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID) == FALSE)
|
|
||||||
- return;
|
|
||||||
+ }
|
|
||||||
+ if (dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID) == FALSE) {
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
|
|
||||||
id = device_get_ieee1284_id(adapter, object_path);
|
|
||||||
--
|
|
||||||
1.6.2.5
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From d96004d65132a7934308ded8010c5f819013157a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Till Kamppeter <till.kamppeter@gmail.com>
|
|
||||||
Date: Tue, 11 Aug 2009 14:06:59 +0100
|
|
||||||
Subject: [PATCH 2/2] Mark Bluetooth printers as being local
|
|
||||||
|
|
||||||
For discovery purposes. Also add a better label for the printer,
|
|
||||||
and append "(Bluetooth") to the "unique" name.
|
|
||||||
---
|
|
||||||
cups/main.c | 2 +-
|
|
||||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cups/main.c b/cups/main.c
|
|
||||||
index ba9864f..bb15c9c 100644
|
|
||||||
--- a/cups/main.c
|
|
||||||
+++ b/cups/main.c
|
|
||||||
@@ -226,7 +226,7 @@ static void print_printer_details(const char *name, const char *bdaddr, const ch
|
|
||||||
bdaddr[9], bdaddr[10],
|
|
||||||
bdaddr[12], bdaddr[13],
|
|
||||||
bdaddr[15], bdaddr[16]);
|
|
||||||
- printf("network %s \"Unknown\" \"%s (Bluetooth)\"", uri, escaped);
|
|
||||||
+ printf("direct %s \"%s\" \"%s (Bluetooth)\"", uri, escaped, escaped);
|
|
||||||
if (id != NULL)
|
|
||||||
printf(" \"%s\"\n", id);
|
|
||||||
else
|
|
||||||
--
|
|
||||||
1.6.2.5
|
|
||||||
|
|
20
bluez.spec
20
bluez.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: Bluetooth utilities
|
Summary: Bluetooth utilities
|
||||||
Name: bluez
|
Name: bluez
|
||||||
Version: 4.50
|
Version: 4.50
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
|
Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
|
||||||
@ -23,12 +23,8 @@ Patch3: bluez-activate-wacom-mode2.patch
|
|||||||
Patch4: bluez-socket-mobile-cf-connection-kit.patch
|
Patch4: bluez-socket-mobile-cf-connection-kit.patch
|
||||||
# http://thread.gmane.org/gmane.linux.bluez.kernel/2396
|
# http://thread.gmane.org/gmane.linux.bluez.kernel/2396
|
||||||
Patch5: 0001-Add-sixaxis-cable-pairing-plugin.patch
|
Patch5: 0001-Add-sixaxis-cable-pairing-plugin.patch
|
||||||
# http://thread.gmane.org/gmane.linux.bluez.kernel/3108
|
# http://thread.gmane.org/gmane.linux.bluez.kernel/3264/focus=3286
|
||||||
Patch6: 0001-Don-t-abort-cups-backend-on-property-change.patch
|
Patch6: 0001-Make-discovery-mode-of-bluetooth-CUPS-backend-work-w.patch
|
||||||
Patch7: 0002-Actually-read-the-CreateDevice-reply.patch
|
|
||||||
# http://thread.gmane.org/gmane.linux.bluez.kernel/3106/focus=3114
|
|
||||||
Patch8: 0001-Allow-lp-CUPS-to-talk-to-bluetoothd.patch
|
|
||||||
Patch9: 0002-Mark-Bluetooth-printers-as-being-local.patch
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
URL: http://www.bluez.org/
|
URL: http://www.bluez.org/
|
||||||
@ -138,10 +134,7 @@ This includes hidd, dund and pand.
|
|||||||
%patch3 -p1 -b .wacom
|
%patch3 -p1 -b .wacom
|
||||||
%patch4 -p1 -b .socket-mobile
|
%patch4 -p1 -b .socket-mobile
|
||||||
%patch5 -p1 -b .cable-pairing
|
%patch5 -p1 -b .cable-pairing
|
||||||
%patch6 -p1
|
%patch6 -p1 -b .newer-cups
|
||||||
%patch7 -p1
|
|
||||||
%patch8 -p1
|
|
||||||
%patch9 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
libtoolize -f -c
|
libtoolize -f -c
|
||||||
@ -281,6 +274,11 @@ fi
|
|||||||
%config(noreplace) %{_sysconfdir}/sysconfig/pand
|
%config(noreplace) %{_sysconfdir}/sysconfig/pand
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Sep 01 2009 Bastien Nocera <bnocera@redhat.com> 4.50-2
|
||||||
|
- Remove obsoleted patches
|
||||||
|
- Add another CUPS backend patch
|
||||||
|
- Update cable pairing patch for new build system
|
||||||
|
|
||||||
* Tue Sep 01 2009 Bastien Nocera <bnocera@redhat.com> 4.50-1
|
* Tue Sep 01 2009 Bastien Nocera <bnocera@redhat.com> 4.50-1
|
||||||
- Update to 4.50
|
- Update to 4.50
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user