Skip to contentSkip to conversation

autopair plugin

RFC PATCH New Scott James Remnant 1 participant 1 message Apr 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH v3 1/1 autopair plugin

The following plugin serves as a minimal example for the previous two patch sets, implementing PIN generation for HID keyboard devices using the "DisplayPinCode" set and a fixed PIN of 0000 for the set of mice and tablets that require pairing.

Should the attempt fail, the bonding callback patch set is used to retry after blacklisting the device's address so that the plugin will not further act on the device (and thus the user is prompted for a PIN).

This provides a behavior very closely matching OS X with BlueZ.

A full implementation of this plugin should provide configuration equal to the flexibility of the GNOME Bluetooth PIN Code Database, and perhaps a D-Bus interface for the UI to determine whether or not pairing is required for a given device.

This implementation serves while the debate about that plugin, and the configuration file format, takes place.

---
 Makefile.am        |    5 ++
 acinclude.m4       |    6 ++
 plugins/autopair.c |  202 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 213 insertions(+), 0 deletions(-)
 create mode 100644 plugins/autopair.c
Makefile.am +5 -0
index b770fc5..dc32b5d 100644
@@ -267,6 +267,11 @@ builtin_modules += dbusoob
 builtin_sources += plugins/dbusoob.c
 endif
 
+if AUTOPAIRPLUGIN
+builtin_modules += autopair
+builtin_sources += plugins/autopair.c
+endif
+
 if MAINTAINER_MODE
 plugin_LTLIBRARIES += plugins/external-dummy.la
 plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
acinclude.m4 +6 -0
index 429e466..5f5c779 100644
@@ -215,6 +215,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	sap_driver=dummy
 	dbusoob_enable=no
 	wiimote_enable=no
+	autopair_enable=no
 	gatt_enable=no
 
 	AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], [disable code optimization]), [
@@ -344,6 +345,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 		wiimote_enable=${enableval}
 	])
 
+	AC_ARG_ENABLE(autopair, AC_HELP_STRING([--enable-autopair], [compile with autopairing plugin]), [
+		autopair_enable=${enableval}
+	])
+
 	AC_ARG_ENABLE(hal, AC_HELP_STRING([--enable-hal], [Use HAL to determine adapter class]), [
 		hal_enable=${enableval}
 	])
@@ -404,5 +409,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
 	AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
 	AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
+	AM_CONDITIONAL(AUTOPAIRPLUGIN, test "${autopair_enable}" = "yes")
 	AM_CONDITIONAL(GATTMODULES, test "${gatt_enable}" = "yes")
 ])
plugins/autopair.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.7.3