Package com.thecoderscorner.menu.remote
Class RemoteMenuController
java.lang.Object
com.thecoderscorner.menu.remote.RemoteMenuController
This class manages a single remote connection to an Arduino. It is responsible for check
if the connection is still alive, and sending heartbeat messages to keep the connection
alive too. This class abstracts the connectivity part away from the business logic.
The remote connection is then handled by the RemoteConnector. Normally, one creates a
whole remote stack using one the builders, such as Rs232ControllerBuilder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(RemoteControllerListener listener)register for events when the tree becomes fully populated, a menu item changes or there's a change in connectivity.get the underlying connectivity, rarely neededbooleanCheck if all the menu items from the remote device are available locally yet.sendAbsoluteUpdate(MenuItem item, Object newValue)Send an asbolute change for the given itemprotected voidsendCommand(MenuCommand command)Use to send commands directly.sendDeltaUpdate(MenuItem item, int deltaChange)Send a delta change for the given menuitemsendDialogAction(MenuButtonType buttonType)Send a dialog updatevoidstart()starts the remote connection such that it will attempt to establish connectivityvoidstop()attempt to stop the underlying connector
-
Constructor Details
-
Method Details
-
start
public void start()starts the remote connection such that it will attempt to establish connectivity -
stop
public void stop()attempt to stop the underlying connector -
getConnector
get the underlying connectivity, rarely needed- Returns:
- underlying connector
-
isTreeFullyPopulated
public boolean isTreeFullyPopulated()Check if all the menu items from the remote device are available locally yet.- Returns:
- true if the populated, otherwise false.
-
getManagedMenu
-