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/07/12 18:23:27 UTC

[mynewt-newtmgr] branch master updated (d989b1e -> 9d39452)

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

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


    from d989b1e  nmxact - Don't stop listening for OMP on disc.
     new 103214f  nmxact - Rebuild dispatcher on sesn open.
     new 9d39452  newtmgr revendor

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 newtmgr/Godeps/Godeps.json                         | 48 +++++++++++-----------
 .../newtmgr/nmxact/nmble/ble_oic_sesn.go           |  9 +++-
 .../newtmgr/nmxact/nmserial/serial_oic_sesn.go     |  5 ++-
 .../newtmgr/nmxact/omp/dispatch.go                 | 16 ++++++--
 .../newtmgr/nmxact/udp/udp_oic_sesn.go             |  3 +-
 nmxact/nmble/ble_oic_sesn.go                       |  7 +++-
 nmxact/nmserial/serial_oic_sesn.go                 |  2 +-
 nmxact/udp/udp_oic_sesn.go                         |  2 +-
 8 files changed, 56 insertions(+), 36 deletions(-)

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

[mynewt-newtmgr] 01/02: nmxact - Rebuild dispatcher on sesn open.

Posted by cc...@apache.org.
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 103214fbece72a16504c3e0a80e67dd807176b11
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Jul 12 10:54:36 2017 -0700

    nmxact - Rebuild dispatcher on sesn open.
    
    Prior to this commit, the OIC dispatcher was getting built at
    sesn-construction-time.  This is a problem when a sesn gets reused
    (open, close, open), as the necessary listeners don't get re-added on
    subsequent opens.
---
 nmxact/nmble/ble_oic_sesn.go       | 7 +++++--
 nmxact/nmserial/serial_oic_sesn.go | 2 +-
 nmxact/udp/udp_oic_sesn.go         | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/nmxact/nmble/ble_oic_sesn.go b/nmxact/nmble/ble_oic_sesn.go
index 57551bc..2c0281c 100644
--- a/nmxact/nmble/ble_oic_sesn.go
+++ b/nmxact/nmble/ble_oic_sesn.go
@@ -28,7 +28,6 @@ type BleOicSesn struct {
 
 func NewBleOicSesn(bx *BleXport, cfg sesn.SesnCfg) *BleOicSesn {
 	bos := &BleOicSesn{
-		d:            omp.NewDispatcher(true, 3),
 		closeTimeout: cfg.Ble.CloseTimeout,
 		onCloseCb:    cfg.OnCloseCb,
 	}
@@ -120,7 +119,11 @@ func (bos *BleOicSesn) AbortRx(seq uint8) error {
 }
 
 func (bos *BleOicSesn) Open() error {
-	return bos.bf.Start()
+	if err := bos.bf.Start(); err != nil {
+		return err
+	}
+	bos.d = omp.NewDispatcher(true, 3)
+	return nil
 }
 
 func (bos *BleOicSesn) Close() error {
diff --git a/nmxact/nmserial/serial_oic_sesn.go b/nmxact/nmserial/serial_oic_sesn.go
index ce46371..b37abc1 100644
--- a/nmxact/nmserial/serial_oic_sesn.go
+++ b/nmxact/nmserial/serial_oic_sesn.go
@@ -27,7 +27,6 @@ type SerialOicSesn struct {
 func NewSerialOicSesn(sx *SerialXport) *SerialOicSesn {
 	return &SerialOicSesn{
 		sx: sx,
-		d:  omp.NewDispatcher(false, 3),
 	}
 }
 
@@ -40,6 +39,7 @@ func (sos *SerialOicSesn) Open() error {
 			"Attempt to open an already-open serial session")
 	}
 
+	sos.d = omp.NewDispatcher(false, 3)
 	sos.isOpen = true
 	return nil
 }
diff --git a/nmxact/udp/udp_oic_sesn.go b/nmxact/udp/udp_oic_sesn.go
index 1e840c2..3eb4996 100644
--- a/nmxact/udp/udp_oic_sesn.go
+++ b/nmxact/udp/udp_oic_sesn.go
@@ -23,7 +23,6 @@ type UdpOicSesn struct {
 func NewUdpOicSesn(cfg sesn.SesnCfg) *UdpOicSesn {
 	uos := &UdpOicSesn{
 		cfg: cfg,
-		d:   omp.NewDispatcher(false, 3),
 	}
 
 	return uos
@@ -43,6 +42,7 @@ func (uos *UdpOicSesn) Open() error {
 		return err
 	}
 
+	uos.d = omp.NewDispatcher(false, 3)
 	uos.addr = addr
 	uos.conn = conn
 	return nil

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

[mynewt-newtmgr] 02/02: newtmgr revendor

Posted by cc...@apache.org.
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 9d3945261b4a70efc4b385d09c389a4d57554f78
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Jul 12 10:55:56 2017 -0700

    newtmgr revendor
---
 newtmgr/Godeps/Godeps.json                         | 48 +++++++++++-----------
 .../newtmgr/nmxact/nmble/ble_oic_sesn.go           |  9 +++-
 .../newtmgr/nmxact/nmserial/serial_oic_sesn.go     |  5 ++-
 .../newtmgr/nmxact/omp/dispatch.go                 | 16 ++++++--
 .../newtmgr/nmxact/udp/udp_oic_sesn.go             |  3 +-
 5 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/newtmgr/Godeps/Godeps.json b/newtmgr/Godeps/Godeps.json
index 374bf44..bc53c6c 100644
--- a/newtmgr/Godeps/Godeps.json
+++ b/newtmgr/Godeps/Godeps.json
@@ -126,63 +126,63 @@
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/bledefs",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmble",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmp",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmserial",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmxutil",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/oic",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/omp",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/scan",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/sesn",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/udp",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/xact",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		},
 		{
 			"ImportPath": "mynewt.apache.org/newtmgr/nmxact/xport",
-			"Comment": "mynewt_0_9_0_tag-534-gf1ab4dc",
-			"Rev": "f1ab4dc7840b0882fa7f89ad8920d4ce24c4cd1f"
+			"Comment": "mynewt_0_9_0_tag-537-gd6e274c",
+			"Rev": "d6e274c9556a3c8975348df34752f00ac9fa5e09"
 		}
 	]
 }
diff --git a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/ble_oic_sesn.go b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/ble_oic_sesn.go
index ec866fb..2c0281c 100644
--- a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/ble_oic_sesn.go
+++ b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/ble_oic_sesn.go
@@ -28,7 +28,6 @@ type BleOicSesn struct {
 
 func NewBleOicSesn(bx *BleXport, cfg sesn.SesnCfg) *BleOicSesn {
 	bos := &BleOicSesn{
-		d:            omp.NewDispatcher(true, 3),
 		closeTimeout: cfg.Ble.CloseTimeout,
 		onCloseCb:    cfg.OnCloseCb,
 	}
@@ -120,7 +119,11 @@ func (bos *BleOicSesn) AbortRx(seq uint8) error {
 }
 
 func (bos *BleOicSesn) Open() error {
-	return bos.bf.Start()
+	if err := bos.bf.Start(); err != nil {
+		return err
+	}
+	bos.d = omp.NewDispatcher(true, 3)
+	return nil
 }
 
 func (bos *BleOicSesn) Close() error {
@@ -164,6 +167,8 @@ func (bos *BleOicSesn) onDisconnect(dt BleFsmDisconnectType, peer BleDev,
 		bos.closeChan <- err
 	}
 
+	bos.d.Stop()
+
 	bos.mtx.Unlock()
 
 	// Only execute client's disconnect callback if the disconnect was
diff --git a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmserial/serial_oic_sesn.go b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmserial/serial_oic_sesn.go
index d63b71b..b37abc1 100644
--- a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmserial/serial_oic_sesn.go
+++ b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmserial/serial_oic_sesn.go
@@ -27,7 +27,6 @@ type SerialOicSesn struct {
 func NewSerialOicSesn(sx *SerialXport) *SerialOicSesn {
 	return &SerialOicSesn{
 		sx: sx,
-		d:  omp.NewDispatcher(false, 3),
 	}
 }
 
@@ -40,6 +39,7 @@ func (sos *SerialOicSesn) Open() error {
 			"Attempt to open an already-open serial session")
 	}
 
+	sos.d = omp.NewDispatcher(false, 3)
 	sos.isOpen = true
 	return nil
 }
@@ -52,7 +52,10 @@ func (sos *SerialOicSesn) Close() error {
 		return nmxutil.NewSesnClosedError(
 			"Attempt to close an unopened serial session")
 	}
+
+	sos.d.Stop()
 	sos.isOpen = false
+
 	return nil
 }
 
diff --git a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go
index 17740f6..30b04ea 100644
--- a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go
+++ b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go
@@ -27,14 +27,16 @@ import (
 )
 
 type Dispatcher struct {
-	nmpd *nmp.Dispatcher
-	oicd *oic.Dispatcher
+	nmpd   *nmp.Dispatcher
+	oicd   *oic.Dispatcher
+	stopCh chan struct{}
 }
 
 func NewDispatcher(isTcp bool, logDepth int) *Dispatcher {
 	r := &Dispatcher{
-		nmpd: nmp.NewDispatcher(logDepth + 1),
-		oicd: oic.NewDispatcher(isTcp, logDepth+1),
+		nmpd:   nmp.NewDispatcher(logDepth + 1),
+		oicd:   oic.NewDispatcher(isTcp, logDepth+1),
+		stopCh: make(chan struct{}),
 	}
 
 	// Listen for OMP responses.  This should never fail.
@@ -68,6 +70,8 @@ func (r *Dispatcher) addOmpListener() error {
 
 			case err := <-ol.ErrChan:
 				log.Debugf("OIC error: %s", err.Error())
+
+			case <-r.stopCh:
 				return
 			}
 		}
@@ -76,6 +80,10 @@ func (r *Dispatcher) addOmpListener() error {
 	return nil
 }
 
+func (r *Dispatcher) Stop() {
+	r.stopCh <- struct{}{}
+}
+
 func (r *Dispatcher) Dispatch(data []byte) bool {
 	return r.oicd.Dispatch(data)
 }
diff --git a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/udp/udp_oic_sesn.go b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/udp/udp_oic_sesn.go
index 28c6fa5..3eb4996 100644
--- a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/udp/udp_oic_sesn.go
+++ b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/udp/udp_oic_sesn.go
@@ -23,7 +23,6 @@ type UdpOicSesn struct {
 func NewUdpOicSesn(cfg sesn.SesnCfg) *UdpOicSesn {
 	uos := &UdpOicSesn{
 		cfg: cfg,
-		d:   omp.NewDispatcher(false, 3),
 	}
 
 	return uos
@@ -43,6 +42,7 @@ func (uos *UdpOicSesn) Open() error {
 		return err
 	}
 
+	uos.d = omp.NewDispatcher(false, 3)
 	uos.addr = addr
 	uos.conn = conn
 	return nil
@@ -55,6 +55,7 @@ func (uos *UdpOicSesn) Close() error {
 	}
 
 	uos.conn.Close()
+	uos.d.Stop()
 	uos.conn = nil
 	uos.addr = nil
 	return nil

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