就是if x==y这行代码
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
if !peripheralData.contains(peripheral){
peripheralData.append(peripheral)
var x:String = "Easy"
let y:String = "EasyEngrave"
if peripheral.name!.isEmpty{
}else{
x=peripheral.name!
}
if x != ""{
if x==y{
connect(peripheral: peripheral)
}
}
//ViewController.connectname.text=ViewController.connectname.text!+x
}
}