You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/03/29 01:07:04 UTC

[01/17] incubator-mynewt-core git commit: BLE Host - Rename parameter for clarity

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 7f690f7f5 -> 07746cc05


BLE Host - Rename parameter for clarity


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

Branch: refs/heads/develop
Commit: 03650bcaf55c9d0fec4178f69635b6f7553ae6ac
Parents: 7f690f7
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Mar 17 15:24:50 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:48:26 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/include/host/ble_gap.h |  2 +-
 net/nimble/host/src/ble_gap.c          | 15 ++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/03650bca/net/nimble/host/include/host/ble_gap.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_gap.h b/net/nimble/host/include/host/ble_gap.h
index 1c0c93e..189244a 100644
--- a/net/nimble/host/include/host/ble_gap.h
+++ b/net/nimble/host/include/host/ble_gap.h
@@ -556,7 +556,7 @@ int ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
 int ble_gap_conn_cancel(void);
 int ble_gap_conn_active(void);
 int ble_gap_terminate(uint16_t conn_handle, uint8_t hci_reason);
-int ble_gap_wl_set(const ble_addr_t *addr, uint8_t white_list_count);
+int ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count);
 int ble_gap_update_params(uint16_t conn_handle,
                           const struct ble_gap_upd_params *params);
 int ble_gap_dbg_update_active(uint16_t conn_handle);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/03650bca/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index d14c55c..ed71374 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -1434,13 +1434,13 @@ ble_gap_wl_tx_clear(void)
 /**
  * Overwrites the controller's white list with the specified contents.
  *
- * @param addr                  The entries to write to the white list.
+ * @param addrs                 The entries to write to the white list.
  * @param white_list_count      The number of entries in the white list.
  *
  * @return                      0 on success; nonzero on failure.
  */
 int
-ble_gap_wl_set(const ble_addr_t *addr, uint8_t white_list_count)
+ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
 {
 #if !MYNEWT_VAL(BLE_WHITELIST)
     return BLE_HS_ENOTSUP;
@@ -1459,8 +1459,8 @@ ble_gap_wl_set(const ble_addr_t *addr, uint8_t white_list_count)
     }
 
     for (i = 0; i < white_list_count; i++) {
-        if (addr[i].type != BLE_ADDR_PUBLIC &&
-            addr[i].type != BLE_ADDR_RANDOM) {
+        if (addrs[i].type != BLE_ADDR_PUBLIC &&
+            addrs[i].type != BLE_ADDR_RANDOM) {
 
             rc = BLE_HS_EINVAL;
             goto done;
@@ -1473,7 +1473,7 @@ ble_gap_wl_set(const ble_addr_t *addr, uint8_t white_list_count)
     }
 
     BLE_HS_LOG(INFO, "GAP procedure initiated: set whitelist; ");
-    ble_gap_log_wl(addr, white_list_count);
+    ble_gap_log_wl(addrs, white_list_count);
     BLE_HS_LOG(INFO, "\n");
 
     rc = ble_gap_wl_tx_clear();
@@ -1482,7 +1482,7 @@ ble_gap_wl_set(const ble_addr_t *addr, uint8_t white_list_count)
     }
 
     for (i = 0; i < white_list_count; i++) {
-        rc = ble_gap_wl_tx_add(addr + i);
+        rc = ble_gap_wl_tx_add(addrs + i);
         if (rc != 0) {
             goto done;
         }
@@ -2353,7 +2353,8 @@ ble_gap_conn_create_tx(uint8_t own_addr_type, const ble_addr_t *peer_addr,
  *                                  already in progress;
  *                              BLE_HS_EBUSY if initiating a connection is not
  *                                  possible because scanning is in progress;
- *                              BLE_HS_EDONE if the specified peer is already connected;
+ *                              BLE_HS_EDONE if the specified peer is already
+ *                                  connected;
  *                              Other nonzero on error.
  */
 int


[17/17] incubator-mynewt-core git commit: bletiny - fix build error in sim

Posted by cc...@apache.org.
bletiny - fix build error in sim


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

Branch: refs/heads/develop
Commit: 07746cc052ed1b22b0efa23dcc24e6a17234cdd2
Parents: badc6e9
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 18:04:22 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 18:04:22 2017 -0700

----------------------------------------------------------------------
 apps/bletiny/src/cmd.c  | 3 +--
 apps/bletiny/src/main.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/07746cc0/apps/bletiny/src/cmd.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/cmd.c b/apps/bletiny/src/cmd.c
index 45debc5..15563a0 100644
--- a/apps/bletiny/src/cmd.c
+++ b/apps/bletiny/src/cmd.c
@@ -1796,8 +1796,7 @@ cmd_show_coc(int argc, char **argv)
         console_printf("conn_handle: 0x%04x\n", conn->handle);
         j = 0;
         SLIST_FOREACH(coc, &conn->coc_list, next) {
-            console_printf("    idx: %i, chan pointer = 0x%08lx\n", j++,
-                           (uint32_t)coc->chan);
+            console_printf("    idx: %i, chan pointer = %p\n", j++, coc->chan);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/07746cc0/apps/bletiny/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 8ee724e..96ac90e 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -1847,7 +1847,7 @@ bletiny_l2cap_send(uint16_t conn_handle, uint16_t idx, uint16_t bytes)
  * @return int NOTE: this function should never return!
  */
 int
-main(void)
+main(int argc, char **argv)
 {
     int rc;
 


[10/17] incubator-mynewt-core git commit: native UART: Allow flow control.

Posted by cc...@apache.org.
native UART: Allow flow control.


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

Branch: refs/heads/develop
Commit: 54086acef681f69cea9aaa24aad1fb946614bded
Parents: 4fa3357
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Mar 27 17:03:46 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 hw/mcu/native/src/native_uart_cfg.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/54086ace/hw/mcu/native/src/native_uart_cfg.c
----------------------------------------------------------------------
diff --git a/hw/mcu/native/src/native_uart_cfg.c b/hw/mcu/native/src/native_uart_cfg.c
index de6bd0b..75c1c22 100644
--- a/hw/mcu/native/src/native_uart_cfg.c
+++ b/hw/mcu/native/src/native_uart_cfg.c
@@ -167,8 +167,20 @@ uart_dev_set_attr(int fd, int32_t baudrate, uint8_t databits,
 
     tty.c_cflag |= (speed | CLOCAL | CREAD);
 
-    /* Disable flow control. */
-    tty.c_cflag &= ~CRTSCTS;
+    /* Set flow control. */
+    switch (flow_ctl) {
+    case HAL_UART_FLOW_CTL_NONE:
+        tty.c_cflag &= ~CRTSCTS;
+        break;
+
+    case HAL_UART_FLOW_CTL_RTS_CTS:
+        tty.c_cflag |= CRTSCTS;
+        break;
+
+    default:
+        fprintf(stderr, "invalid flow control setting: %d\n", flow_ctl);
+        return -1;
+    }
 
     errno = 0;
     rc = cfsetospeed(&tty, speed);


[03/17] incubator-mynewt-core git commit: native uart: print errors to stderr.

Posted by cc...@apache.org.
native uart: print errors to stderr.


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

Branch: refs/heads/develop
Commit: eddcf8fa05e6c70ac4670e47c6ac90dcace1ccb6
Parents: 103f39e
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 7 17:19:04 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/eddcf8fa/hw/mcu/native/src/native_uart_cfg.c
----------------------------------------------------------------------
diff --git a/hw/mcu/native/src/native_uart_cfg.c b/hw/mcu/native/src/native_uart_cfg.c
index 4f9dcef..de6bd0b 100644
--- a/hw/mcu/native/src/native_uart_cfg.c
+++ b/hw/mcu/native/src/native_uart_cfg.c
@@ -225,7 +225,7 @@ uart_dev_set_attr(int fd, int32_t baudrate, uint8_t databits,
 
     rc = tcsetattr(fd, TCSANOW, &tty);
     if (rc != 0) {
-        dprintf(1, "tcsetattr failed; %d (%s)\n", errno, strerror(errno));
+        fprintf(stderr, "tcsetattr failed; %d (%s)\n", errno, strerror(errno));
         return -1;
     }
 


[08/17] incubator-mynewt-core git commit: BLE Host - Additional debug logging.

Posted by cc...@apache.org.
BLE Host - Additional debug logging.


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

Branch: refs/heads/develop
Commit: 519e5164bbee1e3c75e679f9d5dc1201af3b8f93
Parents: 5ae196a
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:34:15 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_att_clt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/519e5164/net/nimble/host/src/ble_att_clt.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_att_clt.c b/net/nimble/host/src/ble_att_clt.c
index 4a93171..f310a6f 100644
--- a/net/nimble/host/src/ble_att_clt.c
+++ b/net/nimble/host/src/ble_att_clt.c
@@ -918,7 +918,20 @@ ble_att_clt_tx_write_cmd(uint16_t conn_handle,
     return BLE_HS_ENOTSUP;
 #endif
 
+    uint8_t b;
     int rc;
+    int i;
+
+    BLE_HS_LOG(DEBUG, "ble_att_clt_tx_write_cmd(): ");
+    for (i = 0; i < OS_MBUF_PKTLEN(txom); i++) {
+        if (i != 0) {
+            BLE_HS_LOG(DEBUG, ":");
+        }
+        rc = os_mbuf_copydata(txom, i, 1, &b);
+        assert(rc == 0);
+        BLE_HS_LOG(DEBUG, "0x%02x", b);
+    }
+    
 
     rc = ble_att_clt_tx_write_req_or_cmd(conn_handle, req, txom, 0);
     if (rc != 0) {


[05/17] incubator-mynewt-core git commit: sim compiler: add -lm flag.

Posted by cc...@apache.org.
sim compiler: add -lm flag.


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

Branch: refs/heads/develop
Commit: 03fa86591eac0c82a8e8489b79d301fb2383efee
Parents: 03650bc
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Mar 8 19:37:54 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 compiler/sim/compiler.yml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/03fa8659/compiler/sim/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/sim/compiler.yml b/compiler/sim/compiler.yml
index 5e5e7e5..a2e619f 100644
--- a/compiler/sim/compiler.yml
+++ b/compiler/sim/compiler.yml
@@ -34,6 +34,7 @@ compiler.flags.debug: [compiler.flags.base, -O0]
 compiler.as.flags: [-x, assembler-with-cpp]
 compiler.ld.mapfile: false
 compiler.ld.binfile: false
+compiler.ld.flags: -lm
 
 # Linux.
 compiler.flags.base.LINUX: >


[16/17] incubator-mynewt-core git commit: baselibc - Add %p format specifier to tinyprintf.

Posted by cc...@apache.org.
baselibc - Add %p format specifier to tinyprintf.


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

Branch: refs/heads/develop
Commit: badc6e99ad77db4d818cf5ca904a18a028afe8df
Parents: 0eed22f
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 18:03:55 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 18:03:55 2017 -0700

----------------------------------------------------------------------
 libc/baselibc/src/tinyprintf.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/badc6e99/libc/baselibc/src/tinyprintf.c
----------------------------------------------------------------------
diff --git a/libc/baselibc/src/tinyprintf.c b/libc/baselibc/src/tinyprintf.c
index e48be4a..7719d80 100644
--- a/libc/baselibc/src/tinyprintf.c
+++ b/libc/baselibc/src/tinyprintf.c
@@ -52,7 +52,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 /* This is a smaller implementation of printf-family of functions,
  * based on tinyprintf code by Kustaa Nyholm.
- * The formats supported by this implementation are: 'd' 'u' 'c' 's' 'x' 'X'.
+ * The formats supported by this implementation are:
+ *     'd' 'u' 'c' 's' 'x' 'X' 'p'.
  * Zero padding and field width are also supported.
  * If the library is compiled with 'PRINTF_SUPPORT_LONG' defined then the
  * long specifier is also supported.
@@ -61,6 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include <stdio.h>
+#include <inttypes.h>
 
 struct param {
     unsigned char width; /**< field width */
@@ -231,6 +233,7 @@ size_t tfp_format(FILE *putp, const char *fmt, va_list va)
     char bf[23];
     char ch;
     char lng;
+    void *v;
 
     p.bf = bf;
 
@@ -300,6 +303,16 @@ size_t tfp_format(FILE *putp, const char *fmt, va_list va)
                 ui2a(intarg(lng, 0, &va), &p);
                 written += putchw(putp, &p);
                 break;
+            case 'p':
+                v = va_arg(va, void *);
+                ui2a((uintptr_t)v, &p);
+                p.base = 16;
+                p.width = 2 * sizeof(void*);
+                p.lz = 1;
+                written += putf(putp, '0');
+                written += putf(putp, 'x');
+                written += putchw(putp, &p);
+                break;
             case 'c':
                 written += putf(putp, (char)(va_arg(va, int)));
                 break;


[12/17] incubator-mynewt-core git commit: BLE Host - If initial sync fails, retry later.

Posted by cc...@apache.org.
BLE Host - If initial sync fails, retry later.


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

Branch: refs/heads/develop
Commit: e679687fcd6a98a622054ac5786682fe0aa9cc9a
Parents: 9b98206
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:40:38 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_hs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e679687f/net/nimble/host/src/ble_hs.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs.c b/net/nimble/host/src/ble_hs.c
index 9fb5702..231eea1 100644
--- a/net/nimble/host/src/ble_hs.c
+++ b/net/nimble/host/src/ble_hs.c
@@ -475,10 +475,7 @@ ble_hs_start(void)
         return rc;
     }
 
-    rc = ble_hs_sync();
-    if (rc != 0) {
-        return rc;
-    }
+    ble_hs_sync();
 
     return 0;
 }


[13/17] incubator-mynewt-core git commit: sysinit - Allow panic message.

Posted by cc...@apache.org.
sysinit - Allow panic message.


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

Branch: refs/heads/develop
Commit: 103f39e8004d3908b7c39d19b2a8b82ba9b1c714
Parents: e679687
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 7 15:09:58 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 hw/bsp/native/syscfg.yml              |  5 +++++
 sys/sysinit/include/sysinit/sysinit.h | 34 ++++++++++++++++++++++++------
 sys/sysinit/src/sysinit.c             | 17 ++++++++++++++-
 sys/sysinit/syscfg.yml                |  8 +++++++
 4 files changed, 56 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/103f39e8/hw/bsp/native/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/native/syscfg.yml b/hw/bsp/native/syscfg.yml
index 9ca0608..2d91f9c 100644
--- a/hw/bsp/native/syscfg.yml
+++ b/hw/bsp/native/syscfg.yml
@@ -18,7 +18,12 @@
 #
 
 syscfg.vals:
+    # Sim isn't flash constrained, so include filename, line number, and
+    # message in asserts and sysinit panic messages.
     BASELIBC_ASSERT_FILE_LINE: 1
+    SYSINIT_PANIC_FILE_LINE: 1
+    SYSINIT_PANIC_MESSAGE: 1
+
     NFFS_FLASH_AREA: FLASH_AREA_NFFS
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/103f39e8/sys/sysinit/include/sysinit/sysinit.h
----------------------------------------------------------------------
diff --git a/sys/sysinit/include/sysinit/sysinit.h b/sys/sysinit/include/sysinit/sysinit.h
index 32df52b..7694c42 100644
--- a/sys/sysinit/include/sysinit/sysinit.h
+++ b/sys/sysinit/include/sysinit/sysinit.h
@@ -38,21 +38,41 @@ void sysinit_start(void);
 void sysinit_end(void);
 
 typedef void sysinit_panic_fn(const char *file, int line, const char *func,
-                              const char *expr);
+                              const char *expr, const char *msg);
 
 extern sysinit_panic_fn *sysinit_panic_cb;
 
 void sysinit_panic_set(sysinit_panic_fn *panic_fn);
 
-#define SYSINIT_PANIC() sysinit_panic_cb(NULL, 0, NULL, NULL)
+#if MYNEWT_VAL(SYSINIT_PANIC_MESSAGE)
 
-#define SYSINIT_PANIC_ASSERT(rc) do \
-{                                   \
-    if (!(rc)) {                    \
-        SYSINIT_PANIC();            \
-    }                               \
+#if MYNEWT_VAL(SYSINIT_PANIC_FILE_LINE)
+#define SYSINIT_PANIC_MSG(msg) sysinit_panic_cb(__FILE__, __LINE__, 0, 0, msg)
+#else
+#define SYSINIT_PANIC_MSG(msg) sysinit_panic_cb(0, 0, 0, 0, msg)
+#endif
+
+#else
+
+#if MYNEWT_VAL(SYSINIT_PANIC_FILE_LINE)
+#define SYSINIT_PANIC_MSG(msg) sysinit_panic_cb(__FILE__, __LINE__, 0, 0, 0)
+#else
+#define SYSINIT_PANIC_MSG(msg) sysinit_panic_cb(0, 0, 0, 0, 0)
+#endif
+
+#endif
+
+#define SYSINIT_PANIC() SYSINIT_PANIC_MSG(NULL)
+
+#define SYSINIT_PANIC_ASSERT_MSG(rc, msg) do \
+{                                            \
+    if (!(rc)) {                             \
+        SYSINIT_PANIC_MSG(msg);              \
+    }                                        \
 } while (0)
 
+#define SYSINIT_PANIC_ASSERT(rc) SYSINIT_PANIC_ASSERT_MSG(rc, NULL)
+
 /**
  * Asserts that system initialization is in progress.  This macro is used to
  * ensure packages don't get initialized a second time after system

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/103f39e8/sys/sysinit/src/sysinit.c
----------------------------------------------------------------------
diff --git a/sys/sysinit/src/sysinit.c b/sys/sysinit/src/sysinit.c
index 767032f..393d1c5 100644
--- a/sys/sysinit/src/sysinit.c
+++ b/sys/sysinit/src/sysinit.c
@@ -17,12 +17,27 @@
  * under the License.
  */
 
+#include <stdio.h>
 #include <stddef.h>
 #include <limits.h>
 #include "os/os_fault.h"
+#include "syscfg/syscfg.h"
 #include "sysinit/sysinit.h"
 
-sysinit_panic_fn *sysinit_panic_cb = __assert_func;
+static void
+sysinit_dflt_panic_cb(const char *file, int line, const char *func,
+                      const char *expr, const char *msg)
+{
+#if MYNEWT_VAL(SYSINIT_PANIC_MESSAGE)
+    if (msg != NULL) {
+        fprintf(stderr, "sysinit failure: %s\n", msg);
+    }
+#endif
+
+    __assert_func(file, line, func, expr);
+}
+
+sysinit_panic_fn *sysinit_panic_cb = sysinit_dflt_panic_cb;
 
 uint8_t sysinit_active;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/103f39e8/sys/sysinit/syscfg.yml
----------------------------------------------------------------------
diff --git a/sys/sysinit/syscfg.yml b/sys/sysinit/syscfg.yml
index 74dbc29..d6bac23 100644
--- a/sys/sysinit/syscfg.yml
+++ b/sys/sysinit/syscfg.yml
@@ -22,3 +22,11 @@ syscfg.defs:
     SYSINIT_CONSTRAIN_INIT:
         description: Only allow packages to be initialized by sysinit.
         value: 1
+
+    SYSINIT_PANIC_FILE_LINE:
+        description: Include filename and line number in sysinit panic.
+        value: 0
+
+    SYSINIT_PANIC_MESSAGE:
+        description: Include descriptive message in sysinit panic.
+        value: 0


[07/17] incubator-mynewt-core git commit: BLE Host - Add missing #include.

Posted by cc...@apache.org.
BLE Host - Add missing #include.


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

Branch: refs/heads/develop
Commit: e51ce9de50b2950273b1db79e26e43e01b0082b0
Parents: 519e516
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:37:21 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/include/host/ble_uuid.h | 3 +++
 net/nimble/host/src/ble_uuid.c          | 1 +
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e51ce9de/net/nimble/host/include/host/ble_uuid.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_uuid.h b/net/nimble/host/include/host/ble_uuid.h
index a2be095..4cfaf53 100644
--- a/net/nimble/host/include/host/ble_uuid.h
+++ b/net/nimble/host/include/host/ble_uuid.h
@@ -99,6 +99,7 @@ typedef union {
 #define BLE_UUID128(u) \
     ((ble_uuid128_t *) (u))
 
+/** Includes trailing \0. */
 #define BLE_UUID_STR_LEN (37)
 
 int ble_uuid_init_from_buf(ble_uuid_any_t *uuid, const void *buf, size_t len);
@@ -106,6 +107,8 @@ int ble_uuid_cmp(const ble_uuid_t *uuid1, const ble_uuid_t *uuid2);
 char *ble_uuid_to_str(const ble_uuid_t *uuid, char *dst);
 uint16_t ble_uuid_u16(const ble_uuid_t *uuid);
 
+int ble_uuid_to_s(char *dst, int dst_sz, const void *uuid128);
+
 #ifdef __cplusplus
 }
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e51ce9de/net/nimble/host/src/ble_uuid.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_uuid.c b/net/nimble/host/src/ble_uuid.c
index f9ccc6d..ff94870 100644
--- a/net/nimble/host/src/ble_uuid.c
+++ b/net/nimble/host/src/ble_uuid.c
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#include <stdio.h>
 #include "os/os_mbuf.h"
 #include "nimble/ble.h"
 #include "ble_hs_priv.h"


[06/17] incubator-mynewt-core git commit: BLE Host - Don't allow conn to already-conned peer

Posted by cc...@apache.org.
BLE Host - Don't allow conn to already-conned peer


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

Branch: refs/heads/develop
Commit: 5ae196a95248b3531f7e3c940f0444df78d3e554
Parents: 537b220
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:32:25 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5ae196a9/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index ed71374..9d7d0f0 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2384,6 +2384,12 @@ ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
         goto done;
     }
 
+    /* Verify peer not already connected. */
+    if (ble_hs_conn_find_by_addr(peer_addr) != NULL) {
+        rc = BLE_HS_EDONE;
+        goto done;
+    }
+
     if (!ble_hs_conn_can_alloc()) {
         rc = BLE_HS_ENOMEM;
         goto done;


[15/17] incubator-mynewt-core git commit: ocd_sample - Fix broken build.

Posted by cc...@apache.org.
ocd_sample - Fix broken build.


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

Branch: refs/heads/develop
Commit: 0eed22ffd01c5f62b85728b4032e3b132c940bf0
Parents: 54086ac
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 17:31:48 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 17:31:48 2017 -0700

----------------------------------------------------------------------
 apps/ocf_sample/src/ocf_ble.c | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0eed22ff/apps/ocf_sample/src/ocf_ble.c
----------------------------------------------------------------------
diff --git a/apps/ocf_sample/src/ocf_ble.c b/apps/ocf_sample/src/ocf_ble.c
index 3fe3f9a..d93bdd9 100644
--- a/apps/ocf_sample/src/ocf_ble.c
+++ b/apps/ocf_sample/src/ocf_ble.c
@@ -74,17 +74,17 @@ static void
 ocf_ble_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
     OCF_BLE_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
-                desc->conn_handle, desc->our_ota_addr_type);
-    print_addr(desc->our_ota_addr);
+                desc->conn_handle, desc->our_ota_addr.type);
+    print_addr(desc->our_ota_addr.val);
     OCF_BLE_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
-                desc->our_id_addr_type);
-    print_addr(desc->our_id_addr);
+                desc->our_id_addr.type);
+    print_addr(desc->our_id_addr.val);
     OCF_BLE_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
-                desc->peer_ota_addr_type);
-    print_addr(desc->peer_ota_addr);
+                desc->peer_ota_addr.type);
+    print_addr(desc->peer_ota_addr.val);
     OCF_BLE_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
-                desc->peer_id_addr_type);
-    print_addr(desc->peer_id_addr);
+                desc->peer_id_addr.type);
+    print_addr(desc->peer_id_addr.val);
     OCF_BLE_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
@@ -145,7 +145,7 @@ ocf_ble_advertise(void)
     memset(&adv_params, 0, sizeof adv_params);
     adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
     adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
-    rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, 0, NULL, BLE_HS_FOREVER,
+    rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                            &adv_params, ocf_ble_gap_event, NULL);
     if (rc != 0) {
         OCF_BLE_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
@@ -257,22 +257,12 @@ static const uint8_t ocf_ble_addr[6] = {1,2,3,4,5,6};
 void
 ocf_ble_init(void)
 {
-    int rc;
-
     /* Initialize the ocf_ble log. */
     log_register("ocf_ble", &ocf_ble_log, &log_console_handler, NULL,
                  LOG_SYSLEVEL);
 
     memcpy(g_dev_addr, ocf_ble_addr, sizeof(g_dev_addr));
 
-    /* COAP Gatt server initialization */
-    rc = ble_coap_gatt_srv_init();
-    assert(rc == 0);
-
-    /* Set the default device name. */
-    rc = ble_svc_gap_device_name_set("Mynewt_OCF");
-    assert(rc == 0);
-
     /* Initialize the BLE host. */
     log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
                  LOG_SYSLEVEL);


[09/17] incubator-mynewt-core git commit: BLE UART xport - sysinit panic on init fail.

Posted by cc...@apache.org.
BLE UART xport - sysinit panic on init 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/c44b4ade
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c44b4ade
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c44b4ade

Branch: refs/heads/develop
Commit: c44b4adeae797ec89f32fe821f062a7f27ee33be
Parents: e51ce9d
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:38:19 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 .../uart/include/transport/uart/ble_hci_uart.h  |  2 +-
 net/nimble/transport/uart/src/ble_hci_uart.c    | 60 +++-----------------
 2 files changed, 9 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c44b4ade/net/nimble/transport/uart/include/transport/uart/ble_hci_uart.h
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/include/transport/uart/ble_hci_uart.h b/net/nimble/transport/uart/include/transport/uart/ble_hci_uart.h
index d54fd66..e5e1084 100644
--- a/net/nimble/transport/uart/include/transport/uart/ble_hci_uart.h
+++ b/net/nimble/transport/uart/include/transport/uart/ble_hci_uart.h
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-int ble_hci_uart_init(void);
+void ble_hci_uart_init(void);
 
 #ifdef __cplusplus
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c44b4ade/net/nimble/transport/uart/src/ble_hci_uart.c
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/src/ble_hci_uart.c b/net/nimble/transport/uart/src/ble_hci_uart.c
index 402c5a1..b1ffd8a 100755
--- a/net/nimble/transport/uart/src/ble_hci_uart.c
+++ b/net/nimble/transport/uart/src/ble_hci_uart.c
@@ -685,25 +685,6 @@ ble_hci_uart_free_pkt(uint8_t type, uint8_t *cmdevt, struct os_mbuf *acl)
     }
 }
 
-static void
-ble_hci_uart_free_mem(void)
-{
-    free(ble_hci_uart_evt_hi_buf);
-    ble_hci_uart_evt_hi_buf = NULL;
-
-    free(ble_hci_uart_evt_lo_buf);
-    ble_hci_uart_evt_lo_buf = NULL;
-
-    free(ble_hci_uart_pkt_buf);
-    ble_hci_uart_pkt_buf = NULL;
-
-    free(ble_hci_uart_acl_buf);
-    ble_hci_uart_acl_buf = NULL;
-
-    free(ble_hci_uart_cmd_buf);
-    ble_hci_uart_cmd_buf = NULL;
-}
-
 static int
 ble_hci_uart_config(void)
 {
@@ -967,7 +948,7 @@ ble_hci_trans_reset(void)
  * @return                      0 on success;
  *                              A BLE_ERR_[...] error code on failure.
  */
-int
+void
 ble_hci_uart_init(void)
 {
     int acl_data_length;
@@ -977,8 +958,6 @@ ble_hci_uart_init(void)
     /* Ensure this function only gets called by sysinit. */
     SYSINIT_ASSERT_ACTIVE();
 
-    ble_hci_uart_free_mem();
-
     /*
      * The MBUF payload size must accommodate the HCI data header size plus the
      * maximum ACL data packet length. The ACL block size is the size of the
@@ -994,14 +973,11 @@ ble_hci_uart_init(void)
                             acl_block_size,
                             "ble_hci_uart_acl_pool",
                             &ble_hci_uart_acl_buf);
-    if (rc != 0) {
-        rc = ble_err_from_os(rc);
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     rc = os_mbuf_pool_init(&ble_hci_uart_acl_mbuf_pool, &ble_hci_uart_acl_pool,
                            acl_block_size, MYNEWT_VAL(BLE_ACL_BUF_COUNT));
-    assert(rc == 0);
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     /*
      * Create memory pool of HCI command buffers. NOTE: we currently dont
@@ -1014,30 +990,21 @@ ble_hci_uart_init(void)
                             BLE_HCI_TRANS_CMD_SZ,
                             "ble_hci_uart_cmd_pool",
                             &ble_hci_uart_cmd_buf);
-    if (rc != 0) {
-        rc = ble_err_from_os(rc);
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     rc = mem_malloc_mempool(&ble_hci_uart_evt_hi_pool,
                             MYNEWT_VAL(BLE_HCI_EVT_HI_BUF_COUNT),
                             MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE),
                             "ble_hci_uart_evt_hi_pool",
                             &ble_hci_uart_evt_hi_buf);
-    if (rc != 0) {
-        rc = ble_err_from_os(rc);
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     rc = mem_malloc_mempool(&ble_hci_uart_evt_lo_pool,
                             MYNEWT_VAL(BLE_HCI_EVT_LO_BUF_COUNT),
                             MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE),
                             "ble_hci_uart_evt_lo_pool",
                             &ble_hci_uart_evt_lo_buf);
-    if (rc != 0) {
-        rc = ble_err_from_os(rc);
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     /*
      * Create memory pool of packet list nodes. NOTE: the number of these
@@ -1051,22 +1018,11 @@ ble_hci_uart_init(void)
                             sizeof (struct ble_hci_uart_pkt),
                             "ble_hci_uart_pkt_pool",
                             &ble_hci_uart_pkt_buf);
-    if (rc != 0) {
-        rc = ble_err_from_os(rc);
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     rc = ble_hci_uart_config();
-    if (rc != 0) {
-        goto err;
-    }
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     memset(&ble_hci_uart_state, 0, sizeof ble_hci_uart_state);
     STAILQ_INIT(&ble_hci_uart_state.tx_pkts);
-
-    return 0;
-
-err:
-    ble_hci_uart_free_mem();
-    return rc;
 }


[11/17] incubator-mynewt-core git commit: BLE Host - Make L2CAP CID definitions public.

Posted by cc...@apache.org.
BLE Host - Make L2CAP CID definitions public.


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

Branch: refs/heads/develop
Commit: 9b9820611e7554557612dc13b6b42b0019c7ec88
Parents: c44b4ad
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:39:36 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/host/include/host/ble_hs.h    | 1 +
 net/nimble/host/include/host/ble_l2cap.h | 4 ++++
 net/nimble/host/src/ble_l2cap_priv.h     | 4 ----
 3 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9b982061/net/nimble/host/include/host/ble_hs.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_hs.h b/net/nimble/host/include/host/ble_hs.h
index 8dd2296..ada830d 100644
--- a/net/nimble/host/include/host/ble_hs.h
+++ b/net/nimble/host/include/host/ble_hs.h
@@ -30,6 +30,7 @@
 #include "host/ble_hs_log.h"
 #include "host/ble_hs_test.h"
 #include "host/ble_hs_mbuf.h"
+#include "host/ble_l2cap.h"
 #include "host/ble_sm.h"
 #include "host/ble_store.h"
 #include "host/ble_uuid.h"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9b982061/net/nimble/host/include/host/ble_l2cap.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_l2cap.h b/net/nimble/host/include/host/ble_l2cap.h
index b3b03b9..0b54189 100644
--- a/net/nimble/host/include/host/ble_l2cap.h
+++ b/net/nimble/host/include/host/ble_l2cap.h
@@ -28,6 +28,10 @@ extern "C" {
 struct ble_l2cap_sig_update_req;
 struct ble_hs_conn;
 
+#define BLE_L2CAP_CID_ATT           4
+#define BLE_L2CAP_CID_SIG           5
+#define BLE_L2CAP_CID_SM            6
+
 #define BLE_L2CAP_SIG_OP_REJECT                 0x01
 #define BLE_L2CAP_SIG_OP_CONNECT_REQ            0x02
 #define BLE_L2CAP_SIG_OP_CONNECT_RSP            0x03

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9b982061/net/nimble/host/src/ble_l2cap_priv.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_priv.h b/net/nimble/host/src/ble_l2cap_priv.h
index 1d035e8..5bc8d83 100644
--- a/net/nimble/host/src/ble_l2cap_priv.h
+++ b/net/nimble/host/src/ble_l2cap_priv.h
@@ -49,10 +49,6 @@ extern STATS_SECT_DECL(ble_l2cap_stats) ble_l2cap_stats;
 
 extern struct os_mempool ble_l2cap_chan_pool;
 
-#define BLE_L2CAP_CID_ATT           4
-#define BLE_L2CAP_CID_SIG           5
-#define BLE_L2CAP_CID_SM            6
-
 /* This is nimble specific; packets sent to the black hole CID do not elicit
  * an "invalid CID" response.
  */


[04/17] incubator-mynewt-core git commit: baselibc - Optionally include file/line in assert.

Posted by cc...@apache.org.
baselibc - Optionally include file/line in assert.

To include filename and line number in assert messages, enable this
syscfg setting: BASELIBC_ASSERT_FILE_LINE

This behavior is disabled by default for non-native BSPs.  The native
bsp enables this setting.


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

Branch: refs/heads/develop
Commit: 537b2200e40ff38b977eb24aeda20b0c30db1960
Parents: 03fa865
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 28 16:24:56 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 hw/bsp/native/syscfg.yml       |  1 +
 libc/baselibc/include/assert.h | 11 ++++++++++-
 libc/baselibc/syscfg.yml       |  6 ++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/537b2200/hw/bsp/native/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/native/syscfg.yml b/hw/bsp/native/syscfg.yml
index 89171a5..9ca0608 100644
--- a/hw/bsp/native/syscfg.yml
+++ b/hw/bsp/native/syscfg.yml
@@ -18,6 +18,7 @@
 #
 
 syscfg.vals:
+    BASELIBC_ASSERT_FILE_LINE: 1
     NFFS_FLASH_AREA: FLASH_AREA_NFFS
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/537b2200/libc/baselibc/include/assert.h
----------------------------------------------------------------------
diff --git a/libc/baselibc/include/assert.h b/libc/baselibc/include/assert.h
index 68f2f86..8a131b5 100644
--- a/libc/baselibc/include/assert.h
+++ b/libc/baselibc/include/assert.h
@@ -5,6 +5,8 @@
 #ifndef _ASSERT_H
 #define _ASSERT_H
 
+#include "syscfg/syscfg.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -25,7 +27,14 @@ extern "C" {
 extern void __assert_func(const char *, int, const char *, const char *)
     __attribute((noreturn));
 
-#define assert(x) ((x) ? (void)0 : __assert_func(NULL, 0, NULL, NULL))
+#if MYNEWT_VAL(BASELIBC_ASSERT_FILE_LINE)
+#define assert(x) ((x) ? (void)0 : \
+    __assert_func(__FILE__, __LINE__, NULL, NULL))
+#else
+#define assert(x) ((x) ? (void)0 : \
+    __assert_func(NULL, 0, NULL, NULL))
+#endif
+
 
 #endif
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/537b2200/libc/baselibc/syscfg.yml
----------------------------------------------------------------------
diff --git a/libc/baselibc/syscfg.yml b/libc/baselibc/syscfg.yml
index 7ec5b18..62188e1 100644
--- a/libc/baselibc/syscfg.yml
+++ b/libc/baselibc/syscfg.yml
@@ -4,3 +4,9 @@ syscfg.defs:
     BASELIBC_PRESENT:
         description: "Indicates that baselibc is the libc implementation."
         value: 1
+
+    BASELIBC_ASSERT_FILE_LINE:
+        description: >
+            Include filename and line number in assert messages.  Aids in
+            debugging, but increases text size.
+        value: 0


[14/17] incubator-mynewt-core git commit: sim - Terminate on assert failure.

Posted by cc...@apache.org.
sim - Terminate on assert failure.

Prior to this change, the process would just hang.


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

Branch: refs/heads/develop
Commit: 4fa3357158846d5a45a414954c0e6a45b35048d8
Parents: 7019142
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Mar 8 14:58:43 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 kernel/os/src/arch/sim/os_fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4fa33571/kernel/os/src/arch/sim/os_fault.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/arch/sim/os_fault.c b/kernel/os/src/arch/sim/os_fault.c
index 92d7aa0..3bcd76a 100644
--- a/kernel/os/src/arch/sim/os_fault.c
+++ b/kernel/os/src/arch/sim/os_fault.c
@@ -37,5 +37,5 @@ __assert_func(const char *file, int line, const char *func, const char *e)
     }
     len = write(1, msg, strlen(msg));
     (void)len;
-    _exit(1);
+    _Exit(1);
 }


[02/17] incubator-mynewt-core git commit: BLE uart transport: Add text to sysinit panic.

Posted by cc...@apache.org.
BLE uart transport: Add text to sysinit panic.


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

Branch: refs/heads/develop
Commit: 70191424871b916134ff9829d59bb12075790de9
Parents: eddcf8f
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 7 17:19:15 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 28 16:58:41 2017 -0700

----------------------------------------------------------------------
 net/nimble/transport/uart/src/ble_hci_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/70191424/net/nimble/transport/uart/src/ble_hci_uart.c
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/src/ble_hci_uart.c b/net/nimble/transport/uart/src/ble_hci_uart.c
index b1ffd8a..6584112 100755
--- a/net/nimble/transport/uart/src/ble_hci_uart.c
+++ b/net/nimble/transport/uart/src/ble_hci_uart.c
@@ -1021,7 +1021,7 @@ ble_hci_uart_init(void)
     SYSINIT_PANIC_ASSERT(rc == 0);
 
     rc = ble_hci_uart_config();
-    SYSINIT_PANIC_ASSERT(rc == 0);
+    SYSINIT_PANIC_ASSERT_MSG(rc == 0, "Failure configuring UART HCI");
 
     memset(&ble_hci_uart_state, 0, sizeof ble_hci_uart_state);
     STAILQ_INIT(&ble_hci_uart_state.tx_pkts);