From 5a5158bb0f3516f31790c22a5979a47b90bdb3f9 Mon Sep 17 00:00:00 2001 From: Grzegorz Kolodziejczyk Date: Fri, 25 Oct 2013 17:52:07 +0200 Subject: [PATCH] android/hal: Add support for send av disconnect command This allows HAL to send av disconnect command --- android/hal-av.c | 8 +++++--- android/hal-msg.h | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/android/hal-av.c b/android/hal-av.c index 6b04f87dd..dee65b5f7 100644 --- a/android/hal-av.c +++ b/android/hal-av.c @@ -84,15 +84,17 @@ static bt_status_t av_connect(bt_bdaddr_t *bd_addr) static bt_status_t av_disconnect(bt_bdaddr_t *bd_addr) { + struct hal_op_av_disconnect cmd; + DBG(""); if (!interface_ready()) return BT_STATUS_NOT_READY; - if (!bd_addr) - return BT_STATUS_PARM_INVALID; + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); - return BT_STATUS_UNSUPPORTED; + return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_AV_DISCONNECT, + sizeof(cmd), &cmd, NULL, NULL, NULL); } static bt_status_t av_init(btav_callbacks_t *callbacks) diff --git a/android/hal-msg.h b/android/hal-msg.h index d55676213..55c560c21 100644 --- a/android/hal-msg.h +++ b/android/hal-msg.h @@ -285,6 +285,11 @@ struct hal_op_av_connect { uint8_t bdaddr[6]; } __attribute__((packed)); +#define HAL_OP_AV_DISCONNECT 0x02 +struct hal_op_av_disconnect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + /* Notifications and confirmations */ -- 2.47.3