From 4830daffa20fb85a34aad0455b2566bfe9a7d031 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 9 Jan 2014 17:34:45 +0200 Subject: [PATCH] audio/A2DP: Add implemention of audio Suspend Stream command --- android/a2dp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/android/a2dp.c b/android/a2dp.c index fee8b81c2..05edd71a8 100644 --- a/android/a2dp.c +++ b/android/a2dp.c @@ -808,8 +808,29 @@ failed: static void bt_stream_suspend(const void *buf, uint16_t len) { - DBG("Not Implemented"); + const struct audio_cmd_suspend_stream *cmd = buf; + struct a2dp_setup *setup; + int err; + + DBG(""); + + setup = find_setup(cmd->id); + if (!setup) { + error("Unable to find stream for endpoint %u", cmd->id); + goto failed; + } + + err = avdtp_suspend(setup->dev->session, setup->stream); + if (err < 0) { + error("avdtp_suspend: %s", strerror(-err)); + goto failed; + } + audio_ipc_send_rsp(AUDIO_OP_SUSPEND_STREAM, AUDIO_STATUS_SUCCESS); + + return; + +failed: audio_ipc_send_rsp(AUDIO_OP_SUSPEND_STREAM, AUDIO_STATUS_FAILED); } -- 2.11.0