마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 BLE 연결오류

0 추천

안녕하세요.

JDY-10이라는 블루투스 4.0칩과 안드로이드 sdk 7.0 핸드폰과 통신을 구현하고 있습니다.

이유는 모르겠지만 안드로이드 기본 세팅의 블루투스 pairing이 되지 않아서 insecure로 연결하려고 합니다.

스토어의 다른 ble 채팅 예제를 돌려봤을때는 통신이 됐는데 제가 돌린 코드에서는 계속 오류가 뜨네요..

 

 

밑은 코드를 돌렸을때의 에러 로그입니다.

W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
E/BT: Fallback failed. Cancelling.
      java.io.IOException: read failed, socket might closed or timeout, read ret: -1
          at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:907)
          at android.bluetooth.BluetoothSocket.waitSocketSignal(BluetoothSocket.java:866)
          at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:540)
          at com.ramimartin.multibluetooth.bluetooth.client.BluetoothConnector$FallbackBluetoothSocket.connect(BluetoothConnector.java:220)
          at com.ramimartin.multibluetooth.bluetooth.client.BluetoothConnector.connect(BluetoothConnector.java:60)
          at com.ramimartin.multibluetooth.bluetooth.client.BluetoothClient.waitForConnection(BluetoothClient.java:47)
          at com.ramimartin.multibluetooth.bluetooth.BluetoothRunnable.run(BluetoothRunnable.java:60)
          at java.lang.Thread.run(Thread.java:762)


      [ 11-25 15:29:27.225 21514:22163 E/         ]
      ===> mSocket IOException : ===> Could not connect to device: A4:C1:38:77:27:E5

익명사용자 님이 2017년 11월 25일 질문

1개의 답변

0 추천
 
채택된 답변
상기 BluetoothSocket은 2.0이 아닌가요?

BLE는 BluetoothGatt을 이용해서 통신해야 하는 것으로 알고 있습니다.
Will Kim (43,170 포인트) 님이 2017년 11월 25일 답변
제가 잘못 생각하고 있었네요.. 감사합니다!
...