Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 2
Registered: ‎11-30-2008
My Device: Not Specified

Why reading Bluetooth Port blocks?



I noticed that when I read data from the Bluetooth port, sometimes it takes a long time to read (over a 1000 milliseconds instead 4milliseconds).   Is it normal?  What causes the blocking?  Is there a way to avoid or minimize as much as possible the blocking on the reading of the port?


This is what I used to create the port:


_port = new BluetoothSerialPort(info, 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);


This is how I read the data and it is in a separate thread:


if ((len = _port.read(_receivedBuffer)) >0 ) {...}


I am using the Blackberry 8800 and Blackberry JDE


BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Why reading Bluetooth Port blocks?

Much of this can depend on the Bluetooth device on the other end.  Is it performing any processing before sending the data?  There isn't much you can do on the BlackBerry handheld side to speed up the data transfer of the device on the other side.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker