From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> Reuse existing SDP server code in Android GPL daemon. --- Makefile.android | 4 +++- android/Android.mk | 8 ++++++++ android/main.c | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile.android b/Makefile.android index ab328a9..4d7da39 100644 --- a/Makefile.android +++ b/Makefile.android @@ -4,10 +4,12 @@ noinst_PROGRAMS += android/bluetoothd android_bluetoothd_SOURCES = android/main.c \ src/log.c \ android/hal-msg.h \ + src/sdpd-database.c src/sdpd-server.c \ + src/sdpd-service.c src/sdpd-request.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c -android_bluetoothd_LDADD = @GLIB_LIBS@ +android_bluetoothd_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ endif EXTRA_DIST += android/Android.mk android/log.c diff --git a/android/Android.mk b/android/Android.mk index 4996080..560fb0a 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -17,6 +17,13 @@ LOCAL_SRC_FILES := \ log.c \ ../src/shared/mgmt.c \ ../src/shared/util.c \ + ../src/sdpd-database.c \ + ../src/sdpd-service.c \ + ../src/sdpd-request.c \ + ../src/sdpd-server.c \ + ../lib/sdp.c \ + ../lib/bluetooth.c \ + ../lib/hci.c \ LOCAL_C_INCLUDES := \ $(call include-path-for, glib) \ @@ -25,6 +32,7 @@ LOCAL_C_INCLUDES := \ LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/../ \ $(LOCAL_PATH)/../src \ + $(LOCAL_PATH)/../lib \ LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" diff --git a/android/main.c b/android/main.c index 512bfd9..3a20148 100644 --- a/android/main.c +++ b/android/main.c @@ -36,6 +36,7 @@ #include <glib.h> #include "log.h" +#include "src/sdpd.h" #include "lib/bluetooth.h" #include "lib/mgmt.h" @@ -265,10 +266,14 @@ int main(int argc, char *argv[]) if (!init_mgmt_interface()) return EXIT_FAILURE; + /* Use params: mtu = 0, flags = 0 */ + start_sdp_server(0, 0); + DBG("Entering main loop"); g_main_loop_run(event_loop); + stop_sdp_server(); cleanup_mgmt_interface(); g_main_loop_unref(event_loop); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html