简体   繁体   中英

We develop Bluetooth Low Energy on IOS 6 with Xcode 4.5.2. The apps downloaded to a IOS5 device can connect to BLE device

We develop Bluetooth Low Energy Apps as Central on IOS 6 SDK with Xcode 4.5.2. The apps downloaded to a IOS5(IPad3) device can connect to BLE device without problem. However if this apps is to download to a IOS 6 device it will have problem. The apps can discover the BLE device(shown on the list) but when we click on to connect, it failed. We are using the latest IPod5.

I believe this is the iOS 6 bug mentioned here: iOS 6 UUID Problem

A way to quickly check would be to add an NSLog to check the peripheral name when discovering peripherals.

If peripheralName is Null, or if it crashes on CFUUIDCreateString you've found your problem. The only way that I've found to fix is to connect to the peripheral first [manager connectPeripheral:peripheral options:nil] and then disconnect and reconnect. Once you've done that you should be able to use CFUUIDCreateString without problems.

- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
   if (peripherals.count == 0)
   {
        [peripherals addObject: peripheral];
        NSString *peripheralName;
        peripheralName = [peripheral name];
        NSString *foundDevice = (NSString *)CFBridgingRelease(CFUUIDCreateString(NULL, [peripheral UUID]));
        NSLog(@"Found %@", peripheralName);

I know this sound strange, but also have terrible BLE issues with iPad3 iOS6. Namely Peripheral name does not reflect changes I introduce in micro-controller's software.

I have iPhone5 with iOS 6.1 beta 4 and iPhone 4s iOS 6.0. Both work flawlessly with my CC2540 projects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM