How can I reconnect to device after disconnecting in Core Bluetooth

前端 未结 4 501
甜味超标
甜味超标 2021-02-03 13:42

In Core Bluetooth, after connecting to a device, I turn off the device and the device is disconnected. But when I turn on the device again, there is no didDiscoverPeripher

4条回答
  •  猫巷女王i
    2021-02-03 14:31

    When you do a scan with scanForPeripheralsWithServices, it will normally only notify you once for a particular device address. You can change this to report duplicates by specifying the option CBCentralManagerScanOptionAllowDuplicatesKey. Or you can have your app detect that the other device disconnected using a timeout, and restart your scan.

提交回复
热议问题