×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    30

    SERVICE SEARCH ERROR on searchServices

    keep getting error 3 when searchServices(null, uuid, device, discoveryListener) completes, when trying to connect pc to nokia n73, anyone knows about this?
    Last edited by mahmoudhadad; 2008-07-10 at 17:20. Reason: missing details

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: SERVICE SEARCH ERROR on searchServices

    Hi,
    Could you post related part of your code then it is easy to detect what is wrong,

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    30

    Re: SERVICE SEARCH ERROR on searchServices

    hey mahbub,
    sorry for the late reply, bad conn., this is the code in bluecove:

    import java.io.IOException;
    import java.util.Vector;
    import javax.bluetooth.*;
    import javax.obex.*;

    /**
    * Minimal Device Discovery example.
    */
    public class RemoteDeviceDiscovery {

    public static final Vector<RemoteDevice> devicesDiscovered = new Vector<RemoteDevice>();


    static LocalDevice local = null;
    static DiscoveryAgent agent = null;
    int[] attrSet = null;
    static RemoteDevice btDev = null;
    static String serviceURL = null;
    static ClientSession con = null;
    static HeaderSet hdr = null;

    public static void main(String[] args) throws IOException, InterruptedException {

    final Object inquiryCompletedEvent = new Object();

    DiscoveryListener listener = new DiscoveryListener() {

    public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
    System.out.println("Device " + btDevice.getBluetoothAddress() + " found");

    devicesDiscovered.addElement(btDevice);
    try {
    System.out.println(" name " + btDevice.getFriendlyName(false));
    } catch (IOException cantGetDeviceName) {
    }

    }

    public void inquiryCompleted(int discType) {
    System.out.println("Device Inquiry completed! " + discType);
    synchronized(inquiryCompletedEvent){
    inquiryCompletedEvent.notifyAll();
    }
    }


    public void serviceSearchCompleted(int transID, int respCode) {
    System.out.println("OK, Completed: "+respCode);


    }

    public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
    for(ServiceRecord s: servRecord)
    {
    System.out.println("Servies: " + s.toString());
    }
    }
    };

    synchronized(inquiryCompletedEvent) {
    DiscoveryAgent da = LocalDevice.getLocalDevice().getDiscoveryAgent();
    boolean started = da.startInquiry(DiscoveryAgent.GIAC, listener);

    if (started) {
    System.out.println("wait for device inquiry to complete...");
    inquiryCompletedEvent.wait();
    System.out.println(devicesDiscovered.size() + " device(s) found");

    }
    System.out.println("bt powered: " + LocalDevice.isPowerOn());
    int b = 0;
    UUID[] uuidSet = new UUID[1];

    uuidSet[0] = new UUID(0x1105);

    System.out.println("\nSearching for service...");
    da.searchServices(null,uuidSet,devicesDiscovered.get(1), listener);


    }
    }

    }

Similar Threads

  1. Possible to do service search without device search?
    By ed_welch in forum Mobile Java Networking & Messaging & Security
    Replies: 8
    Last Post: 2008-02-11, 11:35
  2. 6630 Hangs up on Service Search :(
    By nuno.rodrigues in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2007-10-24, 16:15
  3. Replies: 4
    Last Post: 2006-09-05, 15:15
  4. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •