You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2020/03/27 12:00:34 UTC

[mynewt-nimble] branch master updated: nimble/gap: Remove notification for update process timeout.

This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 403de2b  nimble/gap: Remove notification for update process timeout.
403de2b is described below

commit 403de2b9818a4ec13ba20900023ec273e2640af9
Author: Zac Bond <za...@bigassfans.com>
AuthorDate: Wed Mar 25 10:33:08 2020 -0400

    nimble/gap: Remove notification for update process timeout.
    
    The connection parameter update process has a hard-coded 40-second timeout,
    but in reality, the time it takes to complete a connection parameter might take longer, as it
    depends on the connection interval and when controller deciders to do it.
    This patch changes meaning of this 40 sec timer to be only a guard so the application
    does not perform too many connection update parameter requests.
    Now when timeout fires, application will not be notified about that and link will not be dropped.
---
 nimble/host/src/ble_gap.c           |  1 -
 nimble/host/test/src/ble_gap_test.c | 67 -------------------------------------
 2 files changed, 68 deletions(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 6039f6f..693ba30 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -1943,7 +1943,6 @@ ble_gap_update_timer(void)
         ble_hs_unlock();
 
         if (entry != NULL) {
-            ble_gap_update_notify(conn_handle, BLE_HS_ETIMEOUT);
             ble_gap_update_entry_free(entry);
         }
     } while (entry != NULL);
diff --git a/nimble/host/test/src/ble_gap_test.c b/nimble/host/test/src/ble_gap_test.c
index 3962bac..7496e31 100644
--- a/nimble/host/test/src/ble_gap_test.c
+++ b/nimble/host/test/src/ble_gap_test.c
@@ -2050,70 +2050,6 @@ ble_gap_test_util_update_l2cap(struct ble_gap_upd_params *params,
 }
 
 static void
-ble_gap_test_util_update_no_l2cap_tmo(struct ble_gap_upd_params *params,
-                                      int master)
-{
-    struct ble_hs_conn *conn;
-    int rc;
-
-    uint8_t peer_addr[6] = { 1, 2, 3, 4, 5, 6 };
-
-    ble_gap_test_util_init();
-
-    ble_hs_test_util_create_conn(2, peer_addr, ble_gap_test_util_connect_cb,
-                                 NULL);
-
-    if (!master) {
-        ble_hs_lock();
-        conn = ble_hs_conn_find(2);
-        TEST_ASSERT_FATAL(conn != NULL);
-        conn->bhc_flags &= ~BLE_HS_CONN_F_MASTER;
-        ble_hs_unlock();
-    }
-
-    /* Erase callback info reported during connection establishment; we only
-     * care about updates.
-     */
-    ble_gap_test_util_reset_cb_info();
-
-    TEST_ASSERT(!ble_gap_master_in_progress());
-
-    rc = ble_hs_test_util_conn_update(2, params, 0);
-    TEST_ASSERT(rc == 0);
-    TEST_ASSERT(!ble_gap_master_in_progress());
-
-    /* Verify tx of connection update command. */
-    ble_gap_test_util_verify_tx_update_conn(params);
-
-    /* Ensure no update event reported. */
-    TEST_ASSERT(ble_gap_test_event.type == 0xff);
-
-    /* Advance 39 seconds; ensure no timeout reported. */
-    os_time_advance(39 * OS_TICKS_PER_SEC);
-    ble_gap_timer();
-    TEST_ASSERT(ble_gap_test_event.type == 0xff);
-
-    /* Advance 40th second; ensure timeout reported. */
-    os_time_advance(1 * OS_TICKS_PER_SEC);
-
-    /* Timeout will result in a terminate HCI command being sent; schedule ack
-     * from controller.
-     */
-    ble_hs_test_util_hci_ack_set_disconnect(0);
-
-    ble_gap_timer();
-
-    /* Verify terminate was sent. */
-    ble_gap_test_util_verify_tx_disconnect();
-
-    TEST_ASSERT(ble_gap_test_event.type == BLE_GAP_EVENT_CONN_UPDATE);
-    TEST_ASSERT(ble_gap_test_conn_status == BLE_HS_ETIMEOUT);
-    TEST_ASSERT(ble_gap_test_conn_desc.conn_handle == 2);
-    TEST_ASSERT(memcmp(ble_gap_test_conn_desc.peer_id_addr.val,
-                       peer_addr, 6) == 0);
-}
-
-static void
 ble_gap_test_util_update_l2cap_tmo(struct ble_gap_upd_params *params,
                                    uint8_t hci_status, uint8_t event_status,
                                    int rx_l2cap)
@@ -2982,9 +2918,6 @@ TEST_CASE_SELF(ble_gap_test_case_update_timeout)
         .max_ce_len = 456,
     };
 
-    /* No L2CAP. */
-    ble_gap_test_util_update_no_l2cap_tmo(&params, 1);
-
     /* L2CAP - Local unsupported; L2CAP timeout. */
     ble_gap_test_util_update_l2cap_tmo(&params, BLE_ERR_UNKNOWN_HCI_CMD, 0, 0);