summaryrefslogtreecommitdiff
path: root/android/handsfree-client.c
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-11-19 10:43:46 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-11-19 15:07:32 +0100
commit3538980225a0599b49637c703cb92b4ffdb863c3 (patch)
tree12b07541d41b48302ce78335fb87025b4e0583da /android/handsfree-client.c
parentb7af523b1ace7af87797409a83e20fd50f154b29 (diff)
downloadbluez-3538980225a0599b49637c703cb92b4ffdb863c3.tar.gz
android/handsfree-client: Implement send DTMF codes
Diffstat (limited to 'android/handsfree-client.c')
-rw-r--r--android/handsfree-client.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/android/handsfree-client.c b/android/handsfree-client.c
index e104d8103..cfaf3da0f 100644
--- a/android/handsfree-client.c
+++ b/android/handsfree-client.c
@@ -672,9 +672,25 @@ done:
static void handle_send_dtmf(const void *buf, uint16_t len)
{
- DBG("Not Implemented");
+ const struct hal_cmd_hf_client_send_dtmf *cmd = buf;
+ struct device *dev;
+ uint8_t status;
+
+ dev = find_default_device();
+ if (!dev) {
+ status = HAL_STATUS_FAILED;
+ goto done;
+ }
+
+ if (hfp_hf_send_command(dev->hf, cmd_complete_cb, NULL, "AT+VTS=%c",
+ (char) cmd->tone))
+ status = HAL_STATUS_SUCCESS;
+ else
+ status = HAL_STATUS_FAILED;
+
+done:
ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE_CLIENT,
- HAL_OP_HF_CLIENT_SEND_DTMF, HAL_STATUS_UNSUPPORTED);
+ HAL_OP_HF_CLIENT_SEND_DTMF, status);
}
static void handle_get_last_vc_tag_num(const void *buf, uint16_t len)