Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCHv2 4/6] android/client: Add new API argument for create_bond()
Date: Tue,  4 Nov 2014 14:24:48 +0200	[thread overview]
Message-ID: <1415103890-24375-5-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1415103890-24375-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

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

New Android API has new argument transport.
---
 android/client/if-bt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index 2d7ac79..a25d7bc 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -19,6 +19,7 @@
 
 #include "if-main.h"
 #include "terminal.h"
+#include "../hal-msg.h"
 #include "../hal-utils.h"
 
 const bt_interface_t *if_bluetooth;
@@ -609,11 +610,23 @@ static void cancel_discovery_p(int argc, const char **argv)
 static void create_bond_p(int argc, const char **argv)
 {
 	bt_bdaddr_t addr;
+#if ANDROID_VERSION > PLATFORM_VER(4, 4, 4)
+	int transport;
+#endif
 
 	RETURN_IF_NULL(if_bluetooth);
 	VERIFY_ADDR_ARG(2, &addr);
 
+#if ANDROID_VERSION > PLATFORM_VER(4, 4, 4)
+	if (argc < 3)
+		transport = BT_TRANSPORT_UNKNOWN;
+	else
+		transport = atoi(argv[3]);
+
+	EXEC(if_bluetooth->create_bond, &addr, transport);
+#else
 	EXEC(if_bluetooth->create_bond, &addr);
+#endif
 }
 
 /* Just addres to complete, use complete_addr_c */
-- 
1.9.1


  parent reply	other threads:[~2014-11-04 12:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 12:24 [PATCHv2 0/6] 1st serie of Android Lollipop BlueZ code Andrei Emeltchenko
2014-11-04 12:24 ` [PATCHv2 1/6] android/hal-bluetooth: Add parameter to create_bond Andrei Emeltchenko
2014-11-04 12:24 ` [PATCHv2 2/6] android/hardware: Update bluetooth.h header from Android 5.0 Andrei Emeltchenko
2014-11-04 12:24 ` [PATCHv2 3/6] android/hal-bluetooth: Add missing functions Andrei Emeltchenko
2014-11-04 12:24 ` Andrei Emeltchenko [this message]
2014-11-04 12:24 ` [PATCHv2 5/6] android/tester: Use dummy parameter in create_bond() Andrei Emeltchenko
2014-11-04 12:24 ` [PATCHv2 6/6] android/client: Add energy_info_callback print Andrei Emeltchenko
2014-11-04 14:03 ` [PATCHv2 0/6] 1st serie of Android Lollipop BlueZ code Szymon Janc

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=1415103890-24375-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