diff --git a/platforms/posix/src/Makefile.in b/platforms/posix/src/Makefile.in index 3af9230e8..59cf90cfb 100644 --- a/platforms/posix/src/Makefile.in +++ b/platforms/posix/src/Makefile.in @@ -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) \ diff --git a/platforms/posix/src/daemon.c b/platforms/posix/src/daemon.c index 0a68c8f44..bfa1a8db5 100644 --- a/platforms/posix/src/daemon.c +++ b/platforms/posix/src/daemon.c @@ -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 @@ -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