使用
centralManager.scanForPeripherals(withServices: nil)
我打印出附近所有的蓝牙设备,输出示例为
<CBPeripheral: 0x2819241e0, identifier = CDF9E8B5-370B-A593-5AC5-F73E37BDC5C4, name = (null), state = disconnected>
然后我尝试使用此标识符过滤centralManager.scanForPeripherals():
let device = CBUUID(string: "CDF9E8B5-370B-A593-5AC5-F73E37BDC5C4")
centralManager.scanForPeripherals(withServices: [device])
,我什么也没得到,结论是这个标识符显然不是我需要的服务标识符。
如何找到我所有设备的服务标识符?或使用另一种过滤方式仅显示我要查找的内容。