aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2011-02-23 15:15:13 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-24 15:28:30 -0300
commit1847ffb1b66778558a06a3d6893cfa67cab33ce2 (patch)
treed03e8c54e434c3b73644878c65446c9c1df01440 /attrib/manager.c
parent941eb9973274a7b20411d3e70815c4e78b282ccd (diff)
downloadbluez-1847ffb1b66778558a06a3d6893cfa67cab33ce2.tar.gz
bluez-1847ffb1b66778558a06a3d6893cfa67cab33ce2.tar.xz
bluez-1847ffb1b66778558a06a3d6893cfa67cab33ce2.zip
Don't register GATT related SDP records if attrib server is disabled
GATT related SDP records should not be added if "AttributeServer" option is false in the configuration file. Problem happens only when attribute plugin is enabled.
Diffstat (limited to 'attrib/manager.c')
-rw-r--r--attrib/manager.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/attrib/manager.c b/attrib/manager.c
index f991f8ee..a5a7de43 100644
--- a/attrib/manager.c
+++ b/attrib/manager.c
@@ -32,6 +32,7 @@
#include "../src/adapter.h"
#include "../src/device.h"
+#include "hcid.h"
#include "manager.h"
#include "client.h"
@@ -84,19 +85,20 @@ int attrib_manager_init(DBusConnection *conn)
btd_register_device_driver(&client_driver);
- /*
- * FIXME: Add config file option to allow
- * enable/disable the GATT server and client.
- */
- return server_example_init();
+ if (main_opts.attrib_server)
+ return server_example_init();
+
+ return 0;
}
void attrib_manager_exit(void)
{
btd_unregister_device_driver(&client_driver);
- server_example_exit();
+ if (main_opts.attrib_server)
+ server_example_exit();
+
attrib_client_exit();
dbus_connection_unref(connection);