keep getting error 3 when searchServices(null, uuid, device, discoveryListener) completes, when trying to connect pc to nokia n73, anyone knows about this?
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
Hi,
Could you post related part of your code then it is easy to detect what is wrong,
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);
}
}
}