@Override
	public void detectDevs() {
		final Object inquiryCompletedEvent = new Object();
		resetDevs();
		DiscoveryListener listener = new DiscoveryListener() {
			public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
				String address = null;
				String friendlyName = null;
				
				try {
					friendlyName = btDevice.getFriendlyName(false);
					address = btDevice.getBluetoothAddress();
					friendlyNameMap.put(address, friendlyName);
				} catch (IOException e) {
					if(friendlyName == null && address != null) {
						friendlyNameMap.put(address, "");
					}
				}
				
			}

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

			public void serviceSearchCompleted(int transID, int respCode) {
			}

			public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
			}
		};

		synchronized(inquiryCompletedEvent) {
			try{
				boolean started = LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC, listener);
				if (started) 
					inquiryCompletedEvent.wait();
			}catch(Exception e) {
				e.printStackTrace();
			}

		}
	}