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/05/09 15:14:48 UTC
[05/13] incubator-mynewt-core git commit: newtmgr;
add sequence number to request header. Copy it to response.
newtmgr; add sequence number to request header. Copy it to response.
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/12e361da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/12e361da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/12e361da
Branch: refs/heads/develop
Commit: 12e361daff319c109fc1bdeb29a4df5d910d66d2
Parents: a975172
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue May 3 15:33:27 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon May 9 08:03:38 2016 -0700
----------------------------------------------------------------------
libs/newtmgr/include/newtmgr/newtmgr.h | 11 ++++++-----
libs/newtmgr/src/newtmgr.c | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/12e361da/libs/newtmgr/include/newtmgr/newtmgr.h
----------------------------------------------------------------------
diff --git a/libs/newtmgr/include/newtmgr/newtmgr.h b/libs/newtmgr/include/newtmgr/newtmgr.h
index 2dc461f..4a6c370 100644
--- a/libs/newtmgr/include/newtmgr/newtmgr.h
+++ b/libs/newtmgr/include/newtmgr/newtmgr.h
@@ -62,11 +62,12 @@
#define NMGR_ID_RESET 5
struct nmgr_hdr {
- uint8_t nh_op;
- uint8_t nh_flags;
- uint16_t nh_len;
- uint16_t nh_group;
- uint16_t nh_id;
+ uint8_t nh_op; /* NMGR_OP_XXX */
+ uint8_t nh_flags;
+ uint16_t nh_len; /* length of the payload */
+ uint16_t nh_group; /* NMGR_GROUP_XXX */
+ uint8_t nh_seq; /* sequence number */
+ uint8_t nh_id; /* message ID within group */
};
struct nmgr_jbuf {
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/12e361da/libs/newtmgr/src/newtmgr.c
----------------------------------------------------------------------
diff --git a/libs/newtmgr/src/newtmgr.c b/libs/newtmgr/src/newtmgr.c
index e1b1a7e..ee6066f 100644
--- a/libs/newtmgr/src/newtmgr.c
+++ b/libs/newtmgr/src/newtmgr.c
@@ -435,6 +435,7 @@ nmgr_handle_req(struct nmgr_transport *nt, struct os_mbuf *req)
rsp_hdr->nh_op = (hdr.nh_op == NMGR_OP_READ) ? NMGR_OP_READ_RSP :
NMGR_OP_WRITE_RSP;
rsp_hdr->nh_group = hdr.nh_group;
+ rsp_hdr->nh_seq = hdr.nh_seq;
rsp_hdr->nh_id = hdr.nh_id;
/*