This discussion is archived
2 Replies Latest reply: May 16, 2010 5:49 PM by 843851 RSS

Emulator bluetooth connection problem

843851 Newbie
Currently Being Moderated
Hi! I'm developing a J2ME program with eclipse / WTK 2.5.2 and having problem with connecting two emulators using bluetooth. There is one server and one .client running on two different emulators.

The problem is client program cannot discover any bluetooth device. Here is the server and client codes:
public Server()
{
    try
    {
        LocalDevice local = LocalDevice.getLocalDevice();
        local.setDiscoverable(DiscoveryAgent.GIAC);
        
        server = (StreamConnectionNotifier)   
            Connector.open("btspp://localhost:" 
                + UUID_STRING + ";name=" + SERVICE_NAME);
                
        Util.Log("EchoServer() Server connector open!");
    }
    catch (Exception e)
    {}
}
after calling Connector.open, I get following warning in console, which i believe is related:

Warning: Unregistered device: unspecified

and client code that searches for devices:
public SearchForDevices(String uuid, String nm)
{
    UUIDStr = uuid;
    srchServiceName = nm;
    try
    {
        LocalDevice local = LocalDevice.getLocalDevice();
        agent = local.getDiscoveryAgent();

        deviceList = new Vector();

        agent.startInquiry(DiscoveryAgent.GIAC, this); // non-blocking
    }
    catch (Exception e)
    {}
}
system never calls deviceDiscovered, but calls inquiryCompleted() with INQUIRY_COMPLETED paramter, so I suppose client program runs fine.

Bluetooth is enabled at emulator settings..

any ideas ?

Edited by: GBerberoglu on Mar 14, 2010 5:31 AM