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

Commit 76907e27 authored by weichinweng's avatar weichinweng
Browse files

Use GATT_WRITE_NO_RSP for "state change" updates

For Hearing Aid, replaces the GATT_WRITE with GATT_WRITE_NO_RSP for the
"state change" updates that are send to the devices. Using no response
write is faster and these informational updates does not need a
confirmation from the devices.

Bug: 130332748
Test: 1.run unit test
2.Forget/Repair HearingAid device from Bluetooth UI.
3.Disconnect/Reconnect HearingAid device from Bluetooth UI.
4.HearingAid device power off/on, check them can reconnect.
5.Multiple click connect/disconnect from Bluetooth UI within 1 sec,
check them can reconnect.
6.One side HearingAid device power off/on when playing music, check it
can reconnect and music is work fine.

Change-Id: I55e9b4b0b8c76412e5810e1cec5d96819527d099
Merged-In: I55e9b4b0b8c76412e5810e1cec5d96819527d099
parent e3ffb1da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1551,9 +1551,9 @@ class HearingAidImpl : public HearingAid {
      // Send the data packet
      LOG(INFO) << __func__ << ": Send State Change. device=" << device->address
                << ", status=" << loghex(payload[1]);
      BtaGattQueue::WriteCharacteristic(device->conn_id,
                                        device->audio_control_point_handle,
                                        payload, GATT_WRITE, nullptr, nullptr);
      BtaGattQueue::WriteCharacteristic(
          device->conn_id, device->audio_control_point_handle, payload,
          GATT_WRITE_NO_RSP, nullptr, nullptr);
    }
  }