iOS 8蓝牙无法找到任何设备
我用蓝牙ios应用程序控制arduino。我的应用程序在ios7上运行良好。所以我更新了ios 8,但它不工作。我是新手程序员。我如何适应ios8?这是查找外围设备代码。库是否已更新?可能还有另一个委托方法处理定位的外围设备。您需要显示更多代码。ios7和iOS8之间的主要变化是ios7发出警告,如果您在开机状态之前尝试执行操作,iOS8将失败。您的iOS 8蓝牙无法找到任何设备,ios,bluetooth,ios8,bluetooth-lowenergy,Ios,Bluetooth,Ios8,Bluetooth Lowenergy,我用蓝牙ios应用程序控制arduino。我的应用程序在ios7上运行良好。所以我更新了ios 8,但它不工作。我是新手程序员。我如何适应ios8?这是查找外围设备代码。库是否已更新?可能还有另一个委托方法处理定位的外围设备。您需要显示更多代码。ios7和iOS8之间的主要变化是ios7发出警告,如果您在开机状态之前尝试执行操作,iOS8将失败。您的CentralManagerDipDateState方法是什么?@Paulw11这里的uuid似乎不适用于ios8?您在didUpdateState
CentralManagerDipDateState
方法是什么?@Paulw11这里的uuid似乎不适用于ios8?您在didUpdateState
中没有执行任何操作-重要的是,您要实现此方法,以确保在通电之前不会调用scanforPeripherSwithServices
。我知道您在findHMSoftPeripherals
中检查了状态,但是如果返回-1,您还记得这个方法吗?
- (int) findHMSoftPeripherals:(int)timeout {
if ([manager state] != CBCentralManagerStatePoweredOn) {
printf("CoreBluetooth is not correctly initialized !\n");
return -1;
}
[NSTimer scheduledTimerWithTimeInterval:(float)timeout target:self
selector:@selector(scanTimer:)
userInfo:nil repeats:NO];
//[manager scanForPeripheralsWithServices:[NSArray arrayWithObject:serviceUUID]
options:0]; // start Scanning
[manager scanForPeripheralsWithServices:nil options:0];
return 0;
}