【发布时间】:2017-10-02 12:15:52
【问题描述】:
我正在尝试获取所有连接到 iPhone 的外围设备的列表。我连接了 Bose Soundlink,但它没有显示在我的应用程序中。我不知道 UUID,所以正在传递 [] 因为这应该得到我的想法?
func centralManagerDidUpdateState(_ central: CBCentralManager) {
var message = ""
switch central.state {
case .poweredOn:
message = "Bluetooth LE is turned on and ready for communication."
// scan for ALL devices
centralManager.scanForPeripherals(withServices: nil, options: nil)
let connectedPeripherals = self.centralManager.retrieveConnectedPeripherals(withServices: [])
// WILL [] RETURN ALL CONNECTED PERIPHERALS?
print("connectedPeripherals are \(connectedPeripherals)")
}
}
【问题讨论】:
-
它真的是 BLE,而不仅仅是蓝牙经典吗?
-
请不要对您的帖子添加感谢,请参阅meta.stackoverflow.com/questions/288160/no-thanks-damn-it
-
好地方 Larme,Bose 确实是蓝牙经典。该死!
-
@richc 你还记得你是怎么解决的吗?
标签: ios swift bluetooth-lowenergy