mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sterl...@apache.org
Subject incubator-mynewt-newt git commit: encode echo request as json
Date Tue, 19 Jan 2016 18:03:01 GMT
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 <sterling@apache.org>
Authored: Tue Jan 19 10:02:46 2016 -0800
Committer: Sterling Hughes <sterling@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 {


Mime
View raw message