iOS bluetooth scanForPeripheralsWithServices no results
bluetooth, bluetooth-lowenergy, core-bluetooth, ios
Solution
Scan with `nil` services to check whether the peripheral you are looking for actually advertises anything. When the `centralManager:didDiscoverPeripheral:advertisementData:RSSI:` is called, check out the advertisement data. Simply `NSLog()` it. If 0x1802 is not in it, then the peripheral is not advertising this service and the scanner will not find it this way. To correct this, include the service in the advertisement setup:
NSDictionary *advData =
@{CBAdvertisementDataServiceUUIDsKey:@[[CBUUID UUIDWithString:@"1802"]]};
[peripheralManager startAdvertising:advData];
Problem
When I use iOS bluetooth, code like this: ``` static NSString * const kServiceUUID = @"1802"; [self.manager scanForPeripheralsWithServices:@[ [CBUUID UUIDWithString:kServiceUUID] ] options:@{CBCentralManagerScanOptionAllowDuplicatesKey : @NO }]; ``` why no response? I have tried kinds of parameter pairs in method scanForPeripheralsWithServices I have checked this question: How to get list of available Bluetooth devices? My device is iPod touch 5 (jailbroken) with iOS 6. I have already test some bluetooth 4.0 devices. Can anyone tell me why?