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

Commit cdb9c23b authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

has_client: Disconnect profile when control point is not accesable

This is done for PTS which is not ready to accept control point
commands and some time.
But in the real live, we actually disconnect such device if there is
problem with control point operations. We can always reconnect if
needed.

Bug: 238171211
Test: atest BluetoothInstrumentationTests
Test: PTS
Tag: #feature
Change-Id: Iec5411267ef9c03368a99b89ab6e9fab8a96200e
parent c9352435
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -365,6 +365,10 @@ class HasClientImpl : public HasClient {
    auto op = op_opt.value();
    callbacks_->OnPresetInfoError(device->addr, op.index,
                                  GattStatus2SvcErrorCode(status));

    LOG_ERROR("Devices %s: Control point not usable. Disconnecting!",
              device->addr.ToString().c_str());
    BTA_GATTC_Close(conn_id);
  }

  void OnHasPresetIndexOperation(uint16_t conn_id, tGATT_STATUS status,
@@ -404,6 +408,9 @@ class HasClientImpl : public HasClient {
      callbacks_->OnActivePresetSelectError(op.addr_or_group,
                                            GattStatus2SvcErrorCode(status));
    }
    LOG_ERROR("Devices %s: Control point not usable. Disconnecting!",
              device->addr.ToString().c_str());
    BTA_GATTC_Close(conn_id);
  }

  void CpReadAllPresetsOperation(HasCtpOp operation) {