• Post Reply Bookmark Topic Watch Topic
  • New Topic

BluetoothStateException

 
john kenedi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to develope a tiny j2se application can discover all BlueTooth devices around it.
I have imported jsr 82 libs, and compile it successfully,
But I get a runtime exception when it reach to the bold line of the code:

try
{
Class.forName("javax.bluetooth.LocalDevice");
System.out.print(" ");
try
{
locDevice = LocalDevice.getLocalDevice();
agent = locDevice.getDiscoveryAgent();
agent.startInquiry( DiscoveryAgent.GIAC, new Listener() );
}
catch (BluetoothStateException e)
{
e.printStackTrace();
}
}
catch (Exception e)
{

System.out.print(" ");
}


As you see, I've passed the first try segment, so
javax.bluetooth.LocalDevice is exist!

ummm, and I am using a USB Dongle BlueTooth in my PC,
where is the reason of this exception???
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to "Other Java APIs."
 
john kenedi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't there any Idea?!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!