Failed to retrieve the services of a CBPeripheral after restart the peripheral.

I have a problem while trying to reconnect with a paired peripheral, it connects but I can not find the services.


The steps are as follows.


1. Turn on the peripheral device and open app.


- Find the peripheral after scan. OK

- Connect to the peripheral. OK

- Save peripheral id for future reconnection.

- Find the services / Characteristics. OK


2. Now I disabled the bluetooth from IOS and turned it on again to test the reconnection.


- Find the peripheral after scan. OK

- Connect to the peripheral with saved id. OK

- Find the services / Characteristics. OK


3. Now I closed the app and reopen to test again.


- Find the peripheral after scan. OK

- Connect to the peripheral with saved id. OK

- Find the services / Characteristics. OK


4. Now turn off the peripheral and then turn on again.


- Find the peripheral after scan. OK

- Connect to the peripheral with saved id. OK

- Find the services / Characteristics. DOES NOT WORK NEVER MORE.


After step 4 if i repeat steps 1,2 and 3 they will not find services, the problem is when restart the peripheral.


I'm setting the self.manager.delegate=self and implementing CBCentralManagerDelegate and CBPeripheralDelegate correctly, and I'm using self.manager.retrievePeripherals (withIdentifiers: [UUID]) to connect to the paired peripheral.


Any idea? I will be very grateful.