Search code examples
androidbluetoothserial-portrfcomm

Android Bluetooth Serial/RFCOMM/SPP, How to Change the BAUD RATE?


This is very frustrating as I've been trying for weeks and not even a clue on the internet.

I am working on a project that reads/writes bluetooth serial data on different farming hardware.

most of these hardware are old and changing the baud rate of their SPP is not an option.

I'm using the android bluetooth chat as a basis to read/write, I've only changed the UUID to allow connection to the devices I have

I've managed to read from a tag reader at a bad rate of 19,200 beautifully, and formatted nicely

However, I'm stuck now with the scales which has a baud rate of 9,600 and shows funny characters in my app, not even close to the format that should come from the scales

This project was done previously on a old Windows Mobile and baud rates could be changed in their API

Is there a way to do this in Android or am I barking up the wrong tree?


Solution

  • Presumably some Bluetooth to serial converter is attached to the legacy devices? If so you should be able to program it once to always use a particular bit rate. Then there would be no need for the Bluetooth client to set the bit rate...