适用于汽车免提设备的蓝牙UUID

时间:2017-01-24 08:20:17

标签: swift bluetooth core-bluetooth

任何人都可以帮助我使用UUID汽车免提外设连接,所以我可以使用服务调用scanForPeripherals:[SOME UUID]而不是nil,只返回免提。这有UUID或CBUUID吗?我希望这可以在服务级别完成,而不需要查看特性。如果你能帮助我,请提前致谢。

func centralManagerDidUpdateState(_ central: CBCentralManager) {

    if central.state == .poweredOn {
        self.centralManager.scanForPeripherals(withServices: [UUID HERE] , options: nil)
    } else {
        print("central not powered on")
    }
}

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {

    print("peripheral discovered")
    peripheralLabel.text = peripheral.name
}

1 个答案:

答案 0 :(得分:3)

免提设备实现蓝牙免提协议(HFP)。这不是蓝牙低功耗GATT服务,因此没有服务UUID。使用Core Bluetooth无法发现它们。