001package edu.wpi.first.wpilibj.tables;
002
003import edu.wpi.first.wpilibj.networktables.ConnectionInfo;
004
005/**
006 * A listener that listens for connection changes in a {@link IRemote} object
007 * 
008 * @author Mitchell
009 *
010 */
011public interface IRemoteConnectionListener {
012        /**
013         * Called when an IRemote is connected
014         * @param remote the object that connected
015         */
016        public void connected(IRemote remote);
017        /**
018         * Called when an IRemote is disconnected
019         * @param remote the object that disconnected
020         */
021        public void disconnected(IRemote remote);
022        /**
023         * Extended version of connected called when an IRemote is connected.
024         * Contains the connection info of the connected remote
025         * @param remote the object that connected
026         * @param info the connection info for the connected remote
027         */
028        default public void connectedEx(IRemote remote, ConnectionInfo info) {
029                connected(remote);
030        }
031        /**
032         * Extended version of connected called when an IRemote is disconnected.
033         * Contains the connection info of the disconnected remote
034         * @param remote the object that disconnected
035         * @param info the connection info for the disconnected remote
036         */
037        default public void disconnectedEx(IRemote remote, ConnectionInfo info) {
038                disconnected(remote);
039        }
040}