2017-01-24 8 views
0

자동차 핸즈프리 주변 장치 연결을 위해 UUID를 도와 줄 수있는 사람이 없으므로 scanForPeripherals withServices : [일부 UUID]를 nil 대신 호출하고 핸즈프리 만 반환 할 수 있습니다. 이것을위한 UUID 또는 CBUUID가 있습니까? 나는 이것이 서비스 수준에서 이루어질 수 있고 특성을 볼 필요가 없기를 바란다. 네가 나를 도울 수 있다면 미리 감사드립니다.자동차 핸즈프리 장치 용 블루투스 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가 없습니다. Core Bluetooth를 사용하여 검색 할 수 없습니다.