[PATCH 1/6] Move Attrib client to the core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 Makefile.am      |    4 ++--
 attrib/manager.c |   47 -----------------------------------------------
 2 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2994bf9..1b92115 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,7 +89,8 @@ endif
 endif
 
 attrib_sources = attrib/att.h attrib/att.c attrib/gatt.h attrib/gatt.c \
-		attrib/gattrib.h attrib/gattrib.c
+		attrib/gattrib.h attrib/gattrib.c attrib/client.h \
+		attrib/client.c
 
 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
 					gdbus/object.c gdbus/polkit.c
@@ -204,7 +205,6 @@ endif
 builtin_modules += attrib
 builtin_sources += attrib/main.c \
 		attrib/manager.h attrib/manager.c \
-		attrib/client.h attrib/client.c \
 		attrib/example.h attrib/example.c
 endif
 
diff --git a/attrib/manager.c b/attrib/manager.c
index a5a7de4..df59a0a 100644
--- a/attrib/manager.c
+++ b/attrib/manager.c
@@ -35,57 +35,14 @@
 #include "hcid.h"
 
 #include "manager.h"
-#include "client.h"
 #include "example.h"
 
-#define GATT_UUID	"00001801-0000-1000-8000-00805f9b34fb"
-
 static DBusConnection *connection;
 
-static int client_probe(struct btd_device *device, GSList *uuids)
-{
-	const sdp_record_t *rec;
-	int psm = -1;
-
-	rec = btd_device_get_record(device, GATT_UUID);
-	if (rec) {
-		sdp_list_t *list;
-		if (sdp_get_access_protos(rec, &list) < 0)
-			return -1;
-
-		psm = sdp_get_proto_port(list, L2CAP_UUID);
-
-		sdp_list_foreach(list, (sdp_list_func_t) sdp_list_free, NULL);
-		sdp_list_free(list, NULL);
-
-		if (psm < 0)
-			return -1;
-	}
-
-	return attrib_client_register(device, psm);
-}
-
-static void client_remove(struct btd_device *device)
-{
-	attrib_client_unregister(device);
-}
-
-static struct btd_device_driver client_driver = {
-	.name = "gatt-client",
-	.uuids = BTD_UUIDS(GATT_UUID),
-	.probe = client_probe,
-	.remove = client_remove,
-};
-
 int attrib_manager_init(DBusConnection *conn)
 {
 	connection = dbus_connection_ref(conn);
 
-	attrib_client_init(connection);
-
-	btd_register_device_driver(&client_driver);
-
-
 	if (main_opts.attrib_server)
 		return server_example_init();
 
@@ -94,12 +51,8 @@ int attrib_manager_init(DBusConnection *conn)
 
 void attrib_manager_exit(void)
 {
-	btd_unregister_device_driver(&client_driver);
-
 	if (main_opts.attrib_server)
 		server_example_exit();
 
-	attrib_client_exit();
-
 	dbus_connection_unref(connection);
 }
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux