Classes | |
enum | ReplicationMode |
Public Member Functions | |
MenuInMenu (RemoteConnector remoteConnector, MenuManagerServer manager, MenuItem root, ReplicationMode mode, int offsetRange, int maxRange) | |
void | start () |
AuthStatus | getCurrentStatus () |
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.
enum com::thecoderscorner::menu::mgr::MenuInMenu::ReplicationMode |
Enumerator | REPLICATE_ADD_STATUS_ITEM | REPLICATE_NOTIFY | REPLICATE_SILENTLY |
---|
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.
remoteConnector | the connection to the remote device. |
manager | the manager object that will store the menu structures |
root | the "root" submenu for the remote items |
mode | how the items should be integrated into the tree |
offsetRange | the starting ID for these items |
maxRange | the maximum ID for these items (status menu item will use the last possible value) |
AuthStatus com.thecoderscorner.menu.mgr.MenuInMenu.getCurrentStatus | ( | ) |
Check the current status of the underlying connection
void com.thecoderscorner.menu.mgr.MenuInMenu.start | ( | ) |
Starts the remote and registers listeners