You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/01/19 19:03:01 UTC

incubator-mynewt-newt git commit: encode echo request as json

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/master ef2be9404 -> 4a29b380f


encode echo request as json


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/4a29b380
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/4a29b380
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/4a29b380

Branch: refs/heads/master
Commit: 4a29b380f6da98fd01f8cbc94f3dd707299964ae
Parents: ef2be94
Author: Sterling Hughes <st...@apache.org>
Authored: Tue Jan 19 10:02:46 2016 -0800
Committer: Sterling Hughes <st...@apache.org>
Committed: Tue Jan 19 10:02:55 2016 -0800

----------------------------------------------------------------------
 newtmgr/protocol/echo.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4a29b380/newtmgr/protocol/echo.go
----------------------------------------------------------------------
diff --git a/newtmgr/protocol/echo.go b/newtmgr/protocol/echo.go
index ae7075f..43c2527 100644
--- a/newtmgr/protocol/echo.go
+++ b/newtmgr/protocol/echo.go
@@ -30,7 +30,11 @@ func NewEcho() (*Echo, error) {
 }
 
 func (e *Echo) EncodeWriteRequest() (*NmgrReq, error) {
-	data := []byte(e.Message)
+	msg := "{\"d\": \""
+	msg += e.Message
+	msg += "\"}"
+
+	data := []byte(msg)
 
 	nmr, err := NewNmgrReq()
 	if err != nil {