             }
             .take(1)
 
-        return ensureValidStateAndCallIfNecessary(
-            for: observable,
-            call: { self.peripheral.discoverIncludedServices(includedServiceUUIDs, for: service.service) }
+        return ensureValidPeripheralStateAndCallIfSucceeded(
+            for: observable,
+            postSubscriptionCall: { self.peripheral.discoverIncludedServices(includedServiceUUIDs, for: service.service) }
         )
     }
 

                throw BluetoothError.descriptorsDiscoveryFailed(characteristic, error)
            }

        return ensureValidStateAndCallIfNecessary(
            for: observable,
            call: { self.peripheral.discoverDescriptors(for: characteristic.characteristic) }
        )
    }


     */
    public func writeValue(_ data: Data, for descriptor: Descriptor) -> Observable<Descriptor> {
        let monitorWrite = self.monitorWrite(for: descriptor).take(1)
        return ensureValidPeripheralStateAndCallIfSucceeded(
            for: monitorWrite,
            postSubscriptionCall: { self.peripheral.writeValue(data, for: descriptor.descriptor) }
        )
    }

    func ensureValidPeripheralStateAndCallIfSucceeded<T>(
        for observable: Observable<T>,
        postSubscriptionCall: @escaping () -> Void
        ) -> Observable<T> {
        let operation = Observable<T>.deferred {
            call()
