When I try a blutooth demo, I encountered some problems at starting booth connection;
the code as follows;
try
{
System.out.println("$$$ getLocalDevice start 1");
LocalDevice localDevice = LocalDevice.getLocalDevice();
System.out.println("$$$ setDiscoverable start 2");
localDevice .setDiscoverable(DiscoveryAgent.GIAC);
System.out.println("$$$ setDiscoverable sucess 3 ");
}
catch(BluetoothStateException e)
{
System.out.println("$$$ setDiscoverable failed 4 ");
String msg = "Error changing inquiry access type: " +
e.getMessage();
ErrorScreen.showError(msg, settingsList);
}
when I execute this code in nokia emulator, the midlet progrem is blocked , console messages only as follows:
System.out.println("$$$ getLocalDevice start 1");
System.out.println("$$$ setDiscoverable start 2");
the trace message 3 or 4 cant't be printed forever , so I think the progrem is blocked;
What's the problem with the code? Or some configurations of my emulator cause the problem;
Please help me! Thank you!
the emulator is Nokia_Prototype_SDK_4_0\devices\Prototype_4_0_S40_128x160_MIDP_Emulator;
my develop platform is Eclipse + Nokia_Prototype_SDK_4_0 + carbide1.0

Reply With Quote

