You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/10/26 22:41:00 UTC

[2/3] incubator-mynewt-core git commit: nmgr_os; cbor response to echo should be map, not array. Decoder array had wasted space. Remove it.

nmgr_os; cbor response to echo should be map, not array.
Decoder array had wasted space. Remove it.


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

Branch: refs/heads/develop
Commit: af30b5249735e4a9cacf25ef8d21059dc60c2b48
Parents: 912669d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Oct 26 15:38:03 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Oct 26 15:40:49 2016 -0700

----------------------------------------------------------------------
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/af30b524/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
----------------------------------------------------------------------
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index 5650382..c8cf343 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -84,7 +84,7 @@ nmgr_def_echo(struct mgmt_cbuf *cb)
     CborError g_err = CborNoError;
     CborEncoder rsp;
 
-    struct cbor_attr_t attrs[3] = {
+    struct cbor_attr_t attrs[2] = {
         [0] = {
             .attribute = "d",
             .type = CborAttrTextStringType,
@@ -97,7 +97,7 @@ nmgr_def_echo(struct mgmt_cbuf *cb)
         }
     };
 
-    g_err |= cbor_encoder_create_array(penc, &rsp, CborIndefiniteLength);
+    g_err |= cbor_encoder_create_map(penc, &rsp, CborIndefiniteLength);
     g_err |= cbor_encode_text_stringz(&rsp, "r");
     g_err |= cbor_read_object(&cb->it, attrs);
     g_err |= cbor_encode_text_string(&rsp, echo_buf, strlen(echo_buf));