我正在尝试获取连接到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)")
}
}