From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH_v3 3/6] android/health: Notify channel status on channel destroy call
Date: Sun, 22 Jun 2014 14:58:58 +0300 [thread overview]
Message-ID: <1403438341-14321-4-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1403438341-14321-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/health.c | 64 ++++++++++++++++++++++++++++----------------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/android/health.c b/android/health.c
index a68f5e9..c68bf15 100644
--- a/android/health.c
+++ b/android/health.c
@@ -115,6 +115,37 @@ struct health_app {
struct queue *devices;
};
+static void send_app_reg_notify(struct health_app *app, uint8_t state)
+{
+ struct hal_ev_health_app_reg_state ev;
+
+ DBG("");
+
+ ev.id = app->id;
+ ev.state = state;
+
+ ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HEALTH,
+ HAL_EV_HEALTH_APP_REG_STATE, sizeof(ev), &ev);
+}
+
+static void send_channel_state_notify(struct health_channel *channel,
+ uint8_t state, int fd)
+{
+ struct hal_ev_health_channel_state ev;
+
+ DBG("");
+
+ bdaddr2android(&channel->dev->dst, ev.bdaddr);
+ ev.app_id = channel->dev->app_id;
+ ev.mdep_index = channel->mdep_id;
+ ev.channel_id = channel->id;
+ ev.channel_state = state;
+
+ ipc_send_notif_with_fd(hal_ipc, HAL_SERVICE_ID_HEALTH,
+ HAL_EV_HEALTH_CHANNEL_STATE,
+ sizeof(ev), &ev, fd);
+}
+
static void free_health_channel(void *data)
{
struct health_channel *channel = data;
@@ -132,7 +163,7 @@ static void destroy_channel(void *data)
if (!channel)
return;
- /* TODO: Notify channel connection status DESTROYED */
+ send_channel_state_notify(channel, HAL_HEALTH_CHANNEL_DESTROYED, -1);
queue_remove(channel->dev->channels, channel);
free_health_channel(channel);
}
@@ -187,37 +218,6 @@ static void free_health_app(void *data)
free(app);
}
-static void send_app_reg_notify(struct health_app *app, uint8_t state)
-{
- struct hal_ev_health_app_reg_state ev;
-
- DBG("");
-
- ev.id = app->id;
- ev.state = state;
-
- ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HEALTH,
- HAL_EV_HEALTH_APP_REG_STATE, sizeof(ev), &ev);
-}
-
-static void send_channel_state_notify(struct health_channel *channel,
- uint8_t state, int fd)
-{
- struct hal_ev_health_channel_state ev;
-
- DBG("");
-
- bdaddr2android(&channel->dev->dst, ev.bdaddr);
- ev.app_id = channel->dev->app_id;
- ev.mdep_index = channel->mdep_id;
- ev.channel_id = channel->id;
- ev.channel_state = state;
-
- ipc_send_notif_with_fd(hal_ipc, HAL_SERVICE_ID_HEALTH,
- HAL_EV_HEALTH_CHANNEL_STATE,
- sizeof(ev), &ev, fd);
-}
-
static bool dev_by_addr(const void *data, const void *user_data)
{
const struct health_device *dev = data;
--
1.9.1
next prev parent reply other threads:[~2014-06-22 11:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 11:58 [PATCH_v3 0/6] Initial implementation for MCAP data channel Ravi kumar Veeramally
2014-06-22 11:58 ` [PATCH_v3 1/6] android/health: Check if device and channel already exists or not Ravi kumar Veeramally
2014-06-22 11:58 ` [PATCH_v3 2/6] android/health: Cache remote mdep id on channel connect request Ravi kumar Veeramally
2014-06-22 11:58 ` Ravi kumar Veeramally [this message]
2014-06-22 11:58 ` [PATCH_v3 4/6] android/health: Create and connect MDL Ravi kumar Veeramally
2014-06-22 11:59 ` [PATCH_v3 5/6] android/health: Implement mcap_mdl_deleted_cb Ravi kumar Veeramally
2014-06-22 11:59 ` [PATCH_v3 6/6] anrdroid/client/health: Cache fd and close on channel disconnection Ravi kumar Veeramally
2014-06-23 9:15 ` [PATCH_v3 0/6] Initial implementation for MCAP data channel Szymon Janc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403438341-14321-4-git-send-email-ravikumar.veeramally@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox