1
votes

I would like to send and receive data from my phone to an application on my computer that just connect to a PORT COM and can also send and receive data (like an UART). An exemple of such software (on the computer) is Termite.

For the Android app, I tried with the Bluetoothchat that Android support provides but when I try to connect to my computer, it says it is unable to connect.

I don't know if I am doing it correctly because on the computer software, you have to choose the Baud rate for the UART communication but BT has no baudrate.

Could someone enlighten me?

2

2 Answers

0
votes

I suppose you have to do pairing step between your phone and your computer in order to establish a channel (an RfComm channel) to exchange data.

I suggest you to download a bluetooth terminal like this one from the store: https://play.google.com/store/apps/details?id=es.pymasde.blueterm&hl=en

0
votes

I had actually 2 problems going on :

  • I had to go in the settings of my Bluetooth dongle and create a Bluetooth COM Port associated with it
  • I had to change in the code the UUID (Universally Unique Identifier): the UUID for the SPP (Serial Port Service) is defined by the Bluetooth SIG to be 0x1101. If you are connecting to a Bluetooth serial board, then try using the "well-known" SPP UUID : 00001101-0000-1000-8000-00805F9B34FB with this code line:

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

(I put the same for both MY_UUID_SECURE and MY_UUID_INSECURE just to check if it was working)

And then this solved my problem. Hope it can help some people who have the same problems.