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

Commit c4e4d8c2 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Andre Eisenbach
Browse files

service: implement HAL callback for response confirmation

Change-Id: Iec1c33574cef49053cf1f8eb3835b20047cb96eb
parent 43cbaae8
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -331,6 +331,15 @@ void RequestExecWriteCallback(int conn_id, int trans_id,
      g_interface, conn_id, trans_id, *bda, exec_write));
}

void ResponseConfirmationCallback(int status, int handle) {
  shared_lock<shared_timed_mutex> lock(g_instance_lock);
  VLOG(2) << __func__ << " - status: " << status << " handle: " << handle;
  VERIFY_INTERFACE_OR_RETURN();

  FOR_EACH_SERVER_OBSERVER(ResponseConfirmationCallback(
      g_interface, status, handle));
}

void IndicationSentCallback(int conn_id, int status) {
  shared_lock<shared_timed_mutex> lock(g_instance_lock);
  VLOG(2) << __func__ << " - conn_id: " << conn_id << " status: " << status;
@@ -391,7 +400,7 @@ const btgatt_server_callbacks_t gatt_server_callbacks = {
    RequestReadCallback,
    RequestWriteCallback,
    RequestExecWriteCallback,
    nullptr,  // response_confirmation_cb
    ResponseConfirmationCallback,
    IndicationSentCallback,
    nullptr,  // congestion_cb
    nullptr,  // mtu_changed_cb
@@ -693,6 +702,13 @@ void BluetoothGattInterface::ServerObserver::RequestExecWriteCallback(
  // Do nothing.
}

void BluetoothGattInterface::ServerObserver::ResponseConfirmationCallback(
    BluetoothGattInterface* /* gatt_iface */,
    int /* status */,
    int /* handle */) {
  // Do nothing
}

void BluetoothGattInterface::ServerObserver::IndicationSentCallback(
    BluetoothGattInterface* /* gatt_iface */,
    int /* conn_id */,
+5 −0
Original line number Diff line number Diff line
@@ -177,6 +177,11 @@ class BluetoothGattInterface {
        int conn_id, int trans_id,
        const bt_bdaddr_t& bda, int exec_write);

    virtual void ResponseConfirmationCallback(
        BluetoothGattInterface* gatt_iface,
        int status,
        int handle);

    virtual void IndicationSentCallback(
        BluetoothGattInterface* gatt_iface, int conn_id, int status);