Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 3e6710122 -> be4996dcf


Fix issue when receiving an invalid pdu type

When doing testing at unplugfest we noticed devices sending an invalid
pdu type. This was causing our code to restart reception without first
disabling the PHY. This was showing up as a radio state error. We now
disable the PHY first.


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

Branch: refs/heads/develop
Commit: be4996dcf1ce8c7c6c8901b04cb6462da84b6d8f
Parents: 3444182
Author: William San Filippo <wi...@runtime.io>
Authored: Mon Jun 6 03:37:41 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Mon Jun 6 03:39:05 2016 -0700

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll.c      | 1 -
 net/nimble/controller/src/ble_ll_conn.c | 1 +
 net/nimble/controller/src/ble_ll_scan.c | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/be4996dc/net/nimble/controller/src/ble_ll.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll.c 
b/net/nimble/controller/src/ble_ll.c
index 6963307..0459ff0 100644
--- a/net/nimble/controller/src/ble_ll.c
+++ b/net/nimble/controller/src/ble_ll.c
@@ -824,7 +824,6 @@ ble_ll_rx_end(struct os_mbuf *rxpdu, struct ble_mbuf_hdr 
*ble_hdr)
             STATS_INC(ble_ll_stats, rx_adv_malformed_pkts);
             os_mbuf_free_chain(rxpdu);
             rxpdu = NULL;
-            rc = -1;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/be4996dc/net/nimble/controller/src/ble_ll_conn.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_conn.c 
b/net/nimble/controller/src/ble_ll_conn.c
index 3890a4f..57fcdc2 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -2153,6 +2153,7 @@ ble_ll_init_rx_isr_end(struct os_mbuf *rxpdu, uint8_t 
crcok)
      * the phy does not get disabled.
      */
     if (!rxpdu) {
+        ble_phy_disable();
         ble_phy_rx();
         return 0;
     }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/be4996dc/net/nimble/controller/src/ble_ll_scan.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_scan.c 
b/net/nimble/controller/src/ble_ll_scan.c
index e5c0b22..8e845c6 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -923,6 +923,7 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t crcok)
         if (scansm->scan_rsp_pending) {
             ble_ll_scan_req_backoff(scansm, 0);
         }
+        ble_phy_disable();
         ble_phy_rx();
         return 0;
     }

Reply via email to