Ios 如何使用Swift扫描非LE设备?
我有RFID阅读器,不是LE设备 我正在尝试编写一个iOS应用程序,扫描此设备并使用swift Core蓝牙库连接它,但我的应用程序找到了除此设备之外的所有内容。如何扫描此读卡器Ios 如何使用Swift扫描非LE设备?,ios,swift,iphone,core-bluetooth,Ios,Swift,Iphone,Core Bluetooth,我有RFID阅读器,不是LE设备 我正在尝试编写一个iOS应用程序,扫描此设备并使用swift Core蓝牙库连接它,但我的应用程序找到了除此设备之外的所有内容。如何扫描此读卡器 import UIKit import CoreBluetooth class ViewController: UIViewController, CBCentralManagerDelegate { var manager: CBCentralManager! override func vi
import UIKit
import CoreBluetooth
class ViewController: UIViewController, CBCentralManagerDelegate {
var manager: CBCentralManager!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
manager = CBCentralManager(delegate: self, queue: nil)
}
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
print(peripheral)
}
func centralManagerDidUpdateState(_ central: CBCentralManager) {
switch central.state {
case .unknown:
break;
case .poweredOff:
break;
case .poweredOn:
manager.scanForPeripherals(withServices: nil)
break;
case .resetting:
break;
case .unauthorized:
break;
case .unsupported:
break;
default:
break;
}
}
}
您需要使用CoreNFC来读取RFID标签。根本不需要使用CoreBluetooth
该设备声明已通过MFi认证,并使用SPP配置文件,而不是BLE GATT配置文件。这意味着您需要使用外部附件框架,而不是核心蓝牙来与之通信 您需要向为设备提供的制造商咨询。如果他们这样做了,而你想在应用商店发布你的应用程序,那么他们还需要批准你的应用程序,并向苹果提供一些文件
该设备表示它还支持HID配置文件,因此您可以将其视为键盘;这不需要任何代码,但不是最好的用户体验。此设备有一个新的解决方案。那会有帮助吗?@Codo我会检查的。非常感谢。你已经帮了我两次了,谢谢你的回复。我已经为Android构建了APK。是否还需要联系制造商在Play Store上发布APK?否,Android/Google没有限制SPP的使用。苹果要求MFi许可证持有人批准你的应用程序使用其外围设备的标识符。我已经实施了你关于使用外部附件框架编写我的应用程序的建议,但当我的设备扫描NFC标签时,输入流阅读器代理不会启动。我在这里发布了一个新问题。你能帮助我吗?