Welcome!

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

Reply
New Developer
Posts: 6
Registered: ‎08-04-2008
My Device: Not Specified
Accepted Solution

BluetoothSerialPort explain DSR / DTR?? Does BluetoothSerialPortListener dataReceived() block??

[ Edited ]

Hello,

Two questions please.

 

Can someone please shead some light on what DSR / DTR is, in relation to Bluetooth? In the BluetoothDemo.SSPScreen there are 3 menu items: "Get DTR" , "DSR on", "DSR off". What are these for and why would I turn DSR on or off?

 

When implementing BluetoothSerialPortListener, does the method dataReceived block until the method finishes or only until _port.read(buf, 0, 1024)) !=0) is finished loading the byte buffer?? While reading NEMA sentences from a puck some data is observed as corrupt, so we're wondering whos fault it is this.developer, or the puck? Do I need to create some blocking logic until the entire method is finished?

 

 

 

 

 

Thank you in advance.

 

 

Message Edited by pacred on 08-30-2008 11:44 AM
Message Edited by pacred on 08-30-2008 11:44 AM
BlackBerry Development Advisor
Posts: 15,070
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: BluetoothSerialPort explain DSR / DTR?? Does BluetoothSerialPortListener dataReceived() block??

The Bluetooth Serial Port profile emulates a wired serial port.  DTR maps to the DTR line on a serial port (the wired kind, not Bluetooth).  We don't have any documentation on this to provide but it isn't specific to BlackBerry or Bluetooth, so you can read more about it in general serial port documentation.

 

The BluetoothSerialPortListener.dataReceived method is fired when data has arrived to the BlackBerry, passing in the length of the data that is available to be read.  Your implementation can read up to the size specified in length, but should not block, waiting for more data.  When more data is available the method should fire again.  Please have a look at the BluetoothSample included with the BlackBerry JDE for an example.

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