Hello everybody.

I have developed two j2me classes.
The first one is a very simple MIDlet(for gui operations) and the second one is implemented by DiscoveryListener.

The DiscoveryListener implemented class returns an integer back to MIDlet class.
The MIDlet class displays a message depended on that integer number received.

This DiscoveryListener class simply discover devices around me and in its constructor I synchronized it with the inquiryCompleted(int discType) as follows:

Code:
public class Forj2meDev implements DiscoveryListener 
{
    public int Forj2meDev() 
    {
    .................
    .................
    ...........
    try
    {
       LocalDevice localdev=LocalDevice.getLocalDevice();
            
       DiscoveryAgent da = LocalDevice.getLocalDevice().getDiscoveryAgent();
       da.startInquiry(DiscoveryAgent.GIAC, this);
       while (!devDiscoveFinished)
       {
              //synchronization 
              synchronized (this) { wait(100); }
                       
        }

         .............
         ............
         ..............
         public synchronized void inquiryCompleted(int discType) 
        {
           devDiscoveFinished = true;
           System.out.print("\nDevice Discovery completed.\n");
           notifyAll();
        }
}
I have downloaded into a Nokia 6230 and it works properly.
On the other hand, in a Nokia 6600 is not working.

The problem is that does not work the line at Nokia 6600

synchronized (this) {wait(100);}

(If I remove this line is working but the message I received is wrong)

Does anybody knows what I have to do in order to syncronise successfully the both classes at Nokia 6600?

Is any other way to synchronise them?

I want to synchronize both classes in order for the DiscoveryListener to finish deiscover devices and search available Bluetooth services.


I really appreciate any help.

Regards,
kalgik