Hi, I tested almost same code from NetBeans IDE 6.8 with WTK 2.5.2_01 emulator and it works well. (I mean it discovered device)
public void startBTServer() {
try
{
LocalDevice local = LocalDevice.getLocalDevice();
local.setDiscoverable(DiscoveryAgent.GIAC);
StreamConnectionNotifier server = (StreamConnectionNotifier)
Connector.open("btspp://localhost:F0E0D0C0B0A000908070605040302010"
+ ";name=" + ";test");
}
catch (Exception e)
{}
}
public void startBTClient() {
String UUIDStr = "F0E0D0C0B0A000908070605040302010";
try
{
LocalDevice local = LocalDevice.getLocalDevice();
DiscoveryAgent agent = local.getDiscoveryAgent();
agent.startInquiry(DiscoveryAgent.GIAC, (DiscoveryListener) this);
}
catch (Exception e)
{}
}
public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
System.out.println("device discovered:" + btDevice.toString());
}
This code print out the below log:
From server:
Running in the identified_third_party security domain
Device Bluetooth Address: 0000000DECAF
From client:
Device Bluetooth Address: 0123456789AF
device discovered:RemoteDevice[address=0000000DECAF, name=null, encrypted=false, authenticated=false]
Wonil
2010-03-16 04:09:57