summaryrefslogtreecommitdiff
path: root/android/hal-handsfree.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-11-05 16:38:52 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-11-06 12:08:06 +0100
commit66231a25cad3c3f9635183c114e1e24b0c055dc5 (patch)
tree672fdf02c658aea979627f5c333e1dea8d5cfa81 /android/hal-handsfree.c
parent6c70b603360ddd938e6df2a660616ae6b61b9115 (diff)
downloadbluez-66231a25cad3c3f9635183c114e1e24b0c055dc5.tar.gz
android/handsfree: Add support for new API for at_response
at_response has new parameter bdaddr in new Android API.
Diffstat (limited to 'android/hal-handsfree.c')
-rw-r--r--android/hal-handsfree.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
index 294d1e95f..99485d6f3 100644
--- a/android/hal-handsfree.c
+++ b/android/hal-handsfree.c
@@ -595,7 +595,8 @@ static bt_status_t formatted_at_response(const char *rsp)
}
#endif
-static bt_status_t at_response(bthf_at_response_t response, int error)
+static bt_status_t at_response_real(bthf_at_response_t response, int error,
+ bt_bdaddr_t *bd_addr)
{
struct hal_cmd_handsfree_at_response cmd;
@@ -604,6 +605,11 @@ static bt_status_t at_response(bthf_at_response_t response, int error)
if (!interface_ready())
return BT_STATUS_NOT_READY;
+ if (bd_addr)
+ memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
+
+ memset(&cmd, 0, sizeof(cmd));
+
cmd.response = response;
cmd.error = error;
@@ -612,6 +618,19 @@ static bt_status_t at_response(bthf_at_response_t response, int error)
sizeof(cmd), &cmd, NULL, NULL, NULL);
}
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static bt_status_t at_response(bthf_at_response_t response, int error,
+ bt_bdaddr_t *bd_addr)
+{
+ return at_response_real(response, error, bd_addr);
+}
+#else
+static bt_status_t at_response(bthf_at_response_t response, int error)
+{
+ return at_response_real(response, error, NULL);
+}
+#endif
+
static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
bthf_call_state_t state,
bthf_call_mode_t mode,