set up GATT Server with empty ATT database

This commit is contained in:
mila@ringwald.ch 2014-09-07 19:30:36 +00:00
parent 5b09aef38a
commit 92c41fe524
2 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,8 @@ BTdaemon_SOURCES = \
$(BTSTACK_ROOT)/src/sdp_query_util.c \
$(BTSTACK_ROOT)/ble/att_dispatch.c \
$(BTSTACK_ROOT)/ble/gatt_client.c \
$(BTSTACK_ROOT)/ble/att.c \
$(BTSTACK_ROOT)/ble/att_server.c \
$(BTSTACK_ROOT)/ble/sm.c \
$(BTSTACK_ROOT)/ble/central_device_db_memory.c \
$(usb_sources) \

View File

@ -72,7 +72,13 @@
#include "sdp_query_util.h"
#include "sdp_query_rfcomm.h"
#include "socket_connection.h"
#ifdef HAVE_BLE
#include "gatt_client.h"
#include "att_server.h"
#include "att.h"
#include "central_device_db.h"
#endif
#ifdef USE_BLUETOOL
#include <CoreFoundation/CoreFoundation.h>
@ -1543,8 +1549,14 @@ int main (int argc, char * const * argv){
#endif
#ifdef HAVE_BLE
// GATT Client
gatt_client_init();
gatt_client_register_packet_handler(&handle_gatt_client_event);
// GATT Server - empty attribute database
central_device_db_init();
att_server_init(NULL, NULL, NULL);
#endif
#ifdef USE_LAUNCHD