summaryrefslogtreecommitdiff
path: root/android/health.c
diff options
context:
space:
mode:
authorRavi kumar Veeramally <ravikumar.veeramally@linux.intel.com>2014-06-27 00:30:46 +0300
committerSzymon Janc <szymon.janc@tieto.com>2014-06-27 15:30:24 +0200
commit58088e30b75b07e8ff0c6a4754016ed6797e7fa7 (patch)
tree6a84a920e33cfb4f03f619864cb930c5808b9885 /android/health.c
parent8efc2021a22b07a06fe1737b2c273226b55e0183 (diff)
downloadbluez-58088e30b75b07e8ff0c6a4754016ed6797e7fa7.tar.gz
android/health: Implement destroy_channel call
Delete MDL channel with MDL_DELETE_REQ.
Diffstat (limited to 'android/health.c')
-rw-r--r--android/health.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/android/health.c b/android/health.c
index db3ae9c8e..e464f7833 100644
--- a/android/health.c
+++ b/android/health.c
@@ -1637,19 +1637,40 @@ fail:
HAL_OP_HEALTH_CONNECT_CHANNEL, HAL_STATUS_FAILED);
}
+static void channel_delete_cb(GError *gerr, gpointer data)
+{
+ struct health_channel *channel = data;
+
+ DBG("");
+
+ if (!gerr) {
+ error("health: channel delete failed %s", gerr->message);
+ return;
+ }
+
+ destroy_channel(channel);
+}
+
static void bt_health_destroy_channel(const void *buf, uint16_t len)
{
const struct hal_cmd_health_destroy_channel *cmd = buf;
struct health_channel *channel;
+ GError *gerr = NULL;
- DBG("Not Implemented");
+ DBG("");
channel = search_channel_by_id(cmd->channel_id);
if (!channel)
goto fail;
+ if (!mcap_delete_mdl(channel->mdl, channel_delete_cb, channel,
+ NULL, &gerr)) {
+ error("health: channel delete failed %s", gerr->message);
+ goto fail;
+ }
+
ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
- HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_UNSUPPORTED);
+ HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_SUCCESS);
return;