BluetoothSocket.connect() throwing exception “read failed”

前端 未结 4 1424
一向
一向 2020-12-08 17:19

I have a project that connects to a device over Bluetooth. It used to work fairly reliably, but now it fails the BluetoothSocket.connect() call every time. (W

4条回答
  •  无人及你
    2020-12-08 18:10

    In my case it was due to bad UUID in createRfcommSocketToServiceRecord() function. I want to connect to SPP serial profile in raspberry pi 3 and I used this UUID:

    private static final UUID MY_UUID_SECURE =
                UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
    

    I found somewhere in android documents' page for SPP.

提交回复
热议问题