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 2016/06/21 18:58:08 UTC

incubator-mynewt-core git commit: BLE Host - Stop scan timer when disc. proc. cncld.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop eacea950a -> ac9f865da


BLE Host - Stop scan timer when disc. proc. cncld.


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

Branch: refs/heads/develop
Commit: ac9f865dafdebfafc2415c7c6ca09705b5c50bb4
Parents: eacea95
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Jun 21 11:57:31 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jun 21 11:57:31 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ac9f865d/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 12a4994..50b1df6 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -418,13 +418,20 @@ ble_gap_adv_finished(int event)
 }
 
 static void
+ble_gap_master_reset_state(void)
+{
+    ble_gap_master.op = BLE_GAP_OP_NULL;
+    ble_gap_master.exp_set = 0;
+}
+
+static void
 ble_gap_master_extract_cb(ble_gap_event_fn **out_cb, void **out_cb_arg)
 {
     ble_hs_lock();
 
     *out_cb = ble_gap_master.conn.cb;
     *out_cb_arg = ble_gap_master.conn.cb_arg;
-    ble_gap_master.op = BLE_GAP_OP_NULL;
+    ble_gap_master_reset_state();
 
     ble_hs_unlock();
 }
@@ -505,7 +512,7 @@ ble_gap_call_master_disc_cb(int event, int status, struct ble_hs_adv *adv,
     cb_arg = ble_gap_master.disc.cb_arg;
 
     if (reset_state) {
-        ble_gap_master.op = BLE_GAP_OP_NULL;
+        ble_gap_master_reset_state();
     }
 
     ble_hs_unlock();
@@ -922,7 +929,7 @@ ble_gap_rx_conn_complete(struct hci_le_conn_complete *evt)
         conn->bhc_cb = ble_gap_master.conn.cb;
         conn->our_addr_type = ble_gap_master.conn.our_addr_type;
         conn->bhc_cb_arg = ble_gap_master.conn.cb_arg;
-        ble_gap_master.op = BLE_GAP_OP_NULL;
+        ble_gap_master_reset_state();
     } else {
         conn->bhc_cb = ble_gap_slave.cb;
         conn->bhc_cb_arg = ble_gap_slave.cb_arg;
@@ -1679,7 +1686,7 @@ ble_gap_disc_cancel(void)
         goto done;
     }
 
-    ble_gap_master.op = BLE_GAP_OP_NULL;
+    ble_gap_master_reset_state();
 
 done:
     if (rc != 0) {