 
         print("\ndidDiscoverServices")
 
-        guard
-            let characteristicCBUUID: CBUUID = self.characteristicCBUUID,
-            let services: [CBService] = self.discoveredPeripheral?.services
-            else { return }
-
-        for service: CBService in services {
-
-            if service.uuid == self.serviceCBUUID {
-
-                self.discoveredPeripheral?.discoverCharacteristics([characteristicCBUUID], for: service)
-
-            }
-            
+        if let service: CBService = self.discoveredPeripheral?.services?.filter({ $0.uuid == self.serviceCBUUID }).first {
+
+            guard let characteristicCBUUID: CBUUID = self.characteristicCBUUID else { return }
+
+            self.discoveredPeripheral?.discoverCharacteristics([characteristicCBUUID], for: service)
+
         }
         
     }


        self.discoveredPeripheral?.discoverServices([serviceCBUUID])


    }

    func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) {

        print("willRestoreState")


    }



        print("\ndidDiscoverCharacteristicsFor")

        if let characteristic: CBCharacteristic = service.characteristics?.filter({ $0.uuid == self.characteristicCBUUID }).first {

            print("Matching characteristic")

            // To listen and read dynamic values
            self.discoveredPeripheral?.setNotifyValue(true, for: characteristic)

            // To read static values
            // self.discoveredPeripheral?.readValue(for: characteristic)
            
        }
        
