Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 58308cc44 -> 1dc3d2c84


MYNEWT-569 Rename IMGMGR_NMGR_OP -> IMGMGR_NMGR_ID

IMGMGR_NMGR_OP was a misleading prefix.  These symbols defines newtmgr
IDs, not ops.  Newtmgr ops are read, write, etc.


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

Branch: refs/heads/develop
Commit: 7c2c84daf50d48cb0faf77e16b7a7014370b95fc
Parents: 58308cc
Author: Christopher Collins <[email protected]>
Authored: Thu Jan 26 18:15:46 2017 -0800
Committer: Christopher Collins <[email protected]>
Committed: Thu Jan 26 18:16:56 2017 -0800

----------------------------------------------------------------------
 boot/boot_serial/src/boot_serial.c                        |  4 ++--
 boot/boot_serial/src/boot_serial_priv.h                   |  5 ++---
 .../test/src/testcases/boot_serial_empty_img_msg.c        |  2 +-
 boot/boot_serial/test/src/testcases/boot_serial_img_msg.c |  2 +-
 .../test/src/testcases/boot_serial_upload_bigger_image.c  |  2 +-
 mgmt/imgmgr/include/imgmgr/imgmgr.h                       | 10 +++++-----
 mgmt/imgmgr/src/imgmgr.c                                  | 10 +++++-----
 7 files changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/boot/boot_serial/src/boot_serial.c
----------------------------------------------------------------------
diff --git a/boot/boot_serial/src/boot_serial.c 
b/boot/boot_serial/src/boot_serial.c
index ac935c1..c46e270 100644
--- a/boot/boot_serial/src/boot_serial.c
+++ b/boot/boot_serial/src/boot_serial.c
@@ -297,10 +297,10 @@ boot_serial_input(char *buf, int len)
      */
     if (hdr->nh_group == MGMT_GROUP_ID_IMAGE) {
         switch (hdr->nh_id) {
-        case IMGMGR_NMGR_OP_STATE:
+        case IMGMGR_NMGR_ID_STATE:
             bs_list(buf, len);
             break;
-        case IMGMGR_NMGR_OP_UPLOAD:
+        case IMGMGR_NMGR_ID_UPLOAD:
             bs_upload(buf, len);
             break;
         default:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/boot/boot_serial/src/boot_serial_priv.h
----------------------------------------------------------------------
diff --git a/boot/boot_serial/src/boot_serial_priv.h 
b/boot/boot_serial/src/boot_serial_priv.h
index 146aa6a..3888fdd 100644
--- a/boot/boot_serial/src/boot_serial_priv.h
+++ b/boot/boot_serial/src/boot_serial_priv.h
@@ -61,9 +61,8 @@ struct nmgr_hdr {
 /*
  * From imgmgr.h
  */
-#define IMGMGR_NMGR_OP_STATE            0
-#define IMGMGR_NMGR_OP_UPLOAD           1
-
+#define IMGMGR_NMGR_ID_STATE            0
+#define IMGMGR_NMGR_ID_UPLOAD           1
 
 void boot_serial_input(char *buf, int len);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/boot/boot_serial/test/src/testcases/boot_serial_empty_img_msg.c
----------------------------------------------------------------------
diff --git a/boot/boot_serial/test/src/testcases/boot_serial_empty_img_msg.c 
b/boot/boot_serial/test/src/testcases/boot_serial_empty_img_msg.c
index ff69324..a5e7174 100644
--- a/boot/boot_serial/test/src/testcases/boot_serial_empty_img_msg.c
+++ b/boot/boot_serial/test/src/testcases/boot_serial_empty_img_msg.c
@@ -27,7 +27,7 @@ TEST_CASE(boot_serial_empty_img_msg)
     memset(hdr, 0, sizeof(*hdr));
     hdr->nh_op = NMGR_OP_WRITE;
     hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE);
-    hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
+    hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD;
     hdr->nh_len = htons(2);
     strcpy((char *)(hdr + 1), "{}");
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/boot/boot_serial/test/src/testcases/boot_serial_img_msg.c
----------------------------------------------------------------------
diff --git a/boot/boot_serial/test/src/testcases/boot_serial_img_msg.c 
b/boot/boot_serial/test/src/testcases/boot_serial_img_msg.c
index c978650..a1aaf2f 100644
--- a/boot/boot_serial/test/src/testcases/boot_serial_img_msg.c
+++ b/boot/boot_serial/test/src/testcases/boot_serial_img_msg.c
@@ -50,7 +50,7 @@ TEST_CASE(boot_serial_img_msg)
     memset(hdr, 0, sizeof(*hdr));
     hdr->nh_op = NMGR_OP_WRITE;
     hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE);
-    hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
+    hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD;
 
     memcpy(hdr + 1, payload, sizeof payload);
     hdr->nh_len = htons(sizeof payload);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c
----------------------------------------------------------------------
diff --git 
a/boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c 
b/boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c
index 9f326b8..1f4aa09 100644
--- a/boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c
+++ b/boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c
@@ -83,7 +83,7 @@ TEST_CASE(boot_serial_upload_bigger_image)
         memset(hdr, 0, sizeof(*hdr));
         hdr->nh_op = NMGR_OP_WRITE;
         hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE);
-        hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
+        hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD;
 
         if (off) {
             memcpy(buf + payload_off, payload_next, sizeof payload_next);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/mgmt/imgmgr/include/imgmgr/imgmgr.h
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/include/imgmgr/imgmgr.h 
b/mgmt/imgmgr/include/imgmgr/imgmgr.h
index 8f95cf0..bae9a94 100644
--- a/mgmt/imgmgr/include/imgmgr/imgmgr.h
+++ b/mgmt/imgmgr/include/imgmgr/imgmgr.h
@@ -26,11 +26,11 @@
 extern "C" {
 #endif
 
-#define IMGMGR_NMGR_OP_STATE        0
-#define IMGMGR_NMGR_OP_UPLOAD       1
-#define IMGMGR_NMGR_OP_FILE         2
-#define IMGMGR_NMGR_OP_CORELIST     3
-#define IMGMGR_NMGR_OP_CORELOAD     4
+#define IMGMGR_NMGR_ID_STATE        0
+#define IMGMGR_NMGR_ID_UPLOAD       1
+#define IMGMGR_NMGR_ID_FILE         2
+#define IMGMGR_NMGR_ID_CORELIST     3
+#define IMGMGR_NMGR_ID_CORELOAD     4
 
 #define IMGMGR_NMGR_MAX_MSG         400
 #define IMGMGR_NMGR_MAX_NAME           64

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7c2c84da/mgmt/imgmgr/src/imgmgr.c
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/src/imgmgr.c b/mgmt/imgmgr/src/imgmgr.c
index 1ca37a0..8c1d2c9 100644
--- a/mgmt/imgmgr/src/imgmgr.c
+++ b/mgmt/imgmgr/src/imgmgr.c
@@ -37,15 +37,15 @@
 static int imgr_upload(struct mgmt_cbuf *);
 
 static const struct mgmt_handler imgr_nmgr_handlers[] = {
-    [IMGMGR_NMGR_OP_STATE] = {
+    [IMGMGR_NMGR_ID_STATE] = {
         .mh_read = imgmgr_state_read,
         .mh_write = imgmgr_state_write,
     },
-    [IMGMGR_NMGR_OP_UPLOAD] = {
+    [IMGMGR_NMGR_ID_UPLOAD] = {
         .mh_read = NULL,
         .mh_write = imgr_upload
     },
-    [IMGMGR_NMGR_OP_FILE] = {
+    [IMGMGR_NMGR_ID_FILE] = {
 #if MYNEWT_VAL(IMGMGR_FS)
         .mh_read = imgr_file_download,
         .mh_write = imgr_file_upload
@@ -54,7 +54,7 @@ static const struct mgmt_handler imgr_nmgr_handlers[] = {
         .mh_write = NULL
 #endif
     },
-    [IMGMGR_NMGR_OP_CORELIST] = {
+    [IMGMGR_NMGR_ID_CORELIST] = {
 #if MYNEWT_VAL(IMGMGR_COREDUMP)
         .mh_read = imgr_core_list,
         .mh_write = NULL
@@ -63,7 +63,7 @@ static const struct mgmt_handler imgr_nmgr_handlers[] = {
         .mh_write = NULL
 #endif
     },
-    [IMGMGR_NMGR_OP_CORELOAD] = {
+    [IMGMGR_NMGR_ID_CORELOAD] = {
 #if MYNEWT_VAL(IMGMGR_COREDUMP)
         .mh_read = imgr_core_load,
         .mh_write = imgr_core_erase,

Reply via email to