         defer { semaphore.signal() }
         self.log("Will discover services for \(peripheral)")
         let serviceUUIDs = services.isEmpty ? nil : services.map { CBUUID($0) }
-        return try await withCheckedThrowingContinuation { [weak self] continuation in
+        return try await withThrowingContinuation(for: peripheral) { [weak self] continuation in
             guard let self = self else { return }
             self.async {
                 // get peripheral

    private func waitUntilCanSendWriteWithoutResponse(
        for peripheral: Peripheral
    ) async throws {
        return try await withCheckedThrowingContinuation { [weak self] continuation in
            guard let self = self else { return }
            self.async {
                // get peripheral

        defer { semaphore.signal() }
        self.log("Peripheral \(service.peripheral) will discover characteristics of service \(service.uuid)")
        let characteristicUUIDs = characteristics.isEmpty ? nil : characteristics.map { CBUUID($0) }
        return try await withThrowingContinuation(for: service.peripheral) { [weak self] continuation in
            guard let self = self else { return }
            self.async {
                let peripheral = service.peripheral
