05-10-2009 03:10 PM
I am trying to change the baud rate for a bluetooth connection I have established with my Blackberry, but I am not sure how to do it. I am using the "Bluetooth Serial Port Demo" program which establishes a connection using the following code:
(StreamConnection) Connector.open(info.toString(), connector.READ_WRITE); _din = _bluetoothConnection.openDataInputStream(); _dout = _bluetoothConnection.openDataOutputStream();
The other serial port demo program, "Bluetooth Sample" has a few lines that allow the baud rate to be changed, but I have not been able to make this program connect to my Bluetooth device.
_port = new BluetoothSerialPort("Hi there", BluetoothSerialPort.BAUD_115200, BluetoothSerialPort.DATA_FORMAT_PARITY_NONE | BluetoothSerialPort.DATA_FORMAT_STOP_BITS_1 | BluetoothSerialPort.DATA_FORMAT_DATA_BITS_8, BluetoothSerialPort.FLOW_CONTROL_NONE, 1024, 1024, this);
Is there a way to change the baud rate when making the first type of connection to the Bluetooth? Any help would be greatly appreciated.
05-10-2009 03:57 PM
Ah I found out how to do it; in case anyone is interested it's in the CommConnection interface:
12-08-2009 06:05 PM
Hi, I am running into the same problem and can't seem to get it to work with CommConnection. Could you give some more details?
I am assuming that you changed this:
_bluetoothConnection = (StreamConnection) Connector.open(info.toString(), connector.READ_WRITE);