Package com.thecoderscorner.menu.remote
Interface RemoteConnector
-
- All Known Implementing Classes:
Rs232RemoteConnector,SocketBasedConnector,StreamRemoteConnector,UdpRemoteConnector
public interface RemoteConnectorThis is the base interface implemented by all remote connectors, it provides the means to both send and receive menu commands. Most people just wanting to use a menu remotely won't need to understand the connector layer beyond creating a connector.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Force close a connection when its known to be bad, the connector will try and establish a new connection.java.lang.StringgetConnectionName()Gets the name of this connector locallybooleanisConnected()Gets the underlying connection state for this connector.voidregisterConnectionChangeListener(ConnectionChangeListener listener)Register for information about connection statevoidregisterConnectorListener(RemoteConnectorListener listener)register a listener that will receive any messages sent by the menu libraryvoidsendMenuCommand(MenuCommand msg)Sends a command to the menu library running on the embedded hardware.voidstart()Starts the communication channel, so it will attempt to connect with the configured devicevoidstop()Stops the library and attempts to also stop any threads and other resources associated.
-
-
-
Method Detail
-
start
void start()
Starts the communication channel, so it will attempt to connect with the configured device
-
stop
void stop()
Stops the library and attempts to also stop any threads and other resources associated.
-
sendMenuCommand
void sendMenuCommand(MenuCommand msg) throws java.io.IOException
Sends a command to the menu library running on the embedded hardware. If not connected the action is connector dependent.- Parameters:
msg- the message to send.- Throws:
java.io.IOException
-
isConnected
boolean isConnected()
Gets the underlying connection state for this connector.- Returns:
- the underlying connection state.
-
getConnectionName
java.lang.String getConnectionName()
Gets the name of this connector locally
-
registerConnectorListener
void registerConnectorListener(RemoteConnectorListener listener)
register a listener that will receive any messages sent by the menu library- Parameters:
listener- the listener
-
registerConnectionChangeListener
void registerConnectionChangeListener(ConnectionChangeListener listener)
Register for information about connection state- Parameters:
listener- the listener
-
close
void close()
Force close a connection when its known to be bad, the connector will try and establish a new connection.
-
-