[GitHub] [mynewt-nimble] joonazan commented on issue #789: How to use ble_gap_connect?

2020-04-22 Thread GitBox


joonazan commented on issue #789:
URL: https://github.com/apache/mynewt-nimble/issues/789#issuecomment-618089980


   I know that. I want a frequent connection interval so that I can transfer 
more and with less latency.
   
   But I don't think I can call ble_gap_connect. It isn't called anywhere in 
the esp-idf examples.
   
   I start advertising with ble_gap_adv_start and then I get a callback after a 
connection is created. So I guess that some code is calling ble_gap_connect for 
me.
   
   Link to my code: 
https://github.com/joonazan/nina-fast-bluetooth/blob/master/extras/nina-src/main/ble_connection.c



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-22 Thread GitBox


apache-mynewt-bot commented on issue #806:
URL: https://github.com/apache/mynewt-nimble/pull/806#issuecomment-618084446


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/controller/src/ble_ll_iso.c
   
   
   ```diff
   @@ -93,7 +93,8 @@
return BLE_ERR_UNSUPPORTED;
}

   -int ble_ll_iso_big_create_sync(const uint8_t *cmdbuf, uint8_t len)
   +int
   +ble_ll_iso_big_create_sync(const uint8_t *cmdbuf, uint8_t len)
{
return BLE_ERR_UNSUPPORTED;
}
   ```
   
   
   
    nimble/controller/src/ble_ll_conn_hci.c
   
   
   ```diff
   @@ -1563,7 +1563,7 @@
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
int
ble_ll_conn_req_peer_sca(const uint8_t *cmdbuf, uint8_t len,
   -  uint8_t *rspbuf, uint8_t *rsplen)
   + uint8_t *rspbuf, uint8_t *rsplen)
{
const struct ble_hci_le_request_peer_sca_cp *params = (const void 
*)cmdbuf;
struct ble_ll_conn_sm *connsm;
   ```
   
   
   
    nimble/controller/src/ble_ll_hci.c
   
   
   ```diff
   @@ -1183,7 +1184,7 @@
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAM:
   -rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
   +rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
   ```
   
   
   
    nimble/controller/src/ble_ll_supp_cmd.c
   
   
   ```diff
   @@ -415,13 +415,13 @@
#endif

#define BLE_LL_SUPP_CMD_OCTET_41\
   -(   \
   -BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2 |  \
   -BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC |  \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2 |  \
   +BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC |  \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   +)

/* Octet 42 */
#if MYNEWT_VAL(BLE_ISO)
   @@ -444,16 +444,16 @@
#define BLE_SUPP_CMD_LE_TERMINATE_BIG (0 << 7)
#endif
#define BLE_LL_SUPP_CMD_OCTET_42\
   -(   \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST |\
   -BLE_SUPP_CMD_LE_CREATE_CIS |\
   -BLE_SUPP_CMD_LE_REMOVE_CIG |\
   -BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ |\
   -BLE_SUPP_CMD_LE_REJECT_CIS_REQ |\
   -BLE_SUPP_CMD_LE_CREATE_BIG  |   \
   -BLE_SUPP_CMD_LE_CREATE_BIG_TEST |   \
   -BLE_SUPP_CMD_LE_TERMINATE_BIG   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST |\
   +BLE_SUPP_CMD_LE_CREATE_CIS |\
   +BLE_SUPP_CMD_LE_REMOVE_CIG |\
   +BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ |\
   +BLE_SUPP_CMD_LE_REJECT_CIS_REQ |\
   +BLE_SUPP_CMD_LE_CREATE_BIG  |   \
   +BLE_SUPP_CMD_LE_CREATE_BIG_TEST |   \
   +BLE_SUPP_CMD_LE_TERMINATE_BIG   \
   +)

/* Octet 43 */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
   @@ -462,9 +462,9 @@
#define BLE_SUPP_CMD_LE_REQUEST_PEER_SCA (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_43\
   -(   \
   -BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   +)

/* Octet 44 */
#if MYNEWT_VAL(BLE_VERSION) >= 52
   @@ -473,13 +473,12 @@
#define BLE_SUPP_CMD_LE_SET_HOST_FEATURE (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_44\
   -(   \
   -BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   +)

/* Defines the array of supported commands */
   -const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] =
   -{
   +const uint8_t 

[mynewt-core] branch master updated: sys/config: read/write access config for mgmt cmd

2020-04-22 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
 new 3118782  sys/config: read/write access config for mgmt cmd
 new e437573  Merge pull request #2277 from ccollins476ad/config-mgmt-rw
3118782 is described below

commit 3118782f981ee96bec464527792126fec0696b07
Author: Christopher Collins 
AuthorDate: Tue Apr 21 13:52:43 2020 -0700

sys/config: read/write access config for mgmt cmd

Before commit: the `CONFIG_MGMT` syscfg setting disabled or enabled the
config newtmgr command in its entirety.  There was no way to enable only
the read half of the command (for example).

After commit: there is a second syscfg setting: `CONFIG_MGMT_RW`.  The
semantics mirror the `CONFIG_CLI_RW` setting.  That is:

* If `CONFIG_MGMT` is 0, the entire command is disabled.

Otherwise:

* If `CONFIG_MGMT_RW` is 1, only read commands are allowed.
* If `CONFIG_MGMT_RW` is 2, only write commands are allowed.
* If `CONFIG_MGMT_RW` is 3, both reads and writes are allowed.
---
 sys/config/src/config_mgmt.c | 24 +++-
 sys/config/syscfg.yml|  7 +++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/sys/config/src/config_mgmt.c b/sys/config/src/config_mgmt.c
index f74bae7..9a8fe7d 100644
--- a/sys/config/src/config_mgmt.c
+++ b/sys/config/src/config_mgmt.c
@@ -28,11 +28,29 @@
 #include "config/config.h"
 #include "config_priv.h"
 
+#define CONFIG_MGMT_READ(MYNEWT_VAL(CONFIG_MGMT_RW) & 1)
+#define CONFIG_MGMT_WRITE   (MYNEWT_VAL(CONFIG_MGMT_RW) & 2)
+
+#if CONFIG_MGMT_READ
 static int conf_mgmt_read(struct mgmt_ctxt *);
+#endif
+#if CONFIG_MGMT_WRITE
 static int conf_mgmt_write(struct mgmt_ctxt *);
+#endif
 
 static const struct mgmt_handler conf_mgmt_handlers[] = {
-[CONF_NMGR_OP] = { conf_mgmt_read, conf_mgmt_write}
+[CONF_NMGR_OP] = {
+#if CONFIG_MGMT_READ
+conf_mgmt_read,
+#else
+NULL,
+#endif
+#if CONFIG_MGMT_WRITE
+conf_mgmt_write,
+#else
+NULL,
+#endif
+}
 };
 
 static struct mgmt_group conf_mgmt_group = {
@@ -41,6 +59,7 @@ static struct mgmt_group conf_mgmt_group = {
 .mg_group_id = MGMT_GROUP_ID_CONFIG
 };
 
+#if CONFIG_MGMT_READ
 static int
 conf_mgmt_read(struct mgmt_ctxt *cb)
 {
@@ -80,7 +99,9 @@ conf_mgmt_read(struct mgmt_ctxt *cb)
 }
 return 0;
 }
+#endif
 
+#if CONFIG_MGMT_WRITE
 static int
 conf_mgmt_write(struct mgmt_ctxt *cb)
 {
@@ -141,6 +162,7 @@ conf_mgmt_write(struct mgmt_ctxt *cb)
 }
 return 0;
 }
+#endif
 
 int
 conf_mgmt_register(void)
diff --git a/sys/config/syscfg.yml b/sys/config/syscfg.yml
index d8e5dbd..e615a59 100644
--- a/sys/config/syscfg.yml
+++ b/sys/config/syscfg.yml
@@ -41,6 +41,13 @@ syscfg.defs:
 description: 'SMP access to config'
 value: 0
 
+CONFIG_MGMT_RW:
+description: >
+Config management access: 1=read-only, 2=write-only, 3=read/write
+No effect if `CONFIG_MGMT` is 0.
+value: 3
+range: 1,2,3
+
 CONFIG_CLI:
 description: 'CLI commands for accessing config'
 value: 0



[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #796: Apps: central added

2020-04-22 Thread GitBox


rymanluk commented on a change in pull request #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r413378943



##
File path: apps/central/src/main.c
##
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+ble_addr_t addr;
+int rc;
+
+/* generate new non-resolvable private address */
+rc = ble_hs_id_gen_rnd(0, );
+assert(rc == 0);
+
+/* set generated address */
+rc = ble_hs_id_set_rnd(addr.val);
+assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+int rc;
+switch (event->type) {
+case BLE_GAP_EVENT_CONNECT:
+if (event->connect.status == 0) {
+MODLOG_DFLT(INFO,"Connection was fully established\n");
+/* Set PHY for established conection */
+rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+ BLE_GAP_LE_PHY_2M_MASK,
+ BLE_GAP_LE_PHY_2M_MASK,
+ BLE_GAP_LE_PHY_CODED_ANY);
+if (rc == 0) {
+MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+} else {
+MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+}
+ble_gap_terminate(event->connect.conn_handle, 0x13);

Review comment:
   Event is sent on  both sides.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[mynewt-nimble] branch master updated: nimble/host: Add return parameter to the ble_hs_misc_conn_chan_find_reqd()

2020-04-22 Thread rymek
This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
 new 6ced1dd  nimble/host: Add return parameter to the 
ble_hs_misc_conn_chan_find_reqd()
6ced1dd is described below

commit 6ced1dd4ca63e6f0bd2df7dcc558afcc2896f1c2
Author: h2zero 
AuthorDate: Sat Apr 18 20:42:41 2020 -0600

nimble/host: Add return parameter to the ble_hs_misc_conn_chan_find_reqd()

ble_hs_misc_conn_chan_find_reqd() did not return an error code if
the connection and or the channel were not found, i.e in a disconnected 
state.
When debug is not enabled and `ble_hs_misc_conn_chan_find_reqd()` is called 
and
the device has disconnected from the peer various functions may attempt to 
access
memory that is not valid causing an null pointer exception.
---
 nimble/host/src/ble_att_cmd.c   |  7 +++
 nimble/host/src/ble_hs_misc.c   |  8 ++--
 nimble/host/src/ble_hs_priv.h   |  6 +++---
 nimble/host/src/ble_l2cap_sig.c |  9 +++--
 nimble/host/src/ble_l2cap_sig_cmd.c |  8 +---
 nimble/host/src/ble_sm_cmd.c| 11 ---
 6 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/nimble/host/src/ble_att_cmd.c b/nimble/host/src/ble_att_cmd.c
index a123c85..81b070f 100644
--- a/nimble/host/src/ble_att_cmd.c
+++ b/nimble/host/src/ble_att_cmd.c
@@ -66,11 +66,10 @@ ble_att_tx(uint16_t conn_handle, struct os_mbuf *txom)
 
 ble_hs_lock();
 
-ble_hs_misc_conn_chan_find_reqd(conn_handle, BLE_L2CAP_CID_ATT, ,
-);
-if (chan == NULL) {
+rc = ble_hs_misc_conn_chan_find_reqd(conn_handle, BLE_L2CAP_CID_ATT, ,
+ );
+if (rc != 0) {
 os_mbuf_free_chain(txom);
-rc = BLE_HS_ENOTCONN;
 } else {
 ble_att_truncate_to_mtu(chan, txom);
 rc = ble_l2cap_tx(conn, chan, txom);
diff --git a/nimble/host/src/ble_hs_misc.c b/nimble/host/src/ble_hs_misc.c
index 6c6da46..dfb46b7 100644
--- a/nimble/host/src/ble_hs_misc.c
+++ b/nimble/host/src/ble_hs_misc.c
@@ -56,7 +56,7 @@ ble_hs_misc_conn_chan_find(uint16_t conn_handle, uint16_t cid,
 return rc;
 }
 
-void
+int
 ble_hs_misc_conn_chan_find_reqd(uint16_t conn_handle, uint16_t cid,
 struct ble_hs_conn **out_conn,
 struct ble_l2cap_chan **out_chan)
@@ -66,7 +66,9 @@ ble_hs_misc_conn_chan_find_reqd(uint16_t conn_handle, 
uint16_t cid,
 int rc;
 
 rc = ble_hs_misc_conn_chan_find(conn_handle, cid, , );
-BLE_HS_DBG_ASSERT_EVAL(rc == 0);
+if (rc != 0) {
+return rc;
+}
 
 if (out_conn != NULL) {
 *out_conn = conn;
@@ -74,6 +76,8 @@ ble_hs_misc_conn_chan_find_reqd(uint16_t conn_handle, 
uint16_t cid,
 if (out_chan != NULL) {
 *out_chan = chan;
 }
+
+return 0;
 }
 
 uint8_t
diff --git a/nimble/host/src/ble_hs_priv.h b/nimble/host/src/ble_hs_priv.h
index 2cad6ef..538d07a 100644
--- a/nimble/host/src/ble_hs_priv.h
+++ b/nimble/host/src/ble_hs_priv.h
@@ -114,9 +114,9 @@ int ble_hs_hci_evt_acl_process(struct os_mbuf *om);
 int ble_hs_misc_conn_chan_find(uint16_t conn_handle, uint16_t cid,
struct ble_hs_conn **out_conn,
struct ble_l2cap_chan **out_chan);
-void ble_hs_misc_conn_chan_find_reqd(uint16_t conn_handle, uint16_t cid,
- struct ble_hs_conn **out_conn,
- struct ble_l2cap_chan **out_chan);
+int ble_hs_misc_conn_chan_find_reqd(uint16_t conn_handle, uint16_t cid,
+struct ble_hs_conn **out_conn,
+struct ble_l2cap_chan **out_chan);
 uint8_t ble_hs_misc_own_addr_type_to_id(uint8_t addr_type);
 uint8_t ble_hs_misc_peer_addr_type_to_id(uint8_t addr_type);
 int ble_hs_misc_restore_irks(void);
diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c
index bb4d8a5..58f96b0 100644
--- a/nimble/host/src/ble_l2cap_sig.c
+++ b/nimble/host/src/ble_l2cap_sig.c
@@ -508,8 +508,13 @@ ble_l2cap_sig_update(uint16_t conn_handle,
 STATS_INC(ble_l2cap_stats, update_init);
 
 ble_hs_lock();
-ble_hs_misc_conn_chan_find_reqd(conn_handle, BLE_L2CAP_CID_SIG,
-, );
+rc = ble_hs_misc_conn_chan_find_reqd(conn_handle, BLE_L2CAP_CID_SIG,
+ , );
+if (rc != 0) {
+ble_hs_unlock();
+goto done;
+}
+
 master = conn->bhc_flags & BLE_HS_CONN_F_MASTER;
 ble_hs_unlock();
 
diff --git a/nimble/host/src/ble_l2cap_sig_cmd.c 
b/nimble/host/src/ble_l2cap_sig_cmd.c
index 366dde6..510420f 100644
--- a/nimble/host/src/ble_l2cap_sig_cmd.c
+++ b/nimble/host/src/ble_l2cap_sig_cmd.c
@@ -28,9 +28,11 @@ 

[GitHub] [mynewt-nimble] rymanluk opened a new pull request #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-22 Thread GitBox


rymanluk opened a new pull request #806:
URL: https://github.com/apache/mynewt-nimble/pull/806


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[mynewt-core] branch master updated (23aa366 -> 8eac241)

2020-04-22 Thread mlaz
This is an automated email from the ASF dual-hosted git repository.

mlaz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


from 23aa366  watchdog: Fix places that ignore WATCHDOG_INTERVAL=0
 new a4748ea  hw/drivers/semihosting: Add raw semihosting driver
 new eea7263  sys/console/full: Add ARM semihosting tx implementation
 new 4f26d12  hw/bsp/pinetime: Enable ARM semihosting console
 new 8eac241  Merge pull request #2259 from caspermeijn/semihosting-pinetime

The 9601 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .style_ignored_dirs|   1 +
 hw/bsp/pinetime/pinetime_debug.sh  |   1 +
 hw/bsp/pinetime/syscfg.yml |   4 +
 .../include/semihosting/mbed_semihost_api.h|  89 +++
 hw/{bus => drivers/semihosting}/pkg.yml|  15 +--
 hw/drivers/semihosting/src/mbed_semihost_api.c | 122 +
 sys/console/full/pkg.yml   |   2 +
 sys/console/full/src/console.c |   3 +
 sys/console/full/src/console_priv.h|   1 +
 sys/console/full/src/semihosting_console.c |  78 +
 sys/console/full/syscfg.yml|   7 ++
 11 files changed, 316 insertions(+), 7 deletions(-)
 create mode 100644 
hw/drivers/semihosting/include/semihosting/mbed_semihost_api.h
 copy hw/{bus => drivers/semihosting}/pkg.yml (80%)
 create mode 100644 hw/drivers/semihosting/src/mbed_semihost_api.c
 create mode 100644 sys/console/full/src/semihosting_console.c



[mynewt-newt] branch master updated: INSTALLING.md fix

2020-04-22 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
 new c2f8b25  INSTALLING.md fix
c2f8b25 is described below

commit c2f8b25c301bf60b45857f412dcc82f04395850b
Author: Krzysztof Kopyściński 
AuthorDate: Thu Mar 26 09:57:10 2020 +0100

INSTALLING.md fix

- corrected requiered version of Go
- second method of installation made easier
---
 INSTALLING.md | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/INSTALLING.md b/INSTALLING.md
index 5b01c5a..2d97f74 100644
--- a/INSTALLING.md
+++ b/INSTALLING.md
@@ -11,7 +11,7 @@ when available.  To find these, please go to 
https://mynewt.apache.org/.
 # Installing From Source
 
 The newt tool is written in Go (https://golang.org/).  In order to build Apache
-Mynewt, you must have Go 1.10 or later installed on your system.  Please visit
+Mynewt, you must have Go 1.12 or later installed on your system.  Please visit
 the Golang website for more information on installing Go (https://golang.org/).
 
 Once you have Go installed, you can build newt by running the contained
@@ -25,12 +25,14 @@ following path, relative to the source directory:
 If you do not wish to run the included script, you can build newt manually 
with Go as follows (executed from the source directory):
 
 ```no-highlight
-$ mkdir "$GOPATH"/src/mynewt.apache.org
-$ cp -r * "$GOPATH"/src/mynewt.apache.org # Or untar to this path
-$ go install mynewt.apache.org/newt/newt
+$ cd "$GOPATH"/src/
+$ git clone https://github.com/apache/mynewt-newt
+$ cd mynewt-newt/newt
+$ go get
+$ go build
 ```
 
-This puts the newt binary in $GOPATH/bin
+This downloads the dependencies and builds newt executable.
 
 You can test the installation by running newt:
 



[GitHub] [mynewt-newt] ccollins476ad opened a new pull request #395: Log exported environnment variables with `-ldebug`

2020-04-22 Thread GitBox


ccollins476ad opened a new pull request #395:
URL: https://github.com/apache/mynewt-newt/pull/395


   This PR adds some additional information to the debug log.
   
   Here is an example from a `newt build -ldebug <...>` run:
   ```
   2020/04/22 10:39:03.864 [DEBUG] exporting environment variables:
   2020/04/22 10:39:03.865 [DEBUG] BIN_ROOT=/Users/ccollins/proj/myproj/bin
   2020/04/22 10:39:03.865 [DEBUG] 
BSP_PATH=/Users/ccollins/proj/myproj/repos/apache-mynewt-core/hw/bsp/native
   2020/04/22 10:39:03.865 [DEBUG] 
CORE_PATH=/Users/ccollins/proj/myproj/repos/apache-mynewt-core
   2020/04/22 10:39:03.866 [DEBUG] 
MYNEWT_NEWT_PATH=/Users/ccollins/go/bin/newt
   2020/04/22 10:39:03.866 [DEBUG] 
MYNEWT_PROJECT_ROOT=/Users/ccollins/proj/myproj
   ```



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-newt] ccollins476ad commented on issue #391: Fix for @repo targets in mfg create

2020-04-22 Thread GitBox


ccollins476ad commented on issue #391:
URL: https://github.com/apache/mynewt-newt/pull/391#issuecomment-617932870


   @dwld I wonder if this could be a Windows-specific issue you are seeing.  Do 
you think you could show an example without redacting any paths?  Unfortunately 
I don't have a Windows machine available to test this on.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #389: INSTALLING.md fix

2020-04-22 Thread GitBox


ccollins476ad commented on a change in pull request #389:
URL: https://github.com/apache/mynewt-newt/pull/389#discussion_r413189852



##
File path: INSTALLING.md
##
@@ -25,12 +25,13 @@ following path, relative to the source directory:
 If you do not wish to run the included script, you can build newt manually 
with Go as follows (executed from the source directory):
 
 ```no-highlight
-$ mkdir "$GOPATH"/src/mynewt.apache.org
-$ cp -r * "$GOPATH"/src/mynewt.apache.org # Or untar to this path
-$ go install mynewt.apache.org/newt/newt
+$ cd "$GOPATH"/src/
+$ git clone https://github.com/apache/mynewt-newt
+$ cd mynewt-newt/newt
+$ go get
 ```
 
-This puts the newt binary in $GOPATH/bin
+This builds the newt from repository and installs it in the system.

Review comment:
   `go get` builds the specified package and puts the binary in 
`$GOPATH/bin`.  E.g.,
   ```
   [ccollins@ccollins:~]$ go version
   go version go1.14.1 darwin/amd64
   [ccollins@ccollins:~]$ newt version
   -bash: newt: command not found
   [ccollins@ccollins:~]$ go get mynewt.apache.org/newt/newt
   go: found mynewt.apache.org/newt/newt in mynewt.apache.org/newt 
v0.0.0-20200409145402-c5d1e422bfa3
   [ccollins@ccollins:~]$ newt version
   Apache Newt 1.9.0-dev / unknown / unknown
   [ccollins@ccollins:~]$ which newt
   /Users/ccollins/go/bin/newt
   ```
   
   `go get` behaves slightly differently depending on what directory you run it 
from.  The command always downloads the package's dependencies and builds the 
package.  But if you run the command from within the directory of a go package, 
the command *additionally* adds the specified package to the current package's 
dependency list (i.e., it modifies `go.mod` and `go.sum`).  I really wish they 
hadn't overloaded `go get` in this way. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot commented on issue #2259: ARM semihosting console on pinetime

2020-04-22 Thread GitBox


apache-mynewt-bot commented on issue #2259:
URL: https://github.com/apache/mynewt-core/pull/2259#issuecomment-617775696


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on issue #2259: ARM semihosting console on pinetime

2020-04-22 Thread GitBox


apache-mynewt-bot removed a comment on issue #2259:
URL: https://github.com/apache/mynewt-core/pull/2259#issuecomment-617147591


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/drivers/semihosting/include/semihosting/mbed_semihost_api.h
   
   
   ```diff
   @@ -1,4 +1,3 @@
   -
/* mbed Microcontroller Library
 * Copyright (c) 2006-2019 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
   @@ -27,7 +26,8 @@
#if !defined(__ARMCC_VERSION)

#if defined(__ICCARM__)
   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
{
return __semihosting(reason, (void *)arg);
}
   @@ -43,19 +43,20 @@
#   define AngelSWIAsm  swi
#endif

   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
{
int value;

   -asm volatile(
   +asm volatile (
"mov r0, %1"  "\n\t"
"mov r1, %2"  "\n\t"
AngelSWIInsn " %a3"   "\n\t"
"mov %0, r0"
   -: "=r"(value)  /* output 
operands */
   -: "r"(reason), "r"(arg), "i"(AngelSWI) /* input 
operands  */
   +: "=r" (value)  /* output 
operands */
   +: "r" (reason), "r" (arg), "i" (AngelSWI) /* input 
operands  */
: "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc"   /* list of 
clobbered registers */
   -);
   +);

return value;
}
   ```
   
   
   
    hw/drivers/semihosting/src/mbed_semihost_api.c
   
   
   ```diff
   @@ -20,7 +20,7 @@
#include 
#include 

   -// ARM Semihosting Commands
   +/* ARM Semihosting Commands */
#define SYS_OPEN   (0x1)
#define SYS_CLOSE  (0x2)
#define SYS_WRITE  (0x5)
   @@ -33,7 +33,8 @@
#define SYS_RENAME (0xf)
#define SYS_EXIT   (0x18)

   -FILEHANDLE semihost_open(const char *name, int openmode)
   +FILEHANDLE
   +semihost_open(const char *name, int openmode)
{
uint32_t args[3];
args[0] = (uint32_t)name;
   @@ -42,12 +43,14 @@
return __semihost(SYS_OPEN, args);
}

   -int semihost_close(FILEHANDLE fh)
   +int
   +semihost_close(FILEHANDLE fh)
{
return __semihost(SYS_CLOSE, );
}

   -int semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
{
if (length == 0) {
return 0;
   @@ -60,7 +63,8 @@
return __semihost(SYS_WRITE, args);
}

   -int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, 
int mode)
{
uint32_t args[3];
args[0] = (uint32_t)fh;
   @@ -69,12 +73,14 @@
return __semihost(SYS_READ, args);
}

   -int semihost_istty(FILEHANDLE fh)
   +int
   +semihost_istty(FILEHANDLE fh)
{
return __semihost(SYS_ISTTY, );
}

   -int semihost_seek(FILEHANDLE fh, long position)
   +int
   +semihost_seek(FILEHANDLE fh, long position)
{
uint32_t args[2];
args[0] = (uint32_t)fh;
   @@ -82,17 +88,20 @@
return __semihost(SYS_SEEK, args);
}

   -int semihost_ensure(FILEHANDLE fh)
   +int
   +semihost_ensure(FILEHANDLE fh)
{
return __semihost(SYS_ENSURE, );
}

   -long semihost_flen(FILEHANDLE fh)
   +long
   +semihost_flen(FILEHANDLE fh)
{
return __semihost(SYS_FLEN, );
}

   -int semihost_remove(const char *name)
   +int
   +semihost_remove(const char *name)
{
uint32_t args[2];
args[0] = (uint32_t)name;
   @@ -100,7 +109,8 @@
return __semihost(SYS_REMOVE, args);
}

   -int semihost_rename(const char *old_name, const char *new_name)
   +int
   +semihost_rename(const char *old_name, const char *new_name)
{
uint32_t args[4];
args[0] = (uint32_t)old_name;
   @@ -110,13 +120,15 @@
return __semihost(SYS_RENAME, args);
}

   -int semihost_exit(void)
   +int
   +semihost_exit(void)
{
uint32_t args[4];
return __semihost(SYS_EXIT, args);
}

   -int semihost_connected(void)
   +int
   +semihost_connected(void)
{
return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0;
}
   ```
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For 

[GitHub] [mynewt-core] caspermeijn commented on issue #2259: ARM semihosting console on pinetime

2020-04-22 Thread GitBox


caspermeijn commented on issue #2259:
URL: https://github.com/apache/mynewt-core/pull/2259#issuecomment-617740847


   Added raw semihosting driver to the .style_ignored_dirs



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[mynewt-nimble] branch master updated: nimble/gap: Fix storing CCC for bonded devices.

2020-04-22 Thread rymek
This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
 new 2da39a1  nimble/gap: Fix storing CCC for bonded devices.
2da39a1 is described below

commit 2da39a1fe53a635252cc04cac3f8df7305af4eca
Author: Łukasz Rymanowski 
AuthorDate: Tue Apr 21 09:48:02 2020 +0200

nimble/gap: Fix storing CCC for bonded devices.

This PR make sure that ble_gatts_bonding_established is called only when
bonded.

Note: renamed not used "persist_keys" to "bonded" and make use of it

Bug can be easly reproduced when
BLE_SM_BONDING: 0
BLE_HS_DEBUG: 1

Program received signal SIGTRAP, Trace/breakpoint trap.
ble_gatts_bonding_established (conn_handle=conn_handle@entry=1) at 
repos/apache-mynewt-nimble/nimble/host/src/ble_gatts.c:1681
1681BLE_HS_DBG_ASSERT(conn->bhc_sec_state.bonded);
(gdb)
---
 nimble/host/src/ble_gap.c  | 27 ---
 nimble/host/src/ble_gap_priv.h |  2 +-
 nimble/host/src/ble_sm.c   |  5 +++--
 nimble/host/src/ble_sm_priv.h  |  8 
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 53c6bf3..4df3b7b 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -5654,7 +5654,8 @@ ble_gap_passkey_event(uint16_t conn_handle,
 }
 
 void
-ble_gap_enc_event(uint16_t conn_handle, int status, int security_restored)
+ble_gap_enc_event(uint16_t conn_handle, int status,
+  int security_restored, int bonded)
 {
 #if NIMBLE_BLE_SM
 struct ble_gap_event event;
@@ -5667,12 +5668,24 @@ ble_gap_enc_event(uint16_t conn_handle, int status, int 
security_restored)
 ble_gap_event_listener_call();
 ble_gap_call_conn_event_cb(, conn_handle);
 
-if (status == 0) {
-if (security_restored) {
-ble_gatts_bonding_restored(conn_handle);
-} else {
-ble_gatts_bonding_established(conn_handle);
-}
+if (status != 0) {
+return;
+}
+
+/* If encryption succeded and encryption has been restored for bonded 
device,
+ * notify gatt server so it has chance to send notification/indication if 
needed.
+ */
+if (security_restored) {
+ble_gatts_bonding_restored(conn_handle);
+return;
+}
+
+/* If this is fresh pairing and bonding has been established,
+ * notify gatt server about that so previous subscriptions (before bonding)
+ * can be stored.
+ */
+if (bonded) {
+ble_gatts_bonding_established(conn_handle);
 }
 #endif
 }
diff --git a/nimble/host/src/ble_gap_priv.h b/nimble/host/src/ble_gap_priv.h
index c050435..499823b 100644
--- a/nimble/host/src/ble_gap_priv.h
+++ b/nimble/host/src/ble_gap_priv.h
@@ -116,7 +116,7 @@ int ble_gap_rx_l2cap_update_req(uint16_t conn_handle,
 struct ble_gap_upd_params *params);
 void ble_gap_rx_phy_update_complete(const struct 
ble_hci_ev_le_subev_phy_update_complete *ev);
 void ble_gap_enc_event(uint16_t conn_handle, int status,
-   int security_restored);
+   int security_restored, int bonded);
 void ble_gap_passkey_event(uint16_t conn_handle,
struct ble_gap_passkey_params *passkey_params);
 void ble_gap_notify_rx_event(uint16_t conn_handle, uint16_t attr_handle,
diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c
index cfd80fc..91afb75 100644
--- a/nimble/host/src/ble_sm.c
+++ b/nimble/host/src/ble_sm.c
@@ -938,7 +938,7 @@ ble_sm_process_result(uint16_t conn_handle, struct 
ble_sm_result *res)
 
 if (res->enc_cb) {
 BLE_HS_DBG_ASSERT(proc == NULL || rm);
-ble_gap_enc_event(conn_handle, res->app_status, res->restore);
+ble_gap_enc_event(conn_handle, res->app_status, res->restore, 
res->bonded);
 }
 
 if (res->app_status == 0 &&
@@ -1190,6 +1190,7 @@ ble_sm_enc_event_rx(uint16_t conn_handle, uint8_t 
evt_status, int encrypted)
 
 ble_hs_unlock();
 
+res.bonded = bonded;
 ble_sm_process_result(conn_handle, );
 }
 
@@ -2425,7 +2426,7 @@ ble_sm_timer(void)
  * procedures without reconnect.
  */
 while ((proc = STAILQ_FIRST(_list)) != NULL) {
-ble_gap_enc_event(proc->conn_handle, BLE_HS_ETIMEOUT, 0);
+ble_gap_enc_event(proc->conn_handle, BLE_HS_ETIMEOUT, 0, 0);
 
 STAILQ_REMOVE_HEAD(_list, next);
 ble_sm_proc_free(proc);
diff --git a/nimble/host/src/ble_sm_priv.h b/nimble/host/src/ble_sm_priv.h
index 6d5601b..27e75aa 100644
--- a/nimble/host/src/ble_sm_priv.h
+++ b/nimble/host/src/ble_sm_priv.h
@@ -279,10 +279,10 @@ struct ble_sm_result {
 uint8_t sm_err;
 struct ble_gap_passkey_params passkey_params;
 void *state_arg;
-unsigned execute:1;
-

[mynewt-nimble] branch master updated: nimble/store: Make it clear store/ram is deprecated

2020-04-22 Thread andk
This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
 new df51f21  nimble/store: Make it clear store/ram is deprecated
df51f21 is described below

commit df51f21de6a0d45755b8a560d1829c192d952309
Author: Łukasz Rymanowski 
AuthorDate: Tue Apr 21 15:51:56 2020 +0200

nimble/store: Make it clear store/ram is deprecated

With this patch when store/ram is used then new will warn about it:

2020/04/21 15:51:21.077 [WARNING] Use of deprecated setting 
BLE_STORE_RAM_DEPRECATED_FLAG in @apache-mynewt-nimble/nimble/host/store/ram: 
Package store/ram is deprecated and store/config shall be used with 
BLE_STORE_CONFIG_PERSIST set to 0
---
 nimble/host/store/ram/syscfg.yml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/nimble/host/store/ram/syscfg.yml b/nimble/host/store/ram/syscfg.yml
index 442211d..91c55fd 100644
--- a/nimble/host/store/ram/syscfg.yml
+++ b/nimble/host/store/ram/syscfg.yml
@@ -20,4 +20,13 @@ syscfg.defs:
 description: >
 Sysinit stage for the RAM BLE store.
 value: 500
+BLE_STORE_RAM_DEPRECATED_FLAG:
+description: >
+Package store/ram is deprecated and store/config shall be used 
with BLE_STORE_CONFIG_PERSIST set to 0
+value: 0
+deprecated: 1
+
+
+syscfg.vals:
+BLE_STORE_RAM_DEPRECATED_FLAG: 1
 



[mynewt-nimble] 02/02: nimble/ll: Fix coding style

2020-04-22 Thread andk
This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 9fbcf8bbd764b798f9245dfeae0548e93ee0a7ce
Author: Andrzej Kaczmarek 
AuthorDate: Fri Apr 17 16:30:34 2020 +0200

nimble/ll: Fix coding style
---
 nimble/controller/src/ble_ll_adv.c  | 2 +-
 nimble/controller/src/ble_ll_sync.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 4dd71ef..2a5d261 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -4022,7 +4022,7 @@ ble_ll_adv_periodic_send_sync_ind(struct ble_ll_adv_sm 
*advsm,
 
 /* SID, AType, SCA */
 sync_ind[24] = (advsm->adi >> 12);
-sync_ind[24] |= !!(advsm->flags & BLE_LL_ADV_SM_FLAG_TX_ADD) << 4 ;
+sync_ind[24] |= !!(advsm->flags & BLE_LL_ADV_SM_FLAG_TX_ADD) << 4;
 sync_ind[24] |= BLE_LL_SCA_ENUM << 5;
 
 /* PHY */
diff --git a/nimble/controller/src/ble_ll_sync.c 
b/nimble/controller/src/ble_ll_sync.c
index 52e0680..df80608 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -2091,7 +2091,7 @@ ble_ll_sync_send_sync_ind(struct ble_ll_sync_sm *syncsm,
 if (syncsm->flags & BLE_LL_SYNC_SM_FLAG_ADDR_RESOLVED) {
 sync_ind[24] |= 1 << 4;
 } else {
-sync_ind[24] |= (syncsm->adv_addr_type == BLE_ADDR_RANDOM) << 4 ;
+sync_ind[24] |= (syncsm->adv_addr_type == BLE_ADDR_RANDOM) << 4;
 }
 
 sync_ind[24] |= BLE_LL_SCA_ENUM << 5;



[mynewt-nimble] 01/02: nimble/ll: Add common setting for SCA

2020-04-22 Thread andk
This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit f0adf2de7f0a4e850abf771dcbfc703e24258788
Author: Andrzej Kaczmarek 
AuthorDate: Fri Apr 17 12:11:43 2020 +0200

nimble/ll: Add common setting for SCA

Currently we have two separate SCA settings: actual SCA as ppm value and
enumerated one based on ranges of SCA value. This means user needs to
update both values and they ideally should be in sync.

To make our life easier, we can just have single BLE_LL_SCA setting to
provide ppm value and enumerated one can be easily determined at build
time.
---
 nimble/controller/include/controller/ble_ll.h | 23 +++
 nimble/controller/src/ble_ll_adv.c|  4 +--
 nimble/controller/src/ble_ll_conn.c   |  2 +-
 nimble/controller/src/ble_ll_sync.c   |  2 +-
 nimble/controller/src/ble_ll_utils.c  |  3 +-
 nimble/controller/syscfg.yml  | 41 ---
 porting/npl/riot/include/syscfg/syscfg.h  |  5 
 7 files changed, 45 insertions(+), 35 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h 
b/nimble/controller/include/controller/ble_ll.h
index d334044..47d3ac4 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -69,6 +69,29 @@ extern "C" {
 /* Timing jitter as per spec is +/16 usecs */
 #define BLE_LL_JITTER_USECS (16)
 
+
+#if MYNEWT_VAL(BLE_LL_SCA) < 0
+#error Invalid SCA value
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 20
+#define BLE_LL_SCA_ENUM 7
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 30
+#define BLE_LL_SCA_ENUM 6
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 50
+#define BLE_LL_SCA_ENUM 5
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 75
+#define BLE_LL_SCA_ENUM 4
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 100
+#define BLE_LL_SCA_ENUM 3
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 150
+#define BLE_LL_SCA_ENUM 2
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 250
+#define BLE_LL_SCA_ENUM 1
+#elif MYNEWT_VAL(BLE_LL_SCA) <= 500
+#define BLE_LL_SCA_ENUM 0
+#else
+#error Invalid SCA value
+#endif
+
 /* Packet queue header definition */
 STAILQ_HEAD(ble_ll_pkt_q, os_mbuf_pkthdr);
 
diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 8b661f8..4dd71ef 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -686,7 +686,7 @@ ble_ll_adv_put_syncinfo(struct ble_ll_adv_sm *advsm,
 dptr[8] = advsm->periodic_chanmap[4] & 0x1f;
 
 /* SCA (3 bits) */
-dptr[8] |= MYNEWT_VAL(BLE_LL_MASTER_SCA) << 5;
+dptr[8] |= BLE_LL_SCA_ENUM << 5;
 
 /* AA (4 bytes) */
 put_le32([9], advsm->periodic_access_addr);
@@ -4023,7 +4023,7 @@ ble_ll_adv_periodic_send_sync_ind(struct ble_ll_adv_sm 
*advsm,
 /* SID, AType, SCA */
 sync_ind[24] = (advsm->adi >> 12);
 sync_ind[24] |= !!(advsm->flags & BLE_LL_ADV_SM_FLAG_TX_ADD) << 4 ;
-sync_ind[24] |= MYNEWT_VAL(BLE_LL_MASTER_SCA) << 5;
+sync_ind[24] |= BLE_LL_SCA_ENUM << 5;
 
 /* PHY */
 sync_ind[25] = (0x01 << (advsm->sec_phy - 1));
diff --git a/nimble/controller/src/ble_ll_conn.c 
b/nimble/controller/src/ble_ll_conn.c
index 1b17a0d..d40381b 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -1450,7 +1450,7 @@ ble_ll_conn_master_common_init(struct ble_ll_conn_sm 
*connsm)
  */
 connsm->tx_win_size = BLE_LL_CONN_TX_WIN_MIN + 1;
 connsm->tx_win_off = 0;
-connsm->master_sca = MYNEWT_VAL(BLE_LL_MASTER_SCA);
+connsm->master_sca = BLE_LL_SCA_ENUM;
 
 /* Hop increment is a random value between 5 and 16. */
 connsm->hop_inc = (rand() % 12) + 5;
diff --git a/nimble/controller/src/ble_ll_sync.c 
b/nimble/controller/src/ble_ll_sync.c
index 75f18bf..52e0680 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -2094,7 +2094,7 @@ ble_ll_sync_send_sync_ind(struct ble_ll_sync_sm *syncsm,
 sync_ind[24] |= (syncsm->adv_addr_type == BLE_ADDR_RANDOM) << 4 ;
 }
 
-sync_ind[24] |= MYNEWT_VAL(BLE_LL_MASTER_SCA) << 5;
+sync_ind[24] |= BLE_LL_SCA_ENUM << 5;
 
 /* PHY */
 sync_ind[25] = (0x01 << (ble_ll_sync_phy_mode_to_hci(syncsm->phy_mode) - 
1));
diff --git a/nimble/controller/src/ble_ll_utils.c 
b/nimble/controller/src/ble_ll_utils.c
index 7fbb18f..be716e1 100644
--- a/nimble/controller/src/ble_ll_utils.c
+++ b/nimble/controller/src/ble_ll_utils.c
@@ -292,8 +292,7 @@ ble_ll_utils_calc_window_widening(uint32_t anchor_point,
 time_since_last_anchor = (int32_t)(anchor_point - last_anchor_point);
 if (time_since_last_anchor > 0) {
 delta_msec = os_cputime_ticks_to_usecs(time_since_last_anchor) / 1000;
-total_sca_ppm = g_ble_sca_ppm_tbl[master_sca] +
-  MYNEWT_VAL(BLE_LL_OUR_SCA);
+total_sca_ppm = 

[mynewt-nimble] branch master updated (dc7d990 -> 9fbcf8b)

2020-04-22 Thread andk
This is an automated email from the ASF dual-hosted git repository.

andk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git.


from dc7d990  add deprecation message to ble store source
 new f0adf2d  nimble/ll: Add common setting for SCA
 new 9fbcf8b  nimble/ll: Fix coding style

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/controller/include/controller/ble_ll.h | 23 +++
 nimble/controller/src/ble_ll_adv.c|  6 ++--
 nimble/controller/src/ble_ll_conn.c   |  2 +-
 nimble/controller/src/ble_ll_sync.c   |  4 +--
 nimble/controller/src/ble_ll_utils.c  |  3 +-
 nimble/controller/syscfg.yml  | 41 ---
 porting/npl/riot/include/syscfg/syscfg.h  |  5 
 7 files changed, 47 insertions(+), 37 deletions(-)