2017-10-02 1 views
0

연결된 모든 주변 장치 목록을 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)") 
    } 
} 
+1

블루투스 클래식뿐만 아니라 정말 이지요? – Larme

+0

게시물을 보내 주셔서 감사합니다. https://meta.stackoverflow.com/questions/288160/no-thanks-damn-it –

+0

좋은 장소 Larme, The Bose가 실제로 Bluetooth Classic입니다. 조금도! – richc

답변

0

, 나의 제안은 다음과 같습니다 retrieveConnectedPeripherals에 매개 변수로 문자열 (180A)를 추가합니다. 모든 Bluetooth 스마트 장치는 장치 정보 (180A) 서비스를 구현합니다 (적어도이 장치 정보).

관련 문제