// cancel autoconnect
BTA_GATTC_CancelOpen(gatt_if, address, false);
+ DoDisconnectCleanUp(hearingDevice);
+
hearingDevices.Remove(address);
if (connected)
return;
}
+ DoDisconnectCleanUp(hearingDevice);
+
+ callbacks->OnConnectionState(ConnectionState::DISCONNECTED, remote_bda);
+ }
+
+ void DoDisconnectCleanUp(HearingDevice* hearingDevice) {
if (hearingDevice->connection_update_status != NONE) {
LOG(INFO) << __func__ << ": connection update not completed. Current="
<< hearingDevice->connection_update_status;
if (hearingDevice->connection_update_status == STARTED) {
- OnConnectionUpdateComplete(conn_id);
+ OnConnectionUpdateComplete(hearingDevice->conn_id);
}
hearingDevice->connection_update_status = NONE;
}
+ BtaGattQueue::Clean(hearingDevice->conn_id);
+
hearingDevice->accepting_audio = false;
hearingDevice->conn_id = 0;
-
- BtaGattQueue::Clean(conn_id);
-
- callbacks->OnConnectionState(ConnectionState::DISCONNECTED, remote_bda);
}
void SetVolume(int8_t volume) override {