5

我在 iPhone 4S 上运行的 iOS 5.0 中有一个稳定的工作应用程序。我们迁移到 iOS 6.0 以在具有蓝牙低功耗的 iPod(第 5 代)上运行。在 iPhone 4S 上,我们可以随意配对/绑定、连接、断开和重新连接。我们在 iPod 上做同样的事情时遇到了问题。应用程序成功断开连接并重新连接,该过程可以重复 2-3 次,之后我们开始收到 Core Bluetooth Error : 14。这是日志的样子

012-12-04 11:30:24.293 Milan[524:907] DISCONNECTED WITH READER: SriRdr11
2012-12-04 11:30:24.295 Milan[524:907] Start Time 376331424.295754 =
2012-12-04 11:30:28.241 Milan[524:907] NSConcreteNotification 0x1dd607d0 
2012-12-04 11:30:28.243 Milan[524:907] MAIN PERIPHERAL: 5F953B12-D99F-D770-4F3F-B741BA026858
2012-12-04 11:30:28.617 Milan[524:907] CONNECTED WITH PERIPHERAL: DEVICE1
2012-12-04 11:30:29.173 Milan[524:907] DISCONNECTED WITH PERIPHERAL: DEVICE1
2012-12-04 11:30:29.176 Milan[524:907] Error: The specified device has disconnected from us. -   
(null)

应用认为BLE外设与它断开连接,外设认为应用与阅读器断开连接。很明显,这是应用程序在这里做一些奇怪的事情。有人可以解释这里发生了什么吗?

这是 didDiscoverPeripheral 中为重新连接而调用的代码。

NSString* uuid = [peripheral uuidString]; NSString* readerName = [advertisementData    
objectForKey:@"kCBAdvDataLocalName"]; 
int meterID= 0; 
NSData *deviceIdData = [NSData dataWithBytes:&meterID length:sizeof(meterID)]; 
NSLog(@"DEVICE DISCOVERED: %@ (%@)", deviceName, uuid); 
[[[DeviceBluetoothManager sharedInstance]allPeripherals] setObject:deviceIdData forKey:peripheral
uuidString]]; 
[[DeviceDefaultsManager sharedInstance] adddeviceIdToFavorites:deviceIdData 
readerName:readerName withPeripheralId:[peripheral UUID]]; 
NSDictionary* deviceInfo = [NSDictionary dictionaryWithObject:peripheral forKey:kDeviceKey];  
[[NSNotificationCenter defaultCenter] postNotificationName:kBluetoothDeviceDiscovered 
object:self userInfo:deviceInfo];

另一个问题是是否有任何配对或粘合

4

0 回答 0