Blob Blame History Raw
From a3123cb2b2741ce309573adbff5b87ea613e0717 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 30 Dec 2011 12:34:29 +0100
Subject: [PATCH] Add sixaxis cable-pairing plugin

Implement the old "sixpair" using libudev and libusb-1.0.

When a Sixaxis device is plugged in, events are filtered, and
the device is selected, poked around to set the default Bluetooth
address, and added to the database of the current default adapter.
---
 src/adapter.c |    7 +++++++
 src/adapter.h |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 8675648..d921890 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1206,6 +1206,13 @@ static void service_auth_cancel(struct service_auth *auth)
 	g_free(auth);
 }
 
+void adapter_create_device_for_device(struct btd_adapter *adapter,
+				      struct btd_device *device)
+{
+	device_set_temporary(device, TRUE);
+	adapter->devices = g_slist_append(adapter->devices, device);
+}
+
 static void adapter_remove_device(struct btd_adapter *adapter,
 						struct btd_device *dev,
 						gboolean remove_storage)
diff --git a/src/adapter.h b/src/adapter.h
index 5c53b4a..dba4ed9 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -95,6 +95,9 @@ sdp_list_t *btd_adapter_get_services(struct btd_adapter *adapter);
 
 struct btd_device *adapter_find_device(struct btd_adapter *adapter, const char *dest);
 
+void adapter_create_device_for_device(struct btd_adapter *adapter,
+					struct btd_device *device);
+
 const char *adapter_get_path(struct btd_adapter *adapter);
 const bdaddr_t *adapter_get_address(struct btd_adapter *adapter);
 int adapter_set_name(struct btd_adapter *adapter, const char *name);
-- 
1.7.1