tcMenuJavaAPI
Classes | Public Member Functions | List of all members
com.thecoderscorner.menu.mgr.MenuInMenu Class Reference

Classes

enum  ReplicationMode
 

Public Member Functions

 MenuInMenu (RemoteConnector remoteConnector, MenuManagerServer manager, MenuItem root, ReplicationMode mode, int offsetRange, int maxRange)
 
void start ()
 
AuthStatus getCurrentStatus ()
 

Detailed Description

MenuInMenu embeds a menu within another menu by shifting the range of IDs within the remote items into another range. For example if we say all items in this menu start at 100,000 then every item that comes in will have 100,000 added to their ID, so they can be stored in the same tree.

Let's say you have several IoT devices located in various locations around your building, and you want to present all these devices together in a single embedCONTROL instance, or manage them together with the API, for each device you create an instance of MenuInMenu that has a connector for the given device. You'd give each instance a different ID range, EG local device items may go from 0..100000, then device 1 offset could be 100000 for example and so on.


Class Documentation

◆ com::thecoderscorner::menu::mgr::MenuInMenu::ReplicationMode

enum com::thecoderscorner::menu::mgr::MenuInMenu::ReplicationMode
Enumerator
REPLICATE_ADD_STATUS_ITEM
REPLICATE_NOTIFY
REPLICATE_SILENTLY

Constructor & Destructor Documentation

◆ MenuInMenu()

com.thecoderscorner.menu.mgr.MenuInMenu.MenuInMenu ( RemoteConnector  remoteConnector,
MenuManagerServer  manager,
MenuItem  root,
ReplicationMode  mode,
int  offsetRange,
int  maxRange 
)

Creates a MenuInMenu instance that tracks changes in a remote menu and replicates it locally in real time.

Parameters
remoteConnectorthe connection to the remote device.
managerthe manager object that will store the menu structures
rootthe "root" submenu for the remote items
modehow the items should be integrated into the tree
offsetRangethe starting ID for these items
maxRangethe maximum ID for these items (status menu item will use the last possible value)

Member Function Documentation

◆ getCurrentStatus()

AuthStatus com.thecoderscorner.menu.mgr.MenuInMenu.getCurrentStatus ( )

Check the current status of the underlying connection

Returns
the auth status of the connection

◆ start()

void com.thecoderscorner.menu.mgr.MenuInMenu.start ( )

Starts the remote and registers listeners


The documentation for this class was generated from the following file: