Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1baacdcb authored by Eri Kasamatsu's avatar Eri Kasamatsu Committed by Andre Eisenbach
Browse files

Reset max_interval to BTM_BLE_CONN_INT_MIN_LIMIT

In case of min_interval < BTM_BLE_CONN_INT_MIN_LIMIT
and max_interval < BTM_BLE_CONN_INT_MIN_LIMIT,
min_interval is reset to BTM_BLE_CONN_INT_MIN_LIMIT
but max_interval is not reset.
Then valid connection parameter updates can be rejected.

To avoid this, reset max_interval to BTM_BLE_CONN_INT_MIN_LIMIT
when max_interval is smaller than BTM_BLE_INT_MIN_LIMIT.

Change-Id: I5f54ddc0276f40d667ff433557b74ea4b100058d
parent 1bfb2799
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -663,6 +663,13 @@ void l2cble_process_sig_cmd (tL2C_LCB *p_lcb, UINT8 *p, UINT16 pkt_len)
                if (min_interval < BTM_BLE_CONN_INT_MIN_LIMIT)
                    min_interval = BTM_BLE_CONN_INT_MIN_LIMIT;

                // While this could result in connection parameters that fall
                // outside fo the range requested, this will allow the connection
                // to remain established.
                // In other words, this is a workaround for certain peripherals.
                if (max_interval < BTM_BLE_CONN_INT_MIN_LIMIT)
                    max_interval = BTM_BLE_CONN_INT_MIN_LIMIT;

                if (min_interval < BTM_BLE_CONN_INT_MIN || min_interval > BTM_BLE_CONN_INT_MAX ||
                    max_interval < BTM_BLE_CONN_INT_MIN || max_interval > BTM_BLE_CONN_INT_MAX ||
                    latency  > BTM_BLE_CONN_LATENCY_MAX ||