Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCHv3 04/11] android: sdp: Reuse BlueZ SDP server in Android
Date: Wed, 16 Oct 2013 17:08:41 +0300	[thread overview]
Message-ID: <1381932528-31584-5-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1381932528-31584-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

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 64f1a02..5dd359c 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"
@@ -267,10 +268,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


  parent reply	other threads:[~2013-10-16 14:08 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 10:36 [PATCHv1 0/5] Initial Android BlueZ patches Andrei Emeltchenko
2013-10-15 10:36 ` [PATCHv1 1/5] android: Create HAL API header skeleton Andrei Emeltchenko
2013-10-15 10:37 ` [PATCHv1 2/5] android: Add basic mgmt initialization sequence Andrei Emeltchenko
2013-10-15 10:37 ` [PATCHv1 3/5] android: Add adapter and device struct for BlueZ daemon Andrei Emeltchenko
2013-10-15 10:37 ` [PATCHv1 4/5] android: sdp: Reuse BlueZ SDP server in Android Andrei Emeltchenko
2013-10-15 10:37 ` [PATCHv1 5/5] android: Add cap to bind to port < 1024 Andrei Emeltchenko
2013-10-16  8:46 ` [PATCHv2 0/6] Android BlueZ patches, second chunk Andrei Emeltchenko
2013-10-16  8:46   ` [PATCHv2 1/6] sdp: Check that correct packet received in recv Andrei Emeltchenko
2013-10-16 10:21     ` Johan Hedberg
2013-10-16  8:46   ` [PATCHv2 2/6] android: Create HAL API header skeleton Andrei Emeltchenko
2013-10-16 10:23     ` Johan Hedberg
2013-10-16  8:46   ` [PATCHv2 3/6] android: Add basic mgmt initialization sequence Andrei Emeltchenko
2013-10-16 10:28     ` Johan Hedberg
2013-10-16 12:03     ` Szymon Janc
2013-10-16 12:24       ` Andrei Emeltchenko
2013-10-16  8:46   ` [PATCHv2 4/6] android: Add adapter and device struct for BlueZ daemon Andrei Emeltchenko
2013-10-16 10:31     ` Johan Hedberg
2013-10-16  8:46   ` [PATCHv2 5/6] android: sdp: Reuse BlueZ SDP server in Android Andrei Emeltchenko
2013-10-16  8:46   ` [PATCHv2 6/6] android: Add cap to bind to port < 1024 Andrei Emeltchenko
2013-10-16 14:08 ` [PATCHv3 00/11] Android BlueZ patches, second chunk Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 01/11] android: Create HAL API header skeleton Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 02/11] android: Add basic mgmt initialization sequence Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 03/11] android: Add adapter and device struct for BlueZ daemon Andrei Emeltchenko
2013-10-16 14:08   ` Andrei Emeltchenko [this message]
2013-10-16 14:08   ` [PATCHv3 05/11] android: Add cap to bind to port < 1024 Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 06/11] android: Implement read_info_complete callback Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 07/11] android: Use kernel style to initialize struct fields Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 08/11] android: Rename hal_bluetooth.c to hal-bluetooth.c Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 09/11] android: Rename hal_bt_sock.c to hal-bt-sock.c Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 10/11] android: Add HID Host skeleton Andrei Emeltchenko
2013-10-16 14:08   ` [PATCHv3 11/11] android: Add PAN skeleton Andrei Emeltchenko
2013-10-16 14:36 ` [PATCHv4 00/11] Android BlueZ patches, second chunk Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 01/11] android: Create HAL API header skeleton Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 02/11] android: Add basic mgmt initialization sequence Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 03/11] android: Add adapter and device struct for BlueZ daemon Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 04/11] android: sdp: Reuse BlueZ SDP server in Android Andrei Emeltchenko
2013-10-16 15:48     ` Johan Hedberg
2013-10-16 14:36   ` [PATCHv4 05/11] android: Add cap to bind to port < 1024 Andrei Emeltchenko
2013-10-16 15:44     ` Johan Hedberg
2013-10-16 14:36   ` [PATCHv4 06/11] android: Implement read_info_complete callback Andrei Emeltchenko
2013-10-16 15:47     ` Johan Hedberg
2013-10-16 14:36   ` [PATCHv4 07/11] android: Use kernel style to initialize struct fields Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 08/11] android: Rename hal_bluetooth.c to hal-bluetooth.c Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 09/11] android: Rename hal_bt_sock.c to hal-bt-sock.c Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 10/11] android: Add HID Host skeleton Andrei Emeltchenko
2013-10-16 14:36   ` [PATCHv4 11/11] android: Add PAN skeleton Andrei Emeltchenko
2013-10-17  8:26 ` [PATCHv5 0/7] Android BlueZ patches, second chunk Andrei Emeltchenko
2013-10-17  8:26   ` [PATCHv5 1/7] android: Add capabilities and set userid Andrei Emeltchenko
2013-10-17 11:20     ` Johan Hedberg
2013-10-17 11:26       ` Andrei Emeltchenko
2013-10-17  8:26   ` [PATCHv5 2/7] android: Implement read_info_complete callback Andrei Emeltchenko
2013-10-17 11:53     ` Johan Hedberg
2013-10-17  8:26   ` [PATCHv5 3/7] android: Use kernel style to initialize struct fields Andrei Emeltchenko
2013-10-17  9:04     ` Marcel Holtmann
2013-10-17  8:26   ` [PATCHv5 4/7] android: Rename hal_bluetooth.c to hal-bluetooth.c Andrei Emeltchenko
2013-10-17  8:26   ` [PATCHv5 5/7] android: Rename hal_bt_sock.c to hal-bt-sock.c Andrei Emeltchenko
2013-10-17  8:26   ` [PATCHv5 6/7] android: Add HID Host skeleton Andrei Emeltchenko
2013-10-17  8:26   ` [PATCHv5 7/7] android: Add PAN skeleton Andrei Emeltchenko
2013-10-18 11:36   ` [PATCHv5 0/7] Android BlueZ patches, second chunk Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381932528-31584-5-git-send-email-Andrei.Emeltchenko.news@gmail.com \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox