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

Commit eda0ef79 authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Add function to update LE connection parameters"

am: ac458865

Change-Id: I323c50150dc691d12ffd80233238490d2d1346c9
parents 613c7423 ac458865
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 ||