You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/09/29 18:26:08 UTC

[1/2] incubator-mynewt-core git commit: MYNEWT-397: Nimble controller assert if advertising started/stopped frequently

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 5e78e26db -> 317f82c61


MYNEWT-397: Nimble controller assert if advertising started/stopped frequently

There was an assert in the advertising code in the nimble controller that
would assert if the advertising state machine was not enabled and an
advertising event finished. The code contained a race condition where
it was possible that the advertising state machine was stopped but
an advertising end event was processed by the Link Layer. The code will
now ignore advertising packets that are processed after advertising has
been stopped as these events are asynchronous to the controller.


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

Branch: refs/heads/develop
Commit: 317f82c61cbf22cfe11305809b3765ae64d46515
Parents: ae2999d
Author: William San Filippo <wi...@runtime.io>
Authored: Thu Sep 29 10:45:57 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Sep 29 11:24:56 2016 -0700

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_adv.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/317f82c6/net/nimble/controller/src/ble_ll_adv.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_adv.c b/net/nimble/controller/src/ble_ll_adv.c
index 34c1f04..95c302f 100644
--- a/net/nimble/controller/src/ble_ll_adv.c
+++ b/net/nimble/controller/src/ble_ll_adv.c
@@ -651,16 +651,18 @@ ble_ll_adv_sm_stop(struct ble_ll_adv_sm *advsm)
     if (advsm->enabled) {
         /* Remove any scheduled advertising items */
         ble_ll_sched_rmv_elem(&advsm->adv_sch);
-        os_eventq_remove(&g_ble_ll_data.ll_evq, &advsm->adv_txdone_ev);
 
         /* Set to standby if we are no longer advertising */
         OS_ENTER_CRITICAL(sr);
         if (ble_ll_state_get() == BLE_LL_STATE_ADV) {
+            ble_phy_disable();
             ble_ll_wfr_disable();
             ble_ll_state_set(BLE_LL_STATE_STANDBY);
         }
         OS_EXIT_CRITICAL(sr);
 
+        os_eventq_remove(&g_ble_ll_data.ll_evq, &advsm->adv_txdone_ev);
+
         /* If there is an event buf we need to free it */
         if (advsm->conn_comp_ev) {
             ble_hci_trans_buf_free(advsm->conn_comp_ev);
@@ -1162,6 +1164,15 @@ ble_ll_adv_rx_pkt_in(uint8_t ptype, uint8_t *rxbuf, struct ble_mbuf_hdr *hdr)
     int adv_event_over;
 
     /*
+     * It is possible that advertising was stopped and a packet plcaed on the
+     * LL receive packet queue. In this case, just ignore the received packet
+     * as the advertising state machine is no longer "valid"
+     */
+    if (!g_ble_ll_adv_sm.enabled) {
+        return;
+    }
+
+    /*
      * If we have received a scan request and we are transmitting a response
      * or we have received a valid connect request, dont "end" the advertising
      * event. In the case of a connect request we will stop advertising. In


[2/2] incubator-mynewt-core git commit: Remove some unused packages from bletest so it builds for nrf51

Posted by we...@apache.org.
Remove some unused packages from bletest so it builds for nrf51


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

Branch: refs/heads/develop
Commit: ae2999d8509427a0736a2f59df5259c72953946b
Parents: 5e78e26
Author: William San Filippo <wi...@runtime.io>
Authored: Thu Sep 29 10:41:36 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Sep 29 11:24:56 2016 -0700

----------------------------------------------------------------------
 apps/bletest/pkg.yml    | 8 +++-----
 apps/bletest/src/main.c | 2 --
 2 files changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ae2999d8/apps/bletest/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/bletest/pkg.yml b/apps/bletest/pkg.yml
index b17321e..2c78671 100644
--- a/apps/bletest/pkg.yml
+++ b/apps/bletest/pkg.yml
@@ -6,7 +6,7 @@
 # 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,
@@ -24,15 +24,13 @@ pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
 pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
-pkg.deps: 
+pkg.deps:
     - net/nimble/controller
     - net/nimble/host
     - net/nimble/transport/ram
-    - kernel/os 
+    - kernel/os
     - sys/console/full
     - sys/shell
-    - libs/imgmgr
-    - libs/newtmgr
     - sys/config
     - sys/log
     - sys/stats

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ae2999d8/apps/bletest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index 0282b4e..1b61456 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -29,8 +29,6 @@
 #include "shell/shell.h"
 #include "stats/stats.h"
 #include "hal/flash_map.h"
-#include "newtmgr/newtmgr.h"
-#include "imgmgr/imgmgr.h"
 
 /* BLE */
 #include "nimble/ble.h"