From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCHv1 02/47] android/hal-bluetooth: Add parameter to create_bond
Date: Tue, 4 Nov 2014 10:18:25 +0200 [thread overview]
Message-ID: <1415089150-18798-3-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1415089150-18798-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add parameter to create_bond following new bluetooth.h HAL, transport is
defined in bluedroid include/bt_types.h. Bluetooth daemon shall check
transport parameter and make needed decisions, by default parameter is
unknown and this is the way bluedroid manage it itself.
---
android/hal-bluetooth.c | 13 +++++++++++++
android/hal-ipc-api.txt | 1 +
android/hal-msg.h | 5 +++++
3 files changed, 19 insertions(+)
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 97440e2..5b6e99d 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -736,7 +736,11 @@ static int cancel_discovery(void)
NULL, NULL, NULL, NULL);
}
+#if ANDROID_VERSION <= PLATFORM_VER(4, 4, 4)
static int create_bond(const bt_bdaddr_t *bd_addr)
+#else
+static int create_bond(const bt_bdaddr_t *bd_addr, int transport)
+#endif
{
struct hal_cmd_create_bond cmd;
@@ -745,6 +749,15 @@ static int create_bond(const bt_bdaddr_t *bd_addr)
if (!interface_ready())
return BT_STATUS_NOT_READY;
+#if ANDROID_VERSION > PLATFORM_VER(4, 4, 4)
+ if (transport < BT_TRANSPORT_UNKNOWN || transport > BT_TRANSPORT_LE)
+ return BT_STATUS_PARM_INVALID;
+
+ cmd.transport = transport;
+#else
+ cmd.transport = BT_TRANSPORT_UNKNOWN;
+#endif
+
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CREATE_BOND,
diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 6c647b7..3a3ae92 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -275,6 +275,7 @@ Commands and responses:
Opcode 0x0d - Create Bond command/response
Command parameters: Remote address (6 octets)
+ Transport (1 octet)
Response parameters: <none>
In case of an error, the error response will be returned.
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 12efcef..bcb73b2 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -190,9 +190,14 @@ struct hal_cmd_get_remote_services {
#define HAL_OP_CANCEL_DISCOVERY 0x0c
+#define BT_TRANSPORT_UNKNOWN 0x00
+#define BT_TRANSPORT_BR_EDR 0x01
+#define BT_TRANSPORT_LE 0x02
+
#define HAL_OP_CREATE_BOND 0x0d
struct hal_cmd_create_bond {
uint8_t bdaddr[6];
+ uint8_t transport;
} __attribute__((packed));
#define HAL_OP_REMOVE_BOND 0x0e
--
1.9.1
next prev parent reply other threads:[~2014-11-04 8:18 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 8:18 [PATCHv1 00/47] BlueZ support for Android 5.0 Lollipop Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 01/47] android: Set exact Android version Andrei Emeltchenko
2014-11-04 14:03 ` Szymon Janc
2014-11-04 8:18 ` Andrei Emeltchenko [this message]
2014-11-04 8:18 ` [PATCHv1 03/47] android/hal-bluetooth: Add missing functions Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 04/47] android/hal-audio: Add support for new Android API Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 05/47] android/hal-audio: Implement dummy Audio HAL functions Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 06/47] android/hal-sco: Add support for new Android API Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 07/47] android/hal-sco: Remove deprecated API usage Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 08/47] android/hal-sco: Implement dummy SCO HAL functions Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 09/47] android/hal-sco: Save bd_addr for output stream of Audio SCO HAL Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 10/47] android/hal-sco: Save bd_addr for input " Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 11/47] android/hal-sco: Add remote address parameter in Get SCO fd command Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 12/47] android/hal-sco: Use bdaddr " Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 13/47] android/gatt: Add support for new API Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 14/47] android/gatt: Add support for new parameter for connect Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 15/47] android/gatt: Add support for new parameter in srv connect() Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 16/47] android/client: Support new API for Audio HAL Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 17/47] android/client: Support new API for SCO HAL Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 18/47] android/client: Add new API argument for scan() Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 19/47] android/client: Add support for new Android API for PAN HAL Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 20/47] android/client: Add support for new GATT HAL API Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 21/47] android/client: Add new API support for handsfree client Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 22/47] android/handsfree: Add support for new API for handsfree init Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 23/47] android/handsfree: Add support for new API for start_vr Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 24/47] android/handsfree: Add support for new API for stop_vr Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 25/47] android/handsfree: Add support for new API for volume_control Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 26/47] android/handsfree: Add support for new API for cops_response Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 27/47] android/handsfree: Add support for new API for cind_response Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 28/47] android/handsfree: Add support for new API for formatted_at_response Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 29/47] android/handsfree: Add support for new API for at_response Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 30/47] android/handsfree: Add support for new API for clcc_response Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 31/47] android/handsfree: Add support for new API for vr_cmd_cb Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 32/47] android/handsfree: Add support for new API for handle_answer Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 33/47] android/handsfree: Add support for new API for hangup_call_cmd_cb Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 34/47] android/handsfree: Add support for new API for volume_cmd_cb Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 35/47] android/handsfree: Add support for new API for dial_call_cmd_cb Andrei Emeltchenko
2014-11-04 8:18 ` [PATCHv1 36/47] android/handsfree: Add support for new API for handle_dtmf Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 37/47] android/handsfree: Add support for new API for nrec_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 38/47] android/handsfree: Add support for new API for chld_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 39/47] android/handsfree: Add support for new API for cnum_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 40/47] android/handsfree: Add support for new API for cind_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 41/47] android/handsfree: Add support for new API for cops_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 42/47] android/handsfree: Add support for new API for clcc_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 43/47] android/handsfree: Add support for new API for unknown_at_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 44/47] android/handsfree: Add support for new API for key_pressed_cmd_cb Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 45/47] android/handsfree: Use bdaddr provided for find_device() Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 46/47] android/handsfree: Return default device for zero bdaddr Andrei Emeltchenko
2014-11-04 8:19 ` [PATCHv1 47/47] android/build: Disable declaration-after-statement warnings Andrei Emeltchenko
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=1415089150-18798-3-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