You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2017/03/24 23:15:48 UTC

[26/50] [abbrv] incubator-mynewt-core git commit: MYNEWT-677 NMP: Include next_index in log show rsp

MYNEWT-677 NMP: Include next_index in log show rsp

The next_index value (index of next log entry to be written) is useful
for determining if a device's flash has been wiped since the last time
logs were scoured.

The new value is at the top-level of the log show response with the
following name: next_index.


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

Branch: refs/heads/nrf_cputime
Commit: d7a9e96a9f17270d371ce421697c4407b1647bf4
Parents: f23fbe7
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Mar 17 12:51:11 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Fri Mar 17 12:51:11 2017 -0700

----------------------------------------------------------------------
 sys/log/full/src/log_nmgr.c | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d7a9e96a/sys/log/full/src/log_nmgr.c
----------------------------------------------------------------------
diff --git a/sys/log/full/src/log_nmgr.c b/sys/log/full/src/log_nmgr.c
index 00beeba..8615fb7 100644
--- a/sys/log/full/src/log_nmgr.c
+++ b/sys/log/full/src/log_nmgr.c
@@ -279,6 +279,8 @@ log_nmgr_read(struct mgmt_cbuf *cb)
         return rc;
     }
 
+    g_err |= cbor_encode_text_stringz(&cb->encoder, "next_index");
+    g_err |= cbor_encode_int(&cb->encoder, g_log_info.li_next_index);
 
     g_err |= cbor_encode_text_stringz(&cb->encoder, "logs");
     g_err |= cbor_encoder_create_array(&cb->encoder, &logs,