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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
lyon819
Posts: 248
Registered: ‎08-19-2010
My Carrier: TT

RFCOMM protocol with Bluetooth. How to connect??

Purpose:

Data retrieve from a RFCOMM bluetooth device.

 

Problem:

Can use Android device to do that, but fail on BB device.

String uuid = "00001101-0000-1000-8000-00805F9B34FB";
sock = bt.getRemoteDevice(addr).createRfcommSocketToServiceRecord(UUID.fromString(uuid));
sock.connect();

Try to find the same way on BB 9900.

 

code:

UUID[] uuidSet = {new UUID(_uuid)};
int[] attrSet = {0x0100};
bugrecord.writeStringToLog("UUID[] uuidSet\n");
RemoteDevice _remoteDevice = (RemoteDevice) _model.getRow(_view.getRowNumberWithFocus());
//stop here?? searchService does not support RFCOMM. 
_discoveryAgent.searchServices(attrSet, uuidSet, _remoteDevice, ClientScreen.this);

 

Does anyone know how to find a RFCOMM service by bluetooth??

 

Thank your attention,

 

 

 

-Fight with BB10
Please use plain text.