CoreBluetooth无法找到设备,但iOS可以

Che*_*eng 2 iphone bluetooth ios core-bluetooth

我有一个蓝牙条码扫描器,其规格说它是蓝牙2.0,2级.这很奇怪,因为我的iPhone 5(iOS7)可以找到并连接它.我以为iOS只连接BLE设备.但在我的应用程序中,我无法扫描此设备.我不知道这是不是因为它的蓝牙规格.我希望有人可以给我一些关于如何使用CoreBluetooth或其他一些有效库在我的应用程序中连接此设备的建议.

顺便说一下,我的代码是正确的,因为我可以在另一部iPhone上找到LightBlue应用程序.我的代码如下:

 // state is PowerOn
 [_centeralManager scanForPeripheralsWithServices:nil options:nil];
Run Code Online (Sandbox Code Playgroud)

Lar*_*rme 5

我想你通过Settings.app/Bluetooth检测到它?如果是这样,那就是"经典"的蓝牙设备.它不是蓝牙低能耗的.如果你想连接到"经典"蓝牙设备,你将不得不使用ExternalAccessory.Framework.蓝牙4.0包含两种类型的蓝牙:蓝牙"古典"和低功耗蓝牙(作为分支).这就是为什么你的iPhone可以检测到它.