mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 08:14:28 +08:00
gatt: Add stub for gatt.{c, h} files
These files implement functions to handle ATT transactions, and expose functions to allow other entities to manage GATT based services. It is a replacement for src/attrib-server.c.
This commit is contained in:
parent
7335f59aad
commit
9a642080f0
@ -146,6 +146,7 @@ src_bluetoothd_SOURCES = $(builtin_sources) \
|
||||
src/adapter.h src/adapter.c \
|
||||
src/profile.h src/profile.c \
|
||||
src/service.h src/service.c \
|
||||
src/gatt.h src/gatt.c \
|
||||
src/device.h src/device.c src/attio.h \
|
||||
src/dbus-common.c src/dbus-common.h \
|
||||
src/eir.h src/eir.c \
|
||||
|
38
src/gatt.c
Normal file
38
src/gatt.c
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gatt.h"
|
||||
|
||||
void gatt_init(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void gatt_cleanup(void)
|
||||
{
|
||||
|
||||
}
|
26
src/gatt.h
Normal file
26
src/gatt.h
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
void gatt_init(void);
|
||||
|
||||
void gatt_cleanup(void);
|
15
src/main.c
15
src/main.c
@ -55,6 +55,7 @@
|
||||
#include "dbus-common.h"
|
||||
#include "agent.h"
|
||||
#include "profile.h"
|
||||
#include "gatt.h"
|
||||
#include "systemd.h"
|
||||
|
||||
#define BLUEZ_NAME "org.bluez"
|
||||
@ -531,6 +532,13 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (option_experimental)
|
||||
gdbus_flags = G_DBUS_FLAG_ENABLE_EXPERIMENTAL;
|
||||
|
||||
g_dbus_set_flags(gdbus_flags);
|
||||
|
||||
gatt_init();
|
||||
|
||||
if (adapter_init() < 0) {
|
||||
error("Adapter handling initialization failed");
|
||||
exit(1);
|
||||
@ -540,11 +548,6 @@ int main(int argc, char *argv[])
|
||||
btd_agent_init();
|
||||
btd_profile_init();
|
||||
|
||||
if (option_experimental)
|
||||
gdbus_flags = G_DBUS_FLAG_ENABLE_EXPERIMENTAL;
|
||||
|
||||
g_dbus_set_flags(gdbus_flags);
|
||||
|
||||
if (option_compat == TRUE)
|
||||
sdp_flags |= SDP_SERVER_COMPAT;
|
||||
|
||||
@ -598,6 +601,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
adapter_cleanup();
|
||||
|
||||
gatt_cleanup();
|
||||
|
||||
rfkill_exit();
|
||||
|
||||
stop_sdp_server();
|
||||
|
Loading…
Reference in New Issue
Block a user