aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-12-09 15:00:25 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-09 15:00:25 -0800
commita345fd4f5204db63b590c5e993052952379426a8 (patch)
treeff6b95cdd708145917f6d013a9502083dc680436
parent355afe9a49d429650c955894220caebc1db3b1cf (diff)
parentd05887c3d5d498610529d86a6c02d25385d5250e (diff)
downloadbluez-a345fd4f5204db63b590c5e993052952379426a8.tar.gz
-rw-r--r--health/hdp.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/health/hdp.c b/health/hdp.c
index df388bc8..943e7135 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -479,8 +479,22 @@ static void hdp_tmp_dc_data_destroy(gpointer data)
static void abort_mdl_cb(GError *err, gpointer data)
{
+ struct hdp_device *dev;
+ struct hdp_channel *hdp_chan = data;
if (err)
error("Aborting error: %s", err->message);
+
+ if (hdp_chan) {
+ dev = hdp_chan->dev;
+ if (dev && hdp_chan->mdep != HDP_MDEP_ECHO)
+ g_dbus_emit_signal(dev->conn,
+ device_get_path(dev->dev),
+ HEALTH_DEVICE,
+ "ChannelConnected",
+ DBUS_TYPE_OBJECT_PATH,
+ &hdp_chan->path,
+ DBUS_TYPE_INVALID);
+ }
}
static void hdp_mdl_reconn_cb(struct mcap_mdl *mdl, GError *err, gpointer data)
@@ -1646,7 +1660,7 @@ static void hdp_mdl_conn_cb(struct mcap_mdl *mdl, GError *err, gpointer data)
/* Send abort request because remote side */
/* is now in PENDING state */
- if (!mcap_mdl_abort(hdp_chann->mdl, abort_mdl_cb, NULL,
+ if (!mcap_mdl_abort(hdp_chann->mdl, abort_mdl_cb, hdp_chann,
NULL, &gerr)) {
error("%s", gerr->message);
g_error_free(gerr);
@@ -1669,6 +1683,15 @@ static void hdp_mdl_conn_cb(struct mcap_mdl *mdl, GError *err, gpointer data)
dev->fr = hdp_channel_ref(hdp_chann);
+ if (dev->fr->mdep != HDP_MDEP_ECHO)
+ g_dbus_emit_signal(dev->conn,
+ device_get_path(dev->dev),
+ HEALTH_DEVICE,
+ "ChannelConnected",
+ DBUS_TYPE_OBJECT_PATH, &dev->fr->path,
+ DBUS_TYPE_INVALID);
+
+
emit_property_changed(dev->conn, device_get_path(dev->dev),
HEALTH_DEVICE, "MainChannel",
DBUS_TYPE_OBJECT_PATH, &dev->fr->path);
@@ -1713,14 +1736,6 @@ static void device_create_mdl_cb(struct mcap_mdl *mdl, uint8_t conf,
if (!hdp_chan)
goto fail;
- if (user_data->mdep != HDP_MDEP_ECHO)
- g_dbus_emit_signal(user_data->conn,
- device_get_path(hdp_chan->dev->dev),
- HEALTH_DEVICE,
- "ChannelConnected",
- DBUS_TYPE_OBJECT_PATH, &hdp_chan->path,
- DBUS_TYPE_INVALID);
-
hdp_conn = g_new0(struct hdp_tmp_dc_data, 1);
hdp_conn->msg = dbus_message_ref(user_data->msg);
hdp_conn->conn = dbus_connection_ref(user_data->conn);
@@ -1743,7 +1758,7 @@ static void device_create_mdl_cb(struct mcap_mdl *mdl, uint8_t conf,
hdp_tmp_dc_data_unref(hdp_conn);
/* Send abort request because remote side is now in PENDING state */
- if (!mcap_mdl_abort(mdl, abort_mdl_cb, NULL, NULL, &gerr)) {
+ if (!mcap_mdl_abort(mdl, abort_mdl_cb, hdp_chan, NULL, &gerr)) {
error("%s", gerr->message);
g_error_free(gerr);
}