[4/5] incubator-mynewt-core git commit: oic; start oic task if one of the transports initializes ok.

2016-10-28 Thread marko
oic; start oic task if one of the transports initializes ok.


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

Branch: refs/heads/develop
Commit: 262f8b2dee9f275f5b2da4a082a34c69d89038b5
Parents: a7400e7
Author: Marko Kiiskila 
Authored: Fri Oct 28 15:40:12 2016 -0700
Committer: Marko Kiiskila 
Committed: Fri Oct 28 15:41:31 2016 -0700

--
 net/oic/src/port/mynewt/adaptor.c | 52 --
 1 file changed, 24 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/262f8b2d/net/oic/src/port/mynewt/adaptor.c
--
diff --git a/net/oic/src/port/mynewt/adaptor.c 
b/net/oic/src/port/mynewt/adaptor.c
index b61ba02..e4b1cd6 100644
--- a/net/oic/src/port/mynewt/adaptor.c
+++ b/net/oic/src/port/mynewt/adaptor.c
@@ -61,28 +61,27 @@ struct os_task oc_task;
 os_stack_t *oc_stack;
 
 void
-oc_send_buffer(oc_message_t *message) {
-
-switch (message->endpoint.flags)
-{
+oc_send_buffer(oc_message_t *message)
+{
+switch (message->endpoint.flags) {
 #if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1)
-case IP:
-oc_send_buffer_ip(message);
-break;
+case IP:
+oc_send_buffer_ip(message);
+break;
 #endif
 #if (MYNEWT_VAL(OC_TRANSPORT_GATT) == 1)
-case GATT:
-oc_send_buffer_gatt(message);
-break;
+case GATT:
+oc_send_buffer_gatt(message);
+break;
 #endif
 #if (MYNEWT_VAL(OC_TRANSPORT_SERIAL) == 1)
-case SERIAL:
-oc_send_buffer_serial(message);
-break;
+case SERIAL:
+oc_send_buffer_serial(message);
+break;
 #endif
-default:
-ERROR("Unknown transport option %u\n", message->endpoint.flags);
-oc_message_unref(message);
+default:
+ERROR("Unknown transport option %u\n", message->endpoint.flags);
+oc_message_unref(message);
 }
 }
 
@@ -153,7 +152,8 @@ oc_task_handler(void *arg)
 }
 
 static int
-oc_init_task(void) {
+oc_init_task(void)
+{
 int rc;
 
 os_eventq_init(_event_q);
@@ -193,25 +193,21 @@ oc_connectivity_shutdown(void)
 int
 oc_connectivity_init(void)
 {
-int rc;
+int rc = -1;
 
 #if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1)
-rc = oc_connectivity_init_ip();
-if (rc != 0) {
-goto oc_connectivity_init_err;
+if (oc_connectivity_init_ip() == 0) {
+rc = 0;
 }
 #endif
 #if (MYNEWT_VAL(OC_TRANSPORT_SERIAL) == 1)
-
-rc = oc_connectivity_init_serial();
-if (rc != 0) {
-goto oc_connectivity_init_err;
+if (oc_connectivity_init_serial() == 0) {
+rc = 0;
 }
 #endif
 #if (MYNEWT_VAL(OC_TRANSPORT_GATT) == 1)
-rc = oc_connectivity_init_gatt();
-if (rc != 0) {
-goto oc_connectivity_init_err;
+if (oc_connectivity_init_gatt() == 0) {
+rc = 0;
 }
 #endif
 rc = oc_init_task();



[2/5] incubator-mynewt-core git commit: mgmt handlers; return MGMT_ERR_XX error codes from handlers. Return error if cbor response fails to get formed.

2016-10-28 Thread marko
mgmt handlers; return MGMT_ERR_XX error codes from handlers.
Return error if cbor response fails to get formed.


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

Branch: refs/heads/develop
Commit: a7400e75d95d486217360fb4c6c2b50a67ddecdc
Parents: 45f74a7
Author: Marko Kiiskila 
Authored: Fri Oct 28 14:45:02 2016 -0700
Committer: Marko Kiiskila 
Committed: Fri Oct 28 15:41:31 2016 -0700

--
 mgmt/imgmgr/src/imgmgr.c  |  23 ---
 mgmt/imgmgr/src/imgmgr_coredump.c |  12 ++--
 mgmt/imgmgr/src/imgmgr_fs.c   |   6 ++
 mgmt/imgmgr/src/imgmgr_state.c|  12 +++-
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c |  37 ++
 sys/config/src/config_nmgr.c  |  16 ++---
 sys/log/src/log_nmgr.c| 106 +
 sys/stats/src/stats_nmgr.c|  11 ++-
 8 files changed, 136 insertions(+), 87 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a7400e75/mgmt/imgmgr/src/imgmgr.c
--
diff --git a/mgmt/imgmgr/src/imgmgr.c b/mgmt/imgmgr/src/imgmgr.c
index 76e6844..2a64bc1 100644
--- a/mgmt/imgmgr/src/imgmgr.c
+++ b/mgmt/imgmgr/src/imgmgr.c
@@ -263,10 +263,12 @@ imgr_upload(struct mgmt_cbuf *cb)
 struct image_version ver;
 struct image_header *hdr;
 int area_id;
-
 int best;
 int rc;
 int i;
+CborEncoder *penc = >encoder;
+CborEncoder rsp;
+CborError g_err = CborNoError;
 
 rc = cbor_read_object(>it, off_attr);
 if (rc || off == UINT_MAX) {
@@ -371,16 +373,15 @@ imgr_upload(struct mgmt_cbuf *cb)
 }
 }
 out:
-{
-CborError g_err = CborNoError;
-CborEncoder *penc = >encoder;
-CborEncoder rsp;
-g_err |= cbor_encoder_create_map(penc, , CborIndefiniteLength);
-g_err |= cbor_encode_text_stringz(, "rc");
-g_err |= cbor_encode_int(, MGMT_ERR_EOK);
-g_err |= cbor_encode_text_stringz(, "off");
-g_err |= cbor_encode_int(, imgr_state.upload.off);
-g_err |= cbor_encoder_close_container(penc, );
+g_err |= cbor_encoder_create_map(penc, , CborIndefiniteLength);
+g_err |= cbor_encode_text_stringz(, "rc");
+g_err |= cbor_encode_int(, MGMT_ERR_EOK);
+g_err |= cbor_encode_text_stringz(, "off");
+g_err |= cbor_encode_int(, imgr_state.upload.off);
+g_err |= cbor_encoder_close_container(penc, );
+
+if (g_err) {
+return MGMT_ERR_ENOMEM;
 }
 return 0;
 err_close:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a7400e75/mgmt/imgmgr/src/imgmgr_coredump.c
--
diff --git a/mgmt/imgmgr/src/imgmgr_coredump.c 
b/mgmt/imgmgr/src/imgmgr_coredump.c
index a8b92c9..df3e321 100644
--- a/mgmt/imgmgr/src/imgmgr_coredump.c
+++ b/mgmt/imgmgr/src/imgmgr_coredump.c
@@ -74,6 +74,10 @@ imgr_core_load(struct mgmt_cbuf *cb)
 const struct flash_area *fa;
 uint8_t data[IMGMGR_NMGR_MAX_MSG];
 struct coredump_header *hdr;
+CborError g_err = CborNoError;
+CborEncoder *penc = >encoder;
+CborEncoder rsp;
+
 hdr = (struct coredump_header *)data;
 
 rc = cbor_read_object(>it, dload_attr);
@@ -111,9 +115,6 @@ imgr_core_load(struct mgmt_cbuf *cb)
 goto err_close;
 }
 
-CborError g_err = CborNoError;
-CborEncoder *penc = >encoder;
-CborEncoder rsp;
 g_err |= cbor_encoder_create_map(penc, , CborIndefiniteLength);
 g_err |= cbor_encode_text_stringz(, "rc");
 g_err |= cbor_encode_int(, MGMT_ERR_EOK);
@@ -124,13 +125,16 @@ imgr_core_load(struct mgmt_cbuf *cb)
 g_err |= cbor_encoder_close_container(penc, );
 
 flash_area_close(fa);
+if (g_err) {
+return MGMT_ERR_ENOMEM;
+}
 return 0;
 
 err_close:
 flash_area_close(fa);
 err:
 mgmt_cbuf_setoerr(cb, rc);
-return 0;
+return rc;
 }
 
 /*

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a7400e75/mgmt/imgmgr/src/imgmgr_fs.c
--
diff --git a/mgmt/imgmgr/src/imgmgr_fs.c b/mgmt/imgmgr/src/imgmgr_fs.c
index 4bac8b5..2685669 100644
--- a/mgmt/imgmgr/src/imgmgr_fs.c
+++ b/mgmt/imgmgr/src/imgmgr_fs.c
@@ -106,6 +106,9 @@ imgr_file_download(struct mgmt_cbuf *cb)
 g_err |= cbor_encoder_close_container(penc, );
 
 fs_close(file);
+if (g_err) {
+  return MGMT_ERR_ENOMEM;
+}
 return 0;
 
 err_close:
@@ -215,6 +218,9 @@ out:
 g_err |= cbor_encode_text_stringz(, 

[1/5] incubator-mynewt-core git commit: oicmgr; return internal server error if encoding cbor response fails.

2016-10-28 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 96b3f5ffa -> 37ddd3c34


oicmgr; return internal server error if encoding cbor response
fails.


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

Branch: refs/heads/develop
Commit: 37ddd3c3430f216e20bcec598ab06d948c3bcb0a
Parents: 262f8b2
Author: Marko Kiiskila 
Authored: Fri Oct 28 15:40:56 2016 -0700
Committer: Marko Kiiskila 
Committed: Fri Oct 28 15:41:31 2016 -0700

--
 mgmt/oicmgr/src/oicmgr.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/37ddd3c3/mgmt/oicmgr/src/oicmgr.c
--
diff --git a/mgmt/oicmgr/src/oicmgr.c b/mgmt/oicmgr/src/oicmgr.c
index 2cc14e1..3011ebd 100644
--- a/mgmt/oicmgr/src/oicmgr.c
+++ b/mgmt/oicmgr/src/oicmgr.c
@@ -101,7 +101,7 @@ omgr_oic_op(oc_request_t *req, oc_interface_mask_t mask, 
int isset)
 struct omgr_state *o = _state;
 const struct mgmt_handler *handler;
 const uint8_t *data;
-int rc;
+int rc = 0;
 extern CborEncoder g_encoder;
 
 if (!req->query_len) {
@@ -160,7 +160,12 @@ bad_req:
 /*
  *  might send partially constructed response as payload
  */
-oc_send_response(req, OC_STATUS_BAD_REQUEST);
+if (rc == MGMT_ERR_ENOMEM) {
+rc = OC_STATUS_INTERNAL_SERVER_ERROR;
+} else {
+rc = OC_STATUS_BAD_REQUEST;
+}
+oc_send_response(req, rc);
 }
 
 static void



[3/5] incubator-mynewt-core git commit: native hal uart; shorten task name.

2016-10-28 Thread marko
native hal uart; shorten task name.


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

Branch: refs/heads/develop
Commit: dc038cccf98940a8d59f9b0b27d533f6be15beed
Parents: 96b3f5f
Author: Marko Kiiskila 
Authored: Fri Oct 28 14:11:41 2016 -0700
Committer: Marko Kiiskila 
Committed: Fri Oct 28 15:41:31 2016 -0700

--
 hw/mcu/native/src/hal_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dc038ccc/hw/mcu/native/src/hal_uart.c
--
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index eaf964d..1ac5b97 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -340,7 +340,7 @@ hal_uart_init_cbs(int port, hal_uart_tx_char tx_func, 
hal_uart_tx_done tx_done,
 
 if (!uart_poller_running) {
 uart_poller_running = 1;
-rc = os_task_init(_poller_task, "uart_poller", uart_poller, NULL,
+rc = os_task_init(_poller_task, "uartpoll", uart_poller, NULL,
   UART_POLLER_PRIO, OS_WAIT_FOREVER, uart_poller_stack,
   UART_POLLER_STACK_SZ);
 assert(rc == 0);



incubator-mynewt-core git commit: disable console history by default since it uses tons of RAM and interrupt time

2016-10-28 Thread paulfdietrich
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 087532bb0 -> 96b3f5ffa


disable console history by default since it uses tons of RAM and interrupt time


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

Branch: refs/heads/develop
Commit: 96b3f5ffa594df47359f130d3a3cd070b79aa5ad
Parents: 087532b
Author: paulfdietrich 
Authored: Fri Oct 28 15:14:51 2016 -0700
Committer: paulfdietrich 
Committed: Fri Oct 28 15:15:26 2016 -0700

--
 sys/console/full/syscfg.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/96b3f5ff/sys/console/full/syscfg.yml
--
diff --git a/sys/console/full/syscfg.yml b/sys/console/full/syscfg.yml
index cd58944..e90402f 100644
--- a/sys/console/full/syscfg.yml
+++ b/sys/console/full/syscfg.yml
@@ -22,4 +22,4 @@ syscfg.defs:
 value: '1'
 CONSOLE_HIST_ENABLE:
 description: 'Console history '
-value: 1
+value: 0



incubator-mynewt-newt git commit: newt - expose cli.ResolveMfgPkg

2016-10-28 Thread ccollins
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop aa87efd4e -> 4219606d2


newt - expose cli.ResolveMfgPkg


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

Branch: refs/heads/develop
Commit: 4219606d2504301cfe29bcf2444e99cef4c42e8c
Parents: aa87efd
Author: Christopher Collins 
Authored: Fri Oct 28 13:50:18 2016 -0700
Committer: Christopher Collins 
Committed: Fri Oct 28 13:50:33 2016 -0700

--
 newt/cli/mfg_cmds.go | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4219606d/newt/cli/mfg_cmds.go
--
diff --git a/newt/cli/mfg_cmds.go b/newt/cli/mfg_cmds.go
index a8831c6..c306b45 100644
--- a/newt/cli/mfg_cmds.go
+++ b/newt/cli/mfg_cmds.go
@@ -28,7 +28,7 @@ import (
"mynewt.apache.org/newt/util"
 )
 
-func resolveMfgPkg(pkgName string) (*pkg.LocalPackage, error) {
+func ResolveMfgPkg(pkgName string) (*pkg.LocalPackage, error) {
proj, err := project.TryGetProject()
if err != nil {
return nil, err
@@ -92,7 +92,7 @@ func mfgCreateRunCmd(cmd *cobra.Command, args []string) {
}
 
pkgName := args[0]
-   lpkg, err := resolveMfgPkg(pkgName)
+   lpkg, err := ResolveMfgPkg(pkgName)
if err != nil {
NewtUsage(cmd, err)
}
@@ -111,7 +111,7 @@ func mfgLoadRunCmd(cmd *cobra.Command, args []string) {
}
 
pkgName := args[0]
-   lpkg, err := resolveMfgPkg(pkgName)
+   lpkg, err := ResolveMfgPkg(pkgName)
if err != nil {
NewtUsage(cmd, err)
}
@@ -130,7 +130,7 @@ func mfgDeployRunCmd(cmd *cobra.Command, args []string) {
}
 
pkgName := args[0]
-   lpkg, err := resolveMfgPkg(pkgName)
+   lpkg, err := ResolveMfgPkg(pkgName)
if err != nil {
NewtUsage(cmd, err)
}



[1/2] incubator-mynewt-newt git commit: newt - expose paths of mfg artifacts.

2016-10-28 Thread ccollins
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop bc70c6a6f -> aa87efd4e


newt - expose paths of mfg artifacts.


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

Branch: refs/heads/develop
Commit: 141160b285ac529cc376c8353a374c0c881db940
Parents: bc70c6a
Author: Christopher Collins 
Authored: Fri Oct 28 13:42:16 2016 -0700
Committer: Christopher Collins 
Committed: Fri Oct 28 13:42:16 2016 -0700

--
 newt/builder/paths.go |  22 +-
 newt/cli/mfg_cmds.go  |  14 ++--
 newt/flash/flash.go   |  16 +
 newt/mfg/create.go|  75 +---
 newt/mfg/load.go  |  61 +++--
 newt/mfg/mfg.go   |  35 ++
 newt/mfg/paths.go | 167 +
 newt/mfg/read.go  |   2 +-
 8 files changed, 335 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/141160b2/newt/builder/paths.go
--
diff --git a/newt/builder/paths.go b/newt/builder/paths.go
index 3f84a62..fa9e940 100644
--- a/newt/builder/paths.go
+++ b/newt/builder/paths.go
@@ -20,9 +20,7 @@
 package builder
 
 import (
-   "fmt"
"path/filepath"
-   "strconv"
 
"mynewt.apache.org/newt/newt/pkg"
"mynewt.apache.org/newt/newt/project"
@@ -89,28 +87,10 @@ func MfgBinDir(mfgPkgName string) string {
return BinRoot() + "/" + mfgPkgName
 }
 
-func MfgBinBootDir(mfgPkgName string) string {
+func MfgBootDir(mfgPkgName string) string {
return MfgBinDir(mfgPkgName) + "/bootloader"
 }
 
-// Image indices start at 0.
-func MfgBinImageDir(mfgPkgName string, imageIdx int) string {
-   return MfgBinDir(mfgPkgName) + "/image" + strconv.Itoa(imageIdx)
-}
-
-func MfgSectionDir(mfgPkgName string) string {
-   return MfgBinDir(mfgPkgName) + "/sections"
-}
-
-func MfgSectionPath(mfgPkgName string, sectionNum int) string {
-   return fmt.Sprintf("%s/%s-s%d.bin", MfgSectionDir(mfgPkgName),
-   filepath.Base(mfgPkgName), sectionNum)
-}
-
-func MfgManifestPath(mfgPkgName string) string {
-   return MfgBinDir(mfgPkgName) + "/manifest.json"
-}
-
 func (b *Builder) BinDir() string {
return BinDir(b.targetPkg.Name(), b.buildName)
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/141160b2/newt/cli/mfg_cmds.go
--
diff --git a/newt/cli/mfg_cmds.go b/newt/cli/mfg_cmds.go
index ee9d731..a8831c6 100644
--- a/newt/cli/mfg_cmds.go
+++ b/newt/cli/mfg_cmds.go
@@ -55,23 +55,25 @@ func resolveMfgPkg(pkgName string) (*pkg.LocalPackage, 
error) {
 
 func mfgCreate(mi *mfg.MfgImage) {
pathStr := ""
-   for _, path := range mi.SrcPaths() {
+   for _, path := range mi.FromPaths() {
pathStr += "* " + path + "\n"
}
 
util.StatusMessage(util.VERBOSITY_DEFAULT,
-   "Creating a manufacturing image from the following files:\n%s",
+   "Creating a manufacturing image from the following 
files:\n%s\n",
pathStr)
 
-   sectionPaths, err := mi.CreateMfgImage()
+   outputPaths, err := mi.CreateMfgImage()
if err != nil {
NewtUsage(nil, err)
}
 
-   for _, sectionPath := range sectionPaths {
-   util.StatusMessage(util.VERBOSITY_DEFAULT,
-   "Created manufacturing section: %s\n", sectionPath)
+   pathStr = ""
+   for _, path := range outputPaths {
+   pathStr += "* " + path + "\n"
}
+   util.StatusMessage(util.VERBOSITY_DEFAULT,
+   "Generated the following files:\n%s", pathStr)
 }
 
 func mfgLoad(mi *mfg.MfgImage) {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/141160b2/newt/flash/flash.go
--
diff --git a/newt/flash/flash.go b/newt/flash/flash.go
index 4d7c3be..ea13e25 100644
--- a/newt/flash/flash.go
+++ b/newt/flash/flash.go
@@ -205,6 +205,22 @@ func (flashMap FlashMap) SortedAreas() []FlashArea {
return areas
 }
 
+func (flashMap FlashMap) DeviceIds() []int {
+   deviceMap := map[int]struct{}{}
+
+   for _, area := range flashMap.Areas {
+   deviceMap[area.Device] = struct{}{}
+   }
+
+   devices := make([]int, 0, len(deviceMap))
+   for device, _ := range deviceMap {
+   devices = append(devices, device)
+   }
+   sort.Ints(devices)
+

[2/2] incubator-mynewt-newt git commit: mfg - allow number of images to be queried.

2016-10-28 Thread ccollins
mfg - allow number of images to be queried.


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

Branch: refs/heads/develop
Commit: aa87efd4e107b845948922f44175046581c6d68f
Parents: 141160b
Author: Christopher Collins 
Authored: Fri Oct 28 13:47:52 2016 -0700
Committer: Christopher Collins 
Committed: Fri Oct 28 13:47:52 2016 -0700

--
 newt/mfg/mfg.go | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/aa87efd4/newt/mfg/mfg.go
--
diff --git a/newt/mfg/mfg.go b/newt/mfg/mfg.go
index 6805ab9..ea31f85 100644
--- a/newt/mfg/mfg.go
+++ b/newt/mfg/mfg.go
@@ -84,3 +84,7 @@ func (mi *MfgImage) sectionIds() []int {
 
return ids
 }
+
+func (mi *MfgImage) NumImages() int {
+   return len(mi.images)
+}



[2/2] incubator-mynewt-core git commit: MYNEWT-139 - Don't call tu_case_pass on fail.

2016-10-28 Thread peterfs
MYNEWT-139 - Don't call tu_case_pass on fail.


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

Branch: refs/heads/develop
Commit: 087532bb09f1f1136f887150ebec46be0a6b5340
Parents: 8eb68f6
Author: Peter Snyder 
Authored: Fri Oct 28 12:20:03 2016 -0700
Committer: Peter Snyder 
Committed: Fri Oct 28 12:20:03 2016 -0700

--
 test/testutil/include/testutil/testutil.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/087532bb/test/testutil/include/testutil/testutil.h
--
diff --git a/test/testutil/include/testutil/testutil.h 
b/test/testutil/include/testutil/testutil.h
index fbd58bd..88eaebe 100644
--- a/test/testutil/include/testutil/testutil.h
+++ b/test/testutil/include/testutil/testutil.h
@@ -213,7 +213,9 @@ TEST_SUITE_##suite_name(void);  
 \
 if (setjmp(tu_case_jb) == 0) {\
 TEST_CASE_##case_name();  \
 tu_case_post_test();  \
-tu_case_pass();   \
+if (!tu_case_failed) {\
+tu_case_pass();   \
+} \
 } \
 tu_case_complete();   \
 } \



[1/2] incubator-mynewt-core git commit: MYNEWT-139 - Minimal change to enable sanity test.

2016-10-28 Thread peterfs
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 39a06ff58 -> 087532bb0


MYNEWT-139 - Minimal change to enable sanity test.


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

Branch: refs/heads/develop
Commit: 8eb68f6d1017507155da58250318d32043152104
Parents: 39a06ff
Author: Peter Snyder 
Authored: Fri Oct 28 11:49:52 2016 -0700
Committer: Peter Snyder 
Committed: Fri Oct 28 11:49:52 2016 -0700

--
 kernel/os/test/src/os_test.c  | 2 ++
 kernel/os/test/src/sem_test.c | 2 ++
 sys/log/src/log.c | 6 --
 3 files changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8eb68f6d/kernel/os/test/src/os_test.c
--
diff --git a/kernel/os/test/src/os_test.c b/kernel/os/test/src/os_test.c
index 3b3873d..eaf1535 100644
--- a/kernel/os/test/src/os_test.c
+++ b/kernel/os/test/src/os_test.c
@@ -33,6 +33,7 @@
 void
 os_test_restart(void)
 {
+#if MYNEWT_VAL(SELFTEST)
 struct sigaction sa;
 struct itimerval it;
 int rc;
@@ -51,6 +52,7 @@ os_test_restart(void)
 perror("Cannot set itimer");
 abort();
 }
+#endif /* MYNEWT_VAL(SELFTEST) */
 
 tu_restart();
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8eb68f6d/kernel/os/test/src/sem_test.c
--
diff --git a/kernel/os/test/src/sem_test.c b/kernel/os/test/src/sem_test.c
index 0aabd54..8f3b163 100644
--- a/kernel/os/test/src/sem_test.c
+++ b/kernel/os/test/src/sem_test.c
@@ -29,6 +29,7 @@
 #define SEM_TEST_STACK_SIZE 512
 #endif
 
+#if MYNEWT_VAL(SELFTEST)
 struct os_task task1;
 os_stack_t stack1[OS_STACK_ALIGN(SEM_TEST_STACK_SIZE)];
 
@@ -45,6 +46,7 @@ os_stack_t stack4[OS_STACK_ALIGN(SEM_TEST_STACK_SIZE)];
 #define TASK2_PRIO (2) 
 #define TASK3_PRIO (3) 
 #define TASK4_PRIO (4) 
+#endif /* MYNEWT_VAL(SELFTEST) */
 
 struct os_sem g_sem1;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8eb68f6d/sys/log/src/log.c
--
diff --git a/sys/log/src/log.c b/sys/log/src/log.c
index 1148058..99bf704 100644
--- a/sys/log/src/log.c
+++ b/sys/log/src/log.c
@@ -114,8 +114,10 @@ log_register(char *name, struct log *log, const struct 
log_handler *lh,
 log->l_arg = arg;
 log->l_level = level;
 
-assert(!log_registered(log));
-STAILQ_INSERT_TAIL(_log_list, log, l_next);
+/*assert(!log_registered(log));*/
+if (!log_registered(log)) {
+STAILQ_INSERT_TAIL(_log_list, log, l_next);
+}
 
 return (0);
 }



incubator-mynewt-newt git commit: newt - Fix spurious bsp mismatch err for rmt repos

2016-10-28 Thread ccollins
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop afae040cd -> bc70c6a6f


newt - Fix spurious bsp mismatch err for rmt repos


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

Branch: refs/heads/develop
Commit: bc70c6a6f380953ccc7aa2274d260df6579209f7
Parents: afae040
Author: Christopher Collins 
Authored: Fri Oct 28 11:01:22 2016 -0700
Committer: Christopher Collins 
Committed: Fri Oct 28 11:01:55 2016 -0700

--
 newt/mfg/load.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/bc70c6a6/newt/mfg/load.go
--
diff --git a/newt/mfg/load.go b/newt/mfg/load.go
index 0ed9bad..d8e660f 100644
--- a/newt/mfg/load.go
+++ b/newt/mfg/load.go
@@ -267,7 +267,7 @@ func Load(basePkg *pkg.LocalPackage) (*MfgImage, error) {
"split image mode (%s is a split build)", 
imgTarget.Name())
}
 
-   if imgTarget.BspName != mi.bsp.Name() {
+   if imgTarget.Bsp() != mi.bsp.LocalPackage {
return nil, mi.loadError(
"image target \"%s\" specified conflicting BSP; 
"+
"boot loader uses %s, image uses %s",