2017-01-24 10 views
0

車のハンズフリー周辺機器接続用のUUIDを手伝ってくれる人は誰でも可能ですので、scanForPeripherals withServices:nilではなく[SOME UUID]を呼び出して、ハンズフリーしか返せません。これにはUUIDまたはCBUUIDはありますか?私は、これがサービスレベルで行われ、特性を見る必要がないことを願っています。あなたが私を助けることができれば、事前に感謝します。車のハンズフリーデバイス用のBluetooth UUID

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 
} 

答えて

3

ハンズフリーデバイスは、Bluetoothハンズフリープロトコル(HFP)を実装しています。これはBluetooth Low Energy GATTサービスではないため、サービスUUIDはありません。コアBluetoothを使用して検出することはできません。

関連する問題