/** * Starts the discovery process with the configured timeout and options. * * <p>To be notified every time an XBee device is discovered, add a * {@code IDiscoveryListener} using the * {@link #addDiscoveryListener(IDiscoveryListener)} method before starting * the discovery process.</p> * * <p>To configure the discovery timeout, use the * {@link #setDiscoveryTimeout(long)} method.</p> * * <p>To configure the discovery options, use the * {@link #setDiscoveryOptions(Set)} method.</p> * * @throws IllegalStateException if the discovery process is already running. * @throws InterfaceNotOpenException if the device is not open. * * @see #addDiscoveryListener(IDiscoveryListener) * @see #stopDiscoveryProcess() */ public void startDiscoveryProcess() { if (isDiscoveryRunning()) throw new IllegalStateException("The discovery process is already running."); synchronized (discoveryListeners) { nodeDiscovery.startDiscoveryProcess(discoveryListeners); } }