summaryrefslogtreecommitdiff
path: root/android/hal-bluetooth.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-11-04 14:24:45 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-11-04 14:53:04 +0100
commitf91de769487803bad1915d178c6e2dec2eb2cf69 (patch)
tree9caa15a32c471539a3bb727e7e0c52eebfdd42ec /android/hal-bluetooth.c
parent2c4b8bde0fd0d6843bfb88399dccc32e0be85d7f (diff)
downloadbluez-f91de769487803bad1915d178c6e2dec2eb2cf69.tar.gz
android/hal-bluetooth: Add parameter to create_bond
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.
Diffstat (limited to 'android/hal-bluetooth.c')
-rw-r--r--android/hal-bluetooth.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 97440e291..f553eabcd 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -736,7 +736,7 @@ static int cancel_discovery(void)
NULL, NULL, NULL, NULL);
}
-static int create_bond(const bt_bdaddr_t *bd_addr)
+static int create_bond_real(const bt_bdaddr_t *bd_addr, int transport)
{
struct hal_cmd_create_bond cmd;
@@ -745,12 +745,26 @@ static int create_bond(const bt_bdaddr_t *bd_addr)
if (!interface_ready())
return BT_STATUS_NOT_READY;
+ cmd.transport = transport;
+
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CREATE_BOND,
sizeof(cmd), &cmd, NULL, NULL, NULL);
}
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static int create_bond(const bt_bdaddr_t *bd_addr, int transport)
+{
+ return create_bond_real(bd_addr, transport);
+}
+#else
+static int create_bond(const bt_bdaddr_t *bd_addr)
+{
+ return create_bond_real(bd_addr, BT_TRANSPORT_UNKNOWN);
+}
+#endif
+
static int cancel_bond(const bt_bdaddr_t *bd_addr)
{
struct hal_cmd_cancel_bond cmd;