How can I reconnect to device after disconnecting in Core Bluetooth

前端 未结 4 1981
庸人自扰
庸人自扰 2021-02-03 13:40

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条回答
  •  忘掉有多难
    2021-02-03 14:05

    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.

提交回复
热议问题