didDiscoverPeripheral is not called

独自空忆成欢 提交于 2020-01-23 02:38:31

问题


I'm connecting to a Bluetooth device. However, the didDiscoverPeripheral delegate method is never called.

I'm scanning for the device with the UUID. This is straight from the TemperatureSensor example code. [centralManager scanForPeripheralsWithServices:uuidArray options:options];

Oddly enough, if I comment out this method, retrieveConnectedPeripherals finds the device just fine. I'm calling retrieveConnectedPeripherals when the device is powered on. Only when didRetrieveConnectedPeripherals is implemented will the device actually be detected. However, there's still no call to didDiscoverPeripheral.

I find this very confusing. How can iOS connect to a device before it's even discovered? Also, it automatically disconnects. I want it to remain connected until the device is unplugged.

I'll keep looking at it.

Thanks in advance, Mike

来源:https://stackoverflow.com/questions/15959130/diddiscoverperipheral-is-not-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!