* [PATCH_v5 1/5] android/pan: shutdown io channel on disconnect call
@ 2013-12-19 8:48 Ravi kumar Veeramally
0 siblings, 0 replies; 2+ messages in thread
From: Ravi kumar Veeramally @ 2013-12-19 8:48 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
Shutdown io channel and send DISCONNECTING notification and send
DISCONNECTED notification and free the device on callback.
---
android/pan.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index b83f534..187953b 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -284,14 +284,16 @@ static void bt_pan_disconnect(const void *buf, uint16_t len)
}
dev = l->data;
- if (dev->watch) {
- g_source_remove(dev->watch);
- dev->watch = 0;
+
+ if (dev->io)
+ g_io_channel_shutdown(dev->io, TRUE, NULL);
+
+ if (dev->conn_state == HAL_PAN_STATE_CONNECTED) {
+ bnep_if_down(dev->iface);
+ bnep_conndel(&dst);
}
- bnep_if_down(dev->iface);
- bnep_conndel(&dst);
- bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
+ bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTING);
status = HAL_STATUS_SUCCESS;
failed:
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH_v5 1/5] android/pan: shutdown io channel on disconnect call
@ 2013-12-19 9:15 Ravi kumar Veeramally
0 siblings, 0 replies; 2+ messages in thread
From: Ravi kumar Veeramally @ 2013-12-19 9:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
Shutdown io channel and send DISCONNECTING notification and send
DISCONNECTED notification and free the device on callback.
---
android/pan.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index b83f534..187953b 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -284,14 +284,16 @@ static void bt_pan_disconnect(const void *buf, uint16_t len)
}
dev = l->data;
- if (dev->watch) {
- g_source_remove(dev->watch);
- dev->watch = 0;
+
+ if (dev->io)
+ g_io_channel_shutdown(dev->io, TRUE, NULL);
+
+ if (dev->conn_state == HAL_PAN_STATE_CONNECTED) {
+ bnep_if_down(dev->iface);
+ bnep_conndel(&dst);
}
- bnep_if_down(dev->iface);
- bnep_conndel(&dst);
- bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
+ bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTING);
status = HAL_STATUS_SUCCESS;
failed:
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-19 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 9:15 [PATCH_v5 1/5] android/pan: shutdown io channel on disconnect call Ravi kumar Veeramally
-- strict thread matches above, loose matches on Subject: below --
2013-12-19 8:48 Ravi kumar Veeramally
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).