You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/08/17 18:27:24 UTC

[mynewt-newtmgr] 01/03: nmxact - Always shut down BLE session on conn fail.

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git

commit 109758260c7c63402546a8766769514c9ea9a78c
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Aug 17 11:20:15 2017 -0700

    nmxact - Always shut down BLE session on conn fail.
---
 nmxact/nmble/conn.go | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nmxact/nmble/conn.go b/nmxact/nmble/conn.go
index c2e8bcd..5912d3d 100644
--- a/nmxact/nmble/conn.go
+++ b/nmxact/nmble/conn.go
@@ -101,7 +101,6 @@ func (c *Conn) shutdown(err error) {
 	if !c.initiateShutdown() {
 		return
 	}
-	defer func() { c.stopped = false }()
 
 	c.connecting = false
 	c.connHandle = BLE_CONN_HANDLE_NONE
@@ -755,8 +754,10 @@ func (c *Conn) Stop() error {
 		if err := c.terminate(); err != nil {
 			go c.shutdown(err)
 		}
-	} else if c.connecting {
-		c.connCancel()
+	} else {
+		if c.connecting {
+			c.connCancel()
+		}
 		go c.shutdown(fmt.Errorf("Stopped"))
 	}
 

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" <co...@mynewt.apache.org>.