mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject incubator-mynewt-newt git commit: newtmgr; filter out echoed requests when doing oic over serial.
Date Wed, 26 Oct 2016 23:22:06 GMT
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 2ac611b62 -> afae040cd


newtmgr; filter out echoed requests when doing oic over serial.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/afae040c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/afae040c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/afae040c

Branch: refs/heads/develop
Commit: afae040cdffb632b34b422ec7d2f4a04c9ab5f62
Parents: 2ac611b
Author: Marko Kiiskila <marko@runtime.io>
Authored: Wed Oct 26 16:21:27 2016 -0700
Committer: Marko Kiiskila <marko@runtime.io>
Committed: Wed Oct 26 16:21:27 2016 -0700

----------------------------------------------------------------------
 newtmgr/protocol/cmdrunner.go | 3 +++
 newtmgr/protocol/omgr.go      | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/afae040c/newtmgr/protocol/cmdrunner.go
----------------------------------------------------------------------
diff --git a/newtmgr/protocol/cmdrunner.go b/newtmgr/protocol/cmdrunner.go
index 7ec3d56..0c2a151 100644
--- a/newtmgr/protocol/cmdrunner.go
+++ b/newtmgr/protocol/cmdrunner.go
@@ -51,6 +51,9 @@ func (cr *CmdRunner) ReadResp() (*NmgrReq, error) {
 		if err != nil {
 			return nil, err
 		}
+		if nmrfrag == nil {
+			continue
+		}
 		if nmrfrag.Op == NMGR_OP_READ_RSP || nmrfrag.Op == NMGR_OP_WRITE_RSP {
 			nmr.Data = append(nmr.Data, nmrfrag.Data...)
 			nmr.Len += nmrfrag.Len

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/afae040c/newtmgr/protocol/omgr.go
----------------------------------------------------------------------
diff --git a/newtmgr/protocol/omgr.go b/newtmgr/protocol/omgr.go
index 29bff4c..b417546 100644
--- a/newtmgr/protocol/omgr.go
+++ b/newtmgr/protocol/omgr.go
@@ -46,6 +46,9 @@ func DeserializeOmgrReq(data []byte) (*NmgrReq, error) {
 		return nil, util.NewNewtError(fmt.Sprintf(
 			"Oicmgr request invalid %s", err.Error()))
 	}
+	if req.Code == coap.GET || req.Code == coap.PUT {
+		return nil, nil
+	}
 	if req.Code != coap.Created && req.Code != coap.Deleted &&
 		req.Code != coap.Valid && req.Code != coap.Changed &&
 		req.Code != coap.Content {


Mime
View raw message