【问题标题】:Bluetooth UUID for car handsfree devices车载免提设备的蓝牙 UUID
【发布时间】:2017-01-24 08:20:17
【问题描述】:

任何人都可以帮助我提供用于汽车免提外围设备连接的 UUID,因此我可以调用 scanForPeripherals withServices: [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
}

【问题讨论】:

    标签: swift bluetooth core-bluetooth


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-13
      • 1970-01-01
      相关资源
      最近更新 更多