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
Developer
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Search for Bluetooth device in range

Hello,

is there a function to scan for bluetooth devices in range?

I looked into the APIs but could not find something for that.

 

Thank you.

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Search for Bluetooth device in range

I haven't used this but IIRC there is nothing in RIM re server discovery but it is in the jsr,

 

$ grep -il discovery *.txt
bluetooth.DeviceClass.txt
bluetooth.DiscoveryAgent.txt
bluetooth.DiscoveryListener.txt
bluetooth.L2CAPConnection.txt
bluetooth.LocalDevice.txt
bluetooth.ServiceRecord.txt
bluetooth.ServiceRegistrationException.txt
bluetooth.UUID.txt
bluetooth.package-frame.txt
bluetooth.package-summary.txt
bluetooth.package-tree.txt
microedition.io.Connector.txt

 

 

 

 

 

Please use plain text.
Developer
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Search for Bluetooth device in range

I didn't completly understand the message but is it possible at all from the give APIs?
If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Search for Bluetooth device in range

Sorry, those are the class in javax/bluetooth for devices that support the j2me jsr. In the RIM API,

AFAIK prior 4.3 anyway, there is nothing overtly supporting device discovery which I believe is the term

for what you want.

http://developers.sun.com/mobility/midp/articles/bluetooth2/

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Search for Bluetooth device in range

I suspect the JSR-82 Discovery API might help.

 

As a test, I tried the code that you will find here:

http://mobile.liveshere.net/articles/viewarticle.php?id=20

 

This uses the JSR82 Discovery processing to find devices.  I've only done limited testing with this, however it seems what you get depends on the level of OS you have.  In 4.2, this code will only find paired devices.  In 4.5, this will find paired devices and attempt to pair with any Bluetooth devices in the vicinity, which is very interesting behavior.  Due to other work, I've not had time to do anything further with this.  I'd be very interested to see how you get on.

Please use plain text.