i'm currently using CoreBluetooth to scan for peripheral that i have connected before with specific identifier then only connect to the peripheral. I know i can do this by scan for peripheral with service, then compare with the identifier if the condition meet then connect to the peripheral as the code below
func discoverDevices(){
centralManager.scanForPeripheralsWithServices([CBUUID(string: "1234")], options: nil)
}
func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber) {
if peripheral.identifier == NSUUID(UUIDString: "AD4612DG87-7512-683D-79RT-234DFG987RUI{
self.centralManager.connectPeripheral(peripheral, options: nil)
}
}
is there any other proper way to directly scan for the specific peripheral? Thank you