mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 05:04:18 +08:00
GATT: Profile support for EnableGatt
Add support for the EnableGatt for all GATT profiles.
This commit is contained in:
parent
f47e7204b4
commit
afb04979ee
@ -28,6 +28,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "hcid.h"
|
||||
@ -37,8 +38,8 @@
|
||||
static int alert_init(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("Attribute server is disabled");
|
||||
return -1;
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return alert_server_init();
|
||||
|
@ -561,7 +561,7 @@ static struct btd_adapter_driver gatt_example_adapter_driver = {
|
||||
static int gatt_example_init(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("Attribute server is disabled");
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
@ -27,13 +27,14 @@
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
#include <gdbus.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "plugin.h"
|
||||
#include "manager.h"
|
||||
#include "hcid.h"
|
||||
|
||||
static DBusConnection *connection = NULL;
|
||||
static GKeyFile *config = NULL;
|
||||
@ -59,6 +60,10 @@ static GKeyFile *open_config_file(const char *file)
|
||||
|
||||
static int proximity_init(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
|
||||
if (connection == NULL)
|
||||
@ -76,6 +81,9 @@ static int proximity_init(void)
|
||||
|
||||
static void proximity_exit(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled)
|
||||
return;
|
||||
|
||||
if (config)
|
||||
g_key_file_free(config);
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <glib.h>
|
||||
#include <bluetooth/uuid.h>
|
||||
#include <adapter.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
@ -173,8 +174,8 @@ static void register_immediate_alert(struct btd_adapter *adapter)
|
||||
int reporter_init(struct btd_adapter *adapter)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("Attribute server is disabled");
|
||||
return -1;
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
DBG("Proximity Reporter for adapter %p", adapter);
|
||||
|
@ -62,6 +62,5 @@ NameResolving = true
|
||||
# that they were created for.
|
||||
DebugKeys = false
|
||||
|
||||
# Enable the GATT Attribute Server. Default is false, because it is only
|
||||
# useful for testing.
|
||||
AttributeServer = false
|
||||
# Enable the GATT functionality. Default is false
|
||||
EnableGatt = false
|
||||
|
@ -24,17 +24,25 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
#include <errno.h>
|
||||
#include <gdbus.h>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "manager.h"
|
||||
#include "hcid.h"
|
||||
#include "log.h"
|
||||
|
||||
static DBusConnection *connection = NULL;
|
||||
|
||||
static int thermometer_init(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
|
||||
if (connection == NULL)
|
||||
return -EIO;
|
||||
@ -49,6 +57,9 @@ static int thermometer_init(void)
|
||||
|
||||
static void thermometer_exit(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled)
|
||||
return;
|
||||
|
||||
thermometer_manager_exit();
|
||||
|
||||
dbus_connection_unref(connection);
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "hcid.h"
|
||||
@ -37,8 +38,8 @@
|
||||
static int time_init(void)
|
||||
{
|
||||
if (!main_opts.gatt_enabled) {
|
||||
DBG("Attribute server is disabled");
|
||||
return -1;
|
||||
DBG("GATT is disabled");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return time_server_init();
|
||||
|
Loading…
Reference in New Issue
Block a user