diff options
author | Lukasz Rymanowski <lukasz.rymanowski@tieto.com> | 2014-09-15 13:51:23 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-09-18 16:36:04 +0200 |
commit | 800b2b23a3a2f369ba5f2da5e077dce8dd2aa39c (patch) | |
tree | b471abd0e42567cd613c562ae20b64192d250182 /android/hal-handsfree-client.c | |
parent | 10c889fa80978f191640bab8151d53f20e63ce75 (diff) | |
download | bluez-800b2b23a3a2f369ba5f2da5e077dce8dd2aa39c.tar.gz |
android/handsfree-client: Add Dial and Dial Memory command
Diffstat (limited to 'android/hal-handsfree-client.c')
-rw-r--r-- | android/hal-handsfree-client.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/android/hal-handsfree-client.c b/android/hal-handsfree-client.c index 9a73931d8..23cbd539b 100644 --- a/android/hal-handsfree-client.c +++ b/android/hal-handsfree-client.c @@ -188,6 +188,47 @@ static bt_status_t volume_control(bthf_client_volume_type_t type, &cmd, NULL, NULL, NULL); } +static bt_status_t dial(const char *number) +{ + char buf[IPC_MTU]; + struct hal_cmd_hf_client_dial *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (number) { + cmd->number_len = strlen(number) + 1; + memcpy(cmd->number, number, cmd->number_len); + } else { + cmd->number_len = 0; + } + + len = sizeof(*cmd) + cmd->number_len; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT, + HAL_OP_HF_CLIENT_DIAL, len, cmd, NULL, NULL, + NULL); +} + +static bt_status_t dial_memory(int location) +{ + struct hal_cmd_hf_client_dial_memory cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.location = location; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT, + HAL_OP_HF_CLIENT_DIAL_MEMORY, + sizeof(cmd), &cmd, NULL, NULL, NULL); +} + static void cleanup(void) { struct hal_cmd_unregister_module cmd; @@ -217,6 +258,8 @@ static bthf_client_interface_t iface = { .start_voice_recognition = start_voice_recognition, .stop_voice_recognition = stop_voice_recognition, .volume_control = volume_control, + .dial = dial, + .dial_memory = dial_memory, .cleanup = cleanup }; |