mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [48/50] [abbrv] incubator-mynewt-core git commit: Fix incorrect handling of multiple connections and starting encrypted links with all of them
Date Thu, 11 Aug 2016 21:27:48 GMT
Fix incorrect handling of multiple connections and starting encrypted links with all of them


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

Branch: refs/heads/phyrx_no_mbuf
Commit: c619a9fe6a2ccf6e42215c0c6cd7e281dcf61f75
Parents: 1a3ad80
Author: William San Filippo <wills@runtime.io>
Authored: Tue Aug 9 15:49:07 2016 -0700
Committer: William San Filippo <wills@runtime.io>
Committed: Thu Aug 11 14:26:27 2016 -0700

----------------------------------------------------------------------
 apps/bletest/src/main.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c619a9fe/apps/bletest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index c2635dd..7cc6425 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -656,6 +656,8 @@ bletest_execute_advertiser(void)
     int i;
 #if (BLETEST_CONCURRENT_CONN_TEST == 1)
     int j;
+    uint16_t mask;
+    uint16_t reply_handle;
 #endif
     int rc;
     uint16_t handle;
@@ -727,10 +729,16 @@ bletest_execute_advertiser(void)
     if ((int32_t)(os_time_get() - g_next_os_time) >= 0) {
 #if (BLE_LL_CFG_FEAT_LE_ENCRYPTION == 1)
         /* Do we need to send a LTK reply? */
-        if (g_bletest_ltk_reply_handle) {
-            //bletest_send_ltk_req_neg_reply(g_bletest_ltk_reply_handle);
-            bletest_send_ltk_req_reply(g_bletest_ltk_reply_handle);
-            g_bletest_ltk_reply_handle = 0;
+        mask = 1;
+        reply_handle = 1;
+        while (g_bletest_ltk_reply_handle && mask) {
+            if (g_bletest_ltk_reply_handle & mask) {
+                bletest_send_ltk_req_reply(reply_handle);
+                //bletest_send_ltk_req_neg_reply(reply_handle);
+                g_bletest_ltk_reply_handle &= ~mask;
+            }
+            ++reply_handle;
+            mask <<= 1;
         }
 #endif
         if (g_bletest_current_conns) {


Mime
View raw message