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/04/05 05:24:37 UTC

[3/3] incubator-mynewt-core git commit: ble host - fix bug: ensure proc inserted.

ble host - fix bug: ensure proc inserted.

This bug occurred when the application task is running at a lower
priority than the host task.  When the application initiates pairing,
the host code kicked the host task before the pairing operation was
inserted into the procedure list.  As a consequence, the pairing
procedure did not execute.


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

Branch: refs/heads/develop
Commit: 1f4662b1e9d3dcfed4a8db3de2b5ce02b280399f
Parents: 7432082
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Apr 4 20:19:07 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Apr 4 20:19:07 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap_sm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f4662b1/net/nimble/host/src/ble_l2cap_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_sm.c b/net/nimble/host/src/ble_l2cap_sm.c
index 3c8b0f6..06b0925 100644
--- a/net/nimble/host/src/ble_l2cap_sm.c
+++ b/net/nimble/host/src/ble_l2cap_sm.c
@@ -1105,7 +1105,8 @@ ble_l2cap_sm_rx_start_encrypt_ack(struct ble_hci_ack *ack, void *arg)
 
     proc = arg;
 
-    BLE_HS_DBG_ASSERT(proc->fsm_proc.op == BLE_L2CAP_SM_PROC_OP_START_ENCRYPT_TXED);
+    BLE_HS_DBG_ASSERT(proc->fsm_proc.op ==
+                      BLE_L2CAP_SM_PROC_OP_START_ENCRYPT_TXED);
 
     /* Extract the procedure from the state machine while we mess with it. */
     ble_fsm_lock(&ble_l2cap_sm_fsm);
@@ -1222,8 +1223,8 @@ ble_l2cap_sm_initiate(uint16_t conn_handle)
     }
 
     proc->flags |= BLE_L2CAP_SM_PROC_F_INITIATOR;
-    ble_l2cap_sm_proc_set_pending(proc);
     STAILQ_INSERT_TAIL(&ble_l2cap_sm_fsm.procs, &proc->fsm_proc, next);
+    ble_l2cap_sm_proc_set_pending(proc);
 
     return 0;
 }