Home iOS Core Bluetooth not working on Bluetooth 5.0 Devices (iPhone X, iPhone 8, iPhone 8 Plus)
Reply: 0

iOS Core Bluetooth not working on Bluetooth 5.0 Devices (iPhone X, iPhone 8, iPhone 8 Plus)

Victor
1#
Victor Published in 2018-02-14 08:46:54Z

I'm working on BLE, my code run perfectly on bluetooth 4.2 devices (iPhone SE, iPhone 6, iPhone 6 Plus, iPhone 7). When I switch to on Bluetooth 5.0 devices(iPhone X, iPhone 8 Plus), my code will stop at didDiscoverPeripheral function, will not get into didConnectPeripheral function.

- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {

    if ([peripheral.name isEqualToString:bleDic[@"name"]]) {

        self.connectedPeripheral = peripheral;
        self.connectedPeripheral.delegate = self;                           
        [self.cm connectPeripheral:self.connectedPeripheral options:nil];
    }
}

- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral {

   [self.connectedPeripheral discoverServices:@[[CBUUID UUIDWithString:ServiceUUID]]];
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.29826 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO