Send Command to Bluetooth from Android device

后端 未结 3 1776
天命终不由人
天命终不由人 2021-01-07 19:52

I am getting a issue to send Commands from my android device to Bluetooth device.

Bluetooth is associated with a micro-controller. My effort is below:



        
3条回答
  •  粉色の甜心
    2021-01-07 20:50

    As you have mentioned that the issue is there on mmSocket.connect(); line hence, the problem is not while you are sending the command but creating a connection i.e. you are not able to retrieve a BluetoothSocket in opened or connected state.

    What should you do ?

    Try to use the below code with UUID , its valid for my bluetooth dongles.

    UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"); createInsecureRfcommSocketToServiceRecord(MY_UUID)

    Let me know if this works for you.

    Also check, https://stackoverflow.com/a/18786701/1503130

提交回复
热议问题