001/**
002 * Copyright (c) 2014-2015 Digi International Inc.,
003 * All rights not expressly granted are reserved.
004 *
005 * This Source Code Form is subject to the terms of the Mozilla Public
006 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
007 * You can obtain one at http://mozilla.org/MPL/2.0/.
008 *
009 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
010 * =======================================================================
011 */
012package com.digi.xbee.api.listeners;
013
014import com.digi.xbee.api.RemoteXBeeDevice;
015
016/**
017 * Interface defining the required methods that an object should implement to be 
018 * notified about device discovery events. 
019 */
020public interface IDiscoveryListener {
021
022        /**
023         * Notifies that a remote device was discovered in the network.
024         * 
025         * @param discoveredDevice The discovered remote device.
026         * 
027         * @see com.digi.xbee.api.RemoteXBeeDevice
028         */
029        public void deviceDiscovered(RemoteXBeeDevice discoveredDevice);
030        
031        /**
032         * Notifies that an error occurred during the discovery process.
033         * 
034         * <p>This method is only called when an error occurs but does not cause 
035         * the process to finish.</p>
036         * 
037         * @param error The error message.
038         */
039        public void discoveryError(String error);
040        
041        /**
042         * Notifies that the discovery process has finished.
043         * 
044         * @param error The error message, or {@code null} if the process finished 
045         *              successfully.
046         */
047        public void discoveryFinished(String error);
048}