FileDocCategorySizeDatePackage
BlueLoggerFinder.javaAPI DocExample1532Thu Feb 16 12:50:16 GMT 2006None

BlueLoggerFinder

public class BlueLoggerFinder extends Object implements DiscoveryListener

Fields Summary
private DiscoveryAgent
agent
private RemoteDevice
device
Constructors Summary
Methods Summary
public voiddeviceDiscovered(RemoteDevice device, DeviceClass type)

    int major = type.getMajorDeviceClass();
    try {
      if (device.getFriendlyName(false).startsWith("Earthmate Blue Logger")) {
        this.device = device;
        // stop looking for other devices
        agent.cancelInquiry(this);
        // wake up the main thread
        synchronized(this){
          this.notify();
        }
      }
    } 
    catch (IOException ex) {
      // Hopefully this isn't the device we're looking for
    }
  
public static RemoteDevicefind()

 
    BlueLoggerFinder search = new BlueLoggerFinder();
    search.agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
    search.agent.startInquiry(DiscoveryAgent.GIAC, search);
    // wait for inquiry to finish
    synchronized(search){
      try {
        search.wait();
      } 
      catch (InterruptedException ex) {
        // continue
      }
    }
    return search.device;
  
public voidinquiryCompleted(int discoveryType)

public voidserviceSearchCompleted(int transactionID, int arg1)

public voidservicesDiscovered(int transactionID, ServiceRecord[] record)