1

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 I 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.

Kon
  • 4,023
  • 4
  • 24
  • 38
  • Why are you scanning after step 1? Once you have the saved identifier you can `retrievePeripheral(withIdentifiers:)` and then just `connect`. How do you resolve the problem? Do you need to restart the iOS device? Forget the peripheral? – Paulw11 Dec 14 '18 at 19:21
  • scan = I can find the peripheral. After step 1 I'm using retrievePeripherals to find the peripheral. To solve the problem I need to go into settings and forget the paired device. – André Ponce Dec 19 '18 at 22:05
  • @AndréPonce: did you ever solve this? I'm having a similar problem. – OlavJ Nov 08 '19 at 10:12
  • @OlavJ Yes, I solved it. It was a firmware problem! After the hardware team updated the firmware everything worked perfectly. You can use third-party apps to view your peripheral services and test the reconnection, if that doesn't work well the problem may be in the firmware. – André Ponce Nov 12 '19 at 20:38

0 Answers0