Repository: incubator-mynewt-newtmgr Updated Branches: refs/heads/master 0f1365665 -> 6c9269d72
nmxact - ble_dual example: open+close on each tx. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/commit/744cb38f Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/tree/744cb38f Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/diff/744cb38f Branch: refs/heads/master Commit: 744cb38f1121ce3d777016cf69ee7f7d692dadea Parents: 0f13656 Author: Christopher Collins <ccoll...@apache.org> Authored: Sun Apr 9 14:25:55 2017 -0700 Committer: Christopher Collins <ccoll...@apache.org> Committed: Sun Apr 9 14:25:55 2017 -0700 ---------------------------------------------------------------------- nmxact/example/ble_dual/ble_dual.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/blob/744cb38f/nmxact/example/ble_dual/ble_dual.go ---------------------------------------------------------------------- diff --git a/nmxact/example/ble_dual/ble_dual.go b/nmxact/example/ble_dual/ble_dual.go index a0167c3..a69b8d5 100644 --- a/nmxact/example/ble_dual/ble_dual.go +++ b/nmxact/example/ble_dual/ble_dual.go @@ -21,12 +21,10 @@ package main import ( "fmt" - "math/rand" "os" "os/signal" "sync" "syscall" - "time" "mynewt.apache.org/newt/util" "mynewt.apache.org/newtmgr/nmxact/bledefs" @@ -96,6 +94,8 @@ func sendOne(s sesn.Sesn) { eres := res.(*xact.EchoResult) fmt.Printf("Peer echoed back: %s\n", eres.Rsp.Payload) + + s.Close() } func main() { @@ -153,17 +153,13 @@ func main() { go func() { for { sendOne(s1) - time.Sleep(time.Duration(rand.Uint32()%100) * time.Millisecond) } }() wg.Add(1) - //time.Sleep(2 * time.Second) - go func() { for { sendOne(s2) - time.Sleep(time.Duration(rand.Uint32()%100) * time.Millisecond) } }()