|
ESP_IOT v2.5
IOT ESP Coding
|

Go to the source code of this file.
Macros | |
| #define | MenusModel_Help 0 |
| a pseudo Class More... | |
| #define | MenusModel_Settings 1 |
| #define | MenusModel_Pairing 2 |
| #define | MenusModel_APMode 3 |
| #define | MenusModel_Timer 4 |
| #define | MenusModel_Status 5 |
| #define | MenusModel_Advanced 6 |
| #define | MenusModel_WIFIShare 7 |
| #define | MenusModel_GuestFeed 8 |
| #define | MenusModel_GuestPage 9 |
| #define | MenusModel_DocFollow 10 |
| #define | MenusModel_Max 11 |
Functions | |
| ModelStateStruct * | getModel (ModelKindEnum modelKind) |
| retrieves the state model for the modelKind More... | |
| void | initMenuToSMMode () |
| init the mapping More... | |
| void | initModelStructs_ModelController () |
| initialize the objects More... | |
| void | setTimerDelaySeconds_mainModule (int delaySeconds) |
| void | setTimerDelaySecondsMax_mainModule (int delaySeconds) |
| void | setNextRandomTime () |
| void | startStopTimer_mainModule (boolean startTimer) |
| void | printDeviceState (ModelStateStruct *deviceState) |
| print it out.. More... | |
| ModelStateStruct * | hasModelForSM_Mode (int SM_Mode) |
| retrieves the state model for the SM_Mode (SM_0 .. SM_LAST) null if none More... | |
| void | incrementMenuState (ModelKindEnum modelKind) |
| increments the device states deviceState (wrapping around) More... | |
| void | restartAllMenuStates_ModelController () |
| restarts all the menu states to the first one .. useful for getting a clean start. This doesn't care if the menu is being shown More... | |
| void | invokeFeedLocally () |
| storage.. More... | |
| void | invokeFeed_ModelController () |
| performs the BLE feed More... | |
| void | invokeUnpairNoNameBASE_ModelController () |
| void | invokeUnpairNoName_ModelController () |
| void | invokeUnpair_ModelController (char *nameOrAddress) |
| performs the unpairing More... | |
| void | invokePair_ModelController () |
| void | invokeSkip_ModelController (char *nameOrAddress) |
| performs skip More... | |
| void | invokeToggleGen3_ModelController () |
| toggles the GEN3 setting More... | |
| void | updateMenuState (ModelKindEnum modelKind) |
| updates the model for the menu state, this sets max etc More... | |
| char * | menuForState (ModelKindEnum modelKind, int item) |
| returns the menu string for the deviceState's item number (use woudl go 0..maxItems -1 More... | |
| boolean | invokeMenuState (ModelKindEnum modelKind) |
| invokes the menu state, return true if the model state has change enough to refreesh your View (such as new menu items) More... | |
| char * | getModelSemanticMarker (ModelKindEnum modelKind) |
| retrieves a semantic marker for the current selected item More... | |
Variables | |
| int | _menuToSMMode [MenusModel_Max] |
| storage of mapping More... | |
| ModelStateStruct | _modelStateStructs [ModelKindEnumMax] |
| char | _timerBuffer [10] |
| #define MenusModel_Advanced 6 |
Definition at line 13 of file ModelController.cpp.
| #define MenusModel_APMode 3 |
Definition at line 10 of file ModelController.cpp.
| #define MenusModel_DocFollow 10 |
Definition at line 17 of file ModelController.cpp.
| #define MenusModel_GuestFeed 8 |
Definition at line 15 of file ModelController.cpp.
| #define MenusModel_GuestPage 9 |
Definition at line 16 of file ModelController.cpp.
| #define MenusModel_Help 0 |
a pseudo Class
Definition at line 7 of file ModelController.cpp.
| #define MenusModel_Max 11 |
Definition at line 18 of file ModelController.cpp.
| #define MenusModel_Pairing 2 |
Definition at line 9 of file ModelController.cpp.
| #define MenusModel_Settings 1 |
Definition at line 8 of file ModelController.cpp.
| #define MenusModel_Status 5 |
Definition at line 12 of file ModelController.cpp.
| #define MenusModel_Timer 4 |
Definition at line 11 of file ModelController.cpp.
| #define MenusModel_WIFIShare 7 |
Definition at line 14 of file ModelController.cpp.
| ModelStateStruct * getModel | ( | ModelKindEnum | modelKind | ) |
retrieves the state model for the modelKind
Definition at line 273 of file ModelController.cpp.


| char * getModelSemanticMarker | ( | ModelKindEnum | modelKind | ) |
retrieves a semantic marker for the current selected item
retrieves a semantic marker for the current selected item. Return null if none specified YET TODO.. right now the logis is in MQTTNetworking .. so need to figure something nice out..
default is the view is the same
what model struct to use
Definition at line 1269 of file ModelController.cpp.

| ModelStateStruct * hasModelForSM_Mode | ( | int | SM_Mode | ) |
retrieves the state model for the SM_Mode (SM_0 .. SM_LAST) null if none
retrieves the state model for the SM_Mode (SM_0 .. SM_LAST)l. NULL if none
Definition at line 283 of file ModelController.cpp.

| void incrementMenuState | ( | ModelKindEnum | modelKind | ) |
increments the device states deviceState (wrapping around)
Definition at line 301 of file ModelController.cpp.

| void initMenuToSMMode | ( | ) |
init the mapping
Definition at line 27 of file ModelController.cpp.

| void initModelStructs_ModelController | ( | ) |
initialize the objects
for the next page state 0..n
initialize the random:
true if still waiting for delay to finish
length of delay get from in EPROM
feed local instead of MQTT or BLE..
Definition at line 79 of file ModelController.cpp.


| void invokeFeed_ModelController | ( | ) |
performs the BLE feed
feed always (done after the code below..)
8.16.25 MQTT unfortunately, the incrementFeedCount() is AFTER the redrawSemanticMarker.. This sets the semantic marker .. which is current SM
Definition at line 337 of file ModelController.cpp.


| void invokeFeedLocally | ( | ) |
storage..
send the command to the stepper.. not a BLE command
Definition at line 331 of file ModelController.cpp.


| boolean invokeMenuState | ( | ModelKindEnum | modelKind | ) |
invokes the menu state, return true if the model state has change enough to refreesh your View (such as new menu items)
invokes the menu state, return true if the model state has change enough to refreesh your View (such as new menu items) NOTE: This is the LONG press on the M5 button (the BLUE item)
default is the view is the same
what model struct to use
the pairdDeviceModel kind
factory default but not connecte to anything..
8.16.25 BLE CLIENT
8.16.25 BLE CLIENT
for now, the color is incremented in the displayModule
8.16.25 MQTT
BUT at the MQTT level not web page level
9.30.22 IF SET .. send a feed but to all devices except ours and our pair (if any) uses new wildcard syntax either ! OUR NAME [ & ! OUR_CONNECTED_NAME
8.16.25 MQTT
BUT at the MQTT level not web page level
9.30.22 IF SET .. send a feed but to all devices except ours and our pair (if any) uses new wildcard syntax either ! OUR NAME [ & ! OUR_CONNECTED_NAME
this has the # so it is treated slightly different, but tacking on the device for example..
8.16.25 MQTT
BUT at the MQTT level not web page level
9.30.22 IF SET .. send a feed but to all devices except ours and our pair (if any) uses new wildcard syntax either ! OUR NAME [ & ! OUR_CONNECTED_NAME
This just goes to the 0'th page in the stream..
1 based (not 0 based)
this has the # so it is treated slightly different, but tacking on the device for example..
set transient look for PTClicker
11.4.22 (after Maggie Bluetic was fed with Pumpking Uno and GreyGoose
use lookup
Issue: #222 for #206, this sets the current mode to SM_doc_follow, but when at that page in the the current mode (which is now SM_doc_follow) won't let the page go somewhere else (except in this case we are the same page). Only but a physical button click. I THINK THE ANSWER: if current and next are the same an SM_doc_follow, then do the page change..
if HELP then printout preferences to the debug window
if HELP .. show the status print the preferences to SerialDebug
This will restart the timer..
same login for each
make sure the max is >= min
11.29.23 add the random feed
now use those values to create a new random time.. not needed until the START above
Delay .. no-opp
Definition at line 940 of file ModelController.cpp.

| void invokePair_ModelController | ( | ) |
performs the pairing.. to whatever is currently connected, this means a message could make that happen for a device (ESP-32) with no user interface.
this is where it needs to know if GEN3. If so, then if their is a paired name .. If GEN3, don't overreight the device name in case it was set by the user..
always set the ADDRESS
This means the name
Definition at line 391 of file ModelController.cpp.


| void invokeSkip_ModelController | ( | char * | nameOrAddress | ) |
performs skip
8.16.25 BLE CLIENT
Definition at line 416 of file ModelController.cpp.


| void invokeToggleGen3_ModelController | ( | ) |
toggles the GEN3 setting
change GEN3 preference
if connected and not a GEN3 but want only GEN3 .. then disconnect, otherwise keep connected
also unpair..
Definition at line 427 of file ModelController.cpp.


| void invokeUnpair_ModelController | ( | char * | nameOrAddress | ) |
performs the unpairing
refactored base
8.16.25 BLE CLIENT
Definition at line 379 of file ModelController.cpp.


| void invokeUnpairNoName_ModelController | ( | ) |
just unpair .. don't skip performs the unpairing
refactored base
8.16.25 BLE CLIENT
Definition at line 369 of file ModelController.cpp.


| void invokeUnpairNoNameBASE_ModelController | ( | ) |
just unpair .. don't skip performs the unpairing
also unset the main storage..
Definition at line 355 of file ModelController.cpp.


| char * menuForState | ( | ModelKindEnum | modelKind, |
| int | item | ||
| ) |
returns the menu string for the deviceState's item number (use woudl go 0..maxItems -1
MENUS Pairing APMode Timer Advanced Status WIFI sharing Guest Feed Settings DocFollow help HomePage /WIFI Feed WIFI Share
Max == 4 if not running (START, TIME, MAXTIME, DELAY)
draw the state we are in..
update menu with seconds countdown
only if stopped... max == 4, other max == 2
show max
Definition at line 665 of file ModelController.cpp.

| void printDeviceState | ( | ModelStateStruct * | deviceState | ) |
print it out..
Definition at line 205 of file ModelController.cpp.

| void restartAllMenuStates_ModelController | ( | ) |
restarts all the menu states to the first one .. useful for getting a clean start. This doesn't care if the menu is being shown
Definition at line 316 of file ModelController.cpp.


| void setNextRandomTime | ( | ) |
set the next random time .. since called from a couple places will set the model->delayStartMillis == currentCounterSeconds
the value returned from random .. the diff is taken off this number but this number doesn't change except next random call
Definition at line 173 of file ModelController.cpp.


| void setTimerDelaySeconds_mainModule | ( | int | delaySeconds | ) |
! TIMER Remote control set delay seconds MQTT: set: timerdelay, val:seconds
save in EPROM
Definition at line 145 of file ModelController.cpp.


| void setTimerDelaySecondsMax_mainModule | ( | int | delaySeconds | ) |
! TIMER Remote control set delay seconds MQTT: set: timerdelay,Max val:seconds
save in EPROM
Definition at line 159 of file ModelController.cpp.


| void startStopTimer_mainModule | ( | boolean | startTimer | ) |
! TIMER Remote control start MQTT: set: starttimer, val: true/false (true == start timer, false = stop timer)
Definition at line 191 of file ModelController.cpp.


| void updateMenuState | ( | ModelKindEnum | modelKind | ) |
updates the model for the menu state, this sets max etc
updates the model for the menu state (this will initialize if not done yet..)
must save since many preferences are called...
the pairedName stored in EPROM can be an Address (eg. 03:34:23:33)
show the BLE connected status at the bottom (G3 if gen3), WIFI, and AP if APmode 8.16.25 BLE CLIENT
whether the gateway is on.. this isn't using the Gx just BLE or GE3
name of paired device (if any) in EPROM
name of connected device, or "" if not specified, which means not pairable
compare to what's connected ..
is paired and connected (to that pair .. if BLECLient working right)
if connectedBLE then either paired or not-paired
if the EPROM's pairedDevice/Address == what's connected, then we are paired and connected
is paired
not connected, so paired if a valid paired name/address
if the EPROM's pairedDevice/Address is set then paired and NOT connected
unpaired
MENUS Pairing APMode Timer Advanced Status WIFI sharing Guest Feed Settings DocFollow help HomePage /WIFI Feed WIFI Share
calculate the current second counter..
the number of seconds since starting the loop
if count <=0 then finished..
11.29.23 use a random calculate a new random
if local .. send a command directly to the device..
send the command to the stepper.. not a BLE command
for now only invoke the feed ... todo mroe things.. STATUS, WIFI FEED, DOCFOLLOW
added a max delay
TODO: look at a scrolling idea if > 6 ...
Definition at line 443 of file ModelController.cpp.


| int _menuToSMMode[MenusModel_Max] |
storage of mapping
Definition at line 25 of file ModelController.cpp.
| ModelStateStruct _modelStateStructs[ModelKindEnumMax] |
create state variables for the ModelKindEnum entries
Definition at line 75 of file ModelController.cpp.
| char _timerBuffer[10] |
Definition at line 76 of file ModelController.cpp.