aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2010-07-07 18:19:07 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2010-08-09 18:06:44 -0400
commitb4ad35aafe32a65e1796bb64631732593f8ae914 (patch)
treec63d98e20678565badf166b5c56a3a8ad836fce1 /attrib/manager.c
parentfc558ffc2affae150df6566eb028f980ef5d5234 (diff)
downloadbluez-b4ad35aafe32a65e1796bb64631732593f8ae914.tar.gz
bluez-b4ad35aafe32a65e1796bb64631732593f8ae914.tar.xz
bluez-b4ad35aafe32a65e1796bb64631732593f8ae914.zip
Initial GATT server example integration
Initial changes to start the GATT server example. For the server side, attrib plugin will only register the GATT service record and add the attributes into the attribute database.
Diffstat (limited to 'attrib/manager.c')
-rw-r--r--attrib/manager.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/attrib/manager.c b/attrib/manager.c
index 41ab80ac..508b1270 100644
--- a/attrib/manager.c
+++ b/attrib/manager.c
@@ -34,6 +34,7 @@
#include "manager.h"
#include "client.h"
+#include "example.h"
#define GATT_UUID "00001801-0000-1000-8000-00805f9b34fb"
@@ -87,38 +88,28 @@ static struct btd_device_driver client_driver = {
.remove = client_remove,
};
-static int server_probe(struct btd_adapter *adapter)
-{
- return 0;
-}
-
-static void server_remove(struct btd_adapter *adapter)
-{
-}
-
-static struct btd_adapter_driver attrib_server_driver = {
- .name = "attribute-server",
- .probe = server_probe,
- .remove = server_remove,
-};
-
int attrib_manager_init(DBusConnection *conn)
{
connection = dbus_connection_ref(conn);
attrib_client_init(connection);
- btd_register_adapter_driver(&attrib_server_driver);
btd_register_device_driver(&client_driver);
- return 0;
+ /*
+ * FIXME: Add config file option to allow
+ * enable/disable the GATT server and client.
+ */
+
+ return server_example_init();
}
void attrib_manager_exit(void)
{
- btd_unregister_adapter_driver(&attrib_server_driver);
btd_unregister_device_driver(&client_driver);
+ server_example_exit();
attrib_client_exit();
+
dbus_connection_unref(connection);
}