diff --git a/android/hal-handsfree-client.c b/android/hal-handsfree-client.c
index 9a73931..23cbd53 100644
--- a/android/hal-handsfree-client.c
+++ b/android/hal-handsfree-client.c
&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;
.start_voice_recognition = start_voice_recognition,
.stop_voice_recognition = stop_voice_recognition,
.volume_control = volume_control,
+ .dial = dial,
+ .dial_memory = dial_memory,
.cleanup = cleanup
};
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 72e0def..1c57657 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
uint8_t volume;
} __attribute__((packed));
+#define HAL_OP_HF_CLIENT_DIAL 0x08
+struct hal_cmd_hf_client_dial {
+ uint16_t number_len;
+ uint8_t number[0];
+} __attribute__((packed));
+
+#define HAL_OP_HF_CLIENT_DIAL_MEMORY 0x09
+struct hal_cmd_hf_client_dial_memory {
+ int32_t location;
+} __attribute__((packed));
+
/* Notifications and confirmations */
#define HAL_POWER_OFF 0x00
diff --git a/android/handsfree-client.c b/android/handsfree-client.c
index f2394d0..d51ba86 100644
--- a/android/handsfree-client.c
+++ b/android/handsfree-client.c
HAL_STATUS_UNSUPPORTED);
}
+static void handle_dial(const void *buf, uint16_t len)
+{
+ DBG("Not Implemented");
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE_CLIENT,
+ HAL_OP_HF_CLIENT_DIAL, HAL_STATUS_UNSUPPORTED);
+}
+
+static void handle_dial_memory(const void *buf, uint16_t len)
+{
+ DBG("Not Implemented");
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE_CLIENT,
+ HAL_OP_HF_CLIENT_DIAL_MEMORY, HAL_STATUS_UNSUPPORTED);
+}
+
static const struct ipc_handler cmd_handlers[] = {
/* HAL_OP_HF_CLIENT_CONNECT */
{ handle_connect, false,
/* HAL_OP_HF_CLIENT_VOLUME_CONTROL */
{ handle_volume_control, false,
sizeof(struct hal_cmd_hf_client_volume_control) },
+ /* HAL_OP_HF_CLIENT_DIAL */
+ { handle_dial, true, sizeof(struct hal_cmd_hf_client_dial) },
+ /* HAL_OP_HF_CLIENT_DIAL_MEMORY */
+ { handle_dial_memory, false,
+ sizeof(struct hal_cmd_hf_client_dial_memory) },
};
bool bt_hf_client_register(struct ipc *ipc, const bdaddr_t *addr)