summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109>2009-01-05 09:35:50 +0000
committersamr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109>2009-01-05 09:35:50 +0000
commit9ac76264349a78631c0dfb4f1a0c48d7c9c58318 (patch)
tree83909c4ce6b7e5b3a7561b67fa38a6450018d80e
parent29c9219b80f70e88e5e1f70f3ed6a42b62ef9307 (diff)
downloadnohands-9ac76264349a78631c0dfb4f1a0c48d7c9c58318.tar.gz
Disable auto-reconnection when a device transitions to connected due
to a remotely initiated connection. git-svn-id: http://nohands.svn.sourceforge.net/svnroot/nohands/trunk@79 126591fb-c623-4b62-a76d-97a8e4f34109
-rw-r--r--libhfp/hfp.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libhfp/hfp.cpp b/libhfp/hfp.cpp
index 6a979c7..f74cd98 100644
--- a/libhfp/hfp.cpp
+++ b/libhfp/hfp.cpp
@@ -774,6 +774,16 @@ NotifyConnectionState(ErrorInfo *async_error)
if (!HfpHandshake(&local_error))
__Disconnect(&local_error, false);
+ /*
+ * We might need to disable autoreconnect for this
+ * device if the state change is the result of a
+ * remotely initiated connection.
+ */
+ if (!m_autoreconnect_links.Empty()) {
+ assert(m_conn_autoreconnect);
+ GetService()->RemoveAutoReconnect(this);
+ }
+
else if (IsConnectionRemoteInitiated() &&
cb_NotifyConnection.Registered())
cb_NotifyConnection(this, 0);