问题
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