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

Commit 6d3b611b authored by Stanley Tng's avatar Stanley Tng
Browse files

Add function to update LE connection parameters

As part of new SL4A tests for LE CoC to measure data throughput
performance, this commit will add a function to enable the CoC Facade
to modify the LE Connection Parameters especially the Connection
Intervals. Also, add some debug logs.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: If7665cf70a18756a58556c60cb9ce2a587ae691f
parent 8cd20068
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ interface IBluetoothGatt {
    void readRemoteRssi(in int clientIf, in String address);
    void configureMTU(in int clientIf, in String address, in int mtu);
    void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority);
    void leConnectionUpdate(int clientIf, String address, int minInterval,
                            int maxInterval, int slaveLatency, int supervisionTimeout);

    void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
    void unregisterServer(in int serverIf);
+10 −2
Original line number Diff line number Diff line
@@ -615,15 +615,23 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
      STREAM_TO_UINT16(timeout, p);      /* 0x000A - 0x0C80 */
      /* If we are a master, the slave wants to update the parameters */
      if (p_lcb->link_role == HCI_ROLE_MASTER) {
        if (min_interval < BTM_BLE_CONN_INT_MIN_LIMIT)
        if (min_interval < BTM_BLE_CONN_INT_MIN_LIMIT) {
          L2CAP_TRACE_DEBUG(
              "%s: requested min_interval=%d too small. Set to %d", __func__,
              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)
        if (max_interval < BTM_BLE_CONN_INT_MIN_LIMIT) {
          L2CAP_TRACE_DEBUG(
              "%s: requested max_interval=%d too small. Set to %d", __func__,
              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 ||