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:23 UTC
[mynewt-newtmgr] branch master updated (b90bb97 -> b4c69b4)
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 b90bb97 Merge pull request #20 from ccollins476ad/post-delete
new 1097582 nmxact - Always shut down BLE session on conn fail.
new 985ad4b newtmgr - Fix resource GET output.
new b4c69b4 newtmgr - revendor
The 3 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 | 56 +++++++++++-----------
newtmgr/cli/res.go | 34 ++++++++++---
.../mynewt.apache.org/newtmgr/nmxact/nmble/conn.go | 7 +--
nmxact/nmble/conn.go | 7 +--
4 files changed, 63 insertions(+), 41 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" <co...@mynewt.apache.org>'].
[mynewt-newtmgr] 02/03: newtmgr - Fix resource GET output.
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 985ad4bfc91242af4dd425df91dfa27bfc4f030e
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Aug 17 11:26:17 2017 -0700
newtmgr - Fix resource GET output.
---
newtmgr/cli/res.go | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/newtmgr/cli/res.go b/newtmgr/cli/res.go
index 560b30c..0e1c771 100644
--- a/newtmgr/cli/res.go
+++ b/newtmgr/cli/res.go
@@ -34,6 +34,30 @@ import (
"mynewt.apache.org/newtmgr/nmxact/xact"
)
+func indent(s string, numSpaces int) string {
+ b := make([]byte, numSpaces)
+ for i, _ := range b {
+ b[i] = ' '
+ }
+ tab := string(b)
+
+ nltab := "\n" + tab
+ return tab + strings.Replace(s, "\n", nltab, -1)
+}
+
+func cborValStr(itf interface{}) string {
+ switch v := itf.(type) {
+ case string:
+ return v
+
+ case []byte:
+ return hex.Dump(v)
+
+ default:
+ return fmt.Sprintf("%#v", v)
+ }
+}
+
func extractResKv(params []string) (map[string]interface{}, error) {
m := map[string]interface{}{}
@@ -76,17 +100,13 @@ func resGetRunCmd(s sesn.Sesn, resType sesn.ResourceType, uri string) {
valstr = hex.Dump(sres.Value)
} else if len(m) == 0 {
valstr = "<empty>"
- } else if len(m) == 1 {
- for k, v := range m {
- valstr = fmt.Sprintf("%s=%+v", k, v)
- }
} else {
for k, v := range m {
- valstr += fmt.Sprintf("\n %s=%+v", k, v)
+ valstr += fmt.Sprintf("\n %s\n%s", k, indent(cborValStr(v), 8))
}
}
- fmt.Printf("%s: %s\n", uri, valstr)
+ fmt.Printf("%s%s\n", uri, valstr)
}
func resPutRunCmd(s sesn.Sesn, resType sesn.ResourceType, uri string,
@@ -150,7 +170,7 @@ func resRunCmd(cmd *cobra.Command, args []string) {
}
func resCmd() *cobra.Command {
- resEx := " newtmgr -c olimex res public mynewt.value.0\n"
+ resEx := " newtmgr -c olimex res public /dev\n"
resCmd := &cobra.Command{
Use: "res <type> <uri> [k=v] [k=v] [...]",
--
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" <co...@mynewt.apache.org>.
[mynewt-newtmgr] 03/03: 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 b4c69b4ba738841bc6c151d9fa7180ce53a41823
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Aug 17 11:10:31 2017 -0700
newtmgr - revendor
---
newtmgr/Godeps/Godeps.json | 56 +++++++++++-----------
.../mynewt.apache.org/newtmgr/nmxact/nmble/conn.go | 7 +--
2 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/newtmgr/Godeps/Godeps.json b/newtmgr/Godeps/Godeps.json
index a89c32f..9f98425 100644
--- a/newtmgr/Godeps/Godeps.json
+++ b/newtmgr/Godeps/Godeps.json
@@ -127,73 +127,73 @@
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/adv",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/bledefs",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/mgmt",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmble",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmp",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmserial",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/nmxutil",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/oic",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/omp",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/scan",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/sesn",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/udp",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/xact",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
},
{
"ImportPath": "mynewt.apache.org/newtmgr/nmxact/xport",
- "Comment": "mynewt_1_1_0_tag-49-gb63b64f",
- "Rev": "b63b64f3309a11f8ca79abddfaed914f4d41bbb0"
+ "Comment": "mynewt_1_1_0_tag-50-g9bffc58",
+ "Rev": "9bffc58e20c9c5ca399d83899db51a8e7caffd29"
}
]
}
diff --git a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/conn.go b/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/conn.go
index c2e8bcd..5912d3d 100644
--- a/newtmgr/vendor/mynewt.apache.org/newtmgr/nmxact/nmble/conn.go
+++ b/newtmgr/vendor/mynewt.apache.org/newtmgr/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>.
[mynewt-newtmgr] 01/03: nmxact - Always shut down BLE session on
conn fail.
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 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>.