ESP_IOT v2.5
IOT ESP Coding
MainModule.cpp File Reference
Include dependency graph for MainModule.cpp:

Go to the source code of this file.

Macros

#define USE_NEW_M5ATOMCLASS
 MainModule More...
 
#define NUM_M5ATOM_CLASS   7
 
#define USE_SENSOR_CLASS
 
#define NUM_SENSOR_CLASS_TYPES   4
 5.14.25 More...
 
#define SERIAL_LOTS_
 
#define MESSAGE_STORAGE_MAX   500
 global for others to use.. More...
 
#define TEMP_FIX_LOOP_NO
 
#define NEW_SENSORS
 
#define TRY_DUPLICATES_works
 
#define CALLBACKS_MQTT   0
 8.16.25 MQTT More...
 
#define CALLBACKS_BUTTON_MODULE   1
 
#define CALLBACKS_BLE_CLIENT   2
 
#define CALLBACKS_BLE_SERVER   3
 
#define CALLBACKS_MAX_MQTT   MQTT_MAX_CALLBACKS
 
#define CALLBACKS_MAX_BUTTON_MODULE   MAX_CALLBACKS_BM
 
#define CALLBACKS_MAX_BLE_CLIENT   BLE_CLIENT_MAX_CALLBACKS
 
#define CALLBACKS_MAX_BLE_SERVER   BLE_SERVER_MAX_CALLBACKS
 
#define TRY_ASYNC_BLE_PROCESSING
 
#define GROUP_TOPIC_TO_SEND   (char*)"usersP/groups"
 

Typedefs

typedef void(* callbackSignature) (char *)
 

Functions

void loopSensorClassTypeArray ()
 11.27.25 Turkey Day, loop More...
 
void messageSetVal_SensorClassTypeArray (char *setName, char *valValue, boolean deviceNameSpecified)
 
void initSensorClassTypeArray ()
 
void stopMotor_mainModule ()
 added 9.29.22 to support wildcards #196 More...
 
boolean isPTFeeder_mainModule ()
 gets if PTFeeder a surrogate for the M5Atom class More...
 
char * getServerServiceName_mainModule ()
 
void readPreferences_mainModule ()
 reads the preferences. Save is everytime the savePreference is called More...
 
void stopProcessesForOTAUpdate_mainModule ()
 stop all loops... while OTA working.. More...
 
void restartProcessesForOTAUpdate_mainModule ()
 restart all loops... while OTA working.. More...
 
boolean stopAllProcesses_mainModule ()
 if stopped More...
 
void initGlobals_mainModule ()
 init globals strings More...
 
void setup_mainModule ()
 called from the setup() More...
 
void loop_mainModule ()
 called for the loop() of this plugin More...
 
int feedCountMax_mainModule ()
 returns the max for this feeder More...
 
int getFeedCount_mainModule ()
 feedcount info.. More...
 
int getFeederType_mainModule ()
 get the feeder type (Sepper 1,2,3 ...) More...
 
void incrementFeedCount_mainModule ()
 increments .. and if MAX goes to 0 – and sends a message on MQTT More...
 
void resetFeedCount_mainModule ()
 sets the feed count max More...
 
bool containsSubstring (String message, String substring)
 check if the string contains the other string. This is a poor man's grammer checker More...
 
void registerCallbackMain (int callbacksModuleId, int callbackType, void(*callback)(char *))
 register the callback based on the callbackType. use the callbacksModuleId for which one.. More...
 
void callCallbackMain (int callbacksModuleId, int callbackType, char *message)
 performs the indirect callback based on the callbackType More...
 
void dummyCallbackMain (char *message)
 example callback More...
 
callbackSignaturecreateMemory (int max)
 return dyamically created array of max More...
 
void initCallbacksMain ()
 init the callbacks to dummy callbacks More...
 
boolean isTrueString_mainModule (String valCmdString)
 whether the string is TRUE, ON, 1 More...
 
void messageSetVal_mainModule (char *setName, char *valValue, boolean deviceNameSpecified)
 
void messageSend_mainModule (char *sendValue, boolean deviceNameSpecified)
 TODO: have a callback regist approach. More...
 
void feedMessageCallback (char *message)
 
void main_credentialsUpdated ()
 moved here 4.25.22 (entirely from ESP_IOT.ino) More...
 
void onBLEServerCallback (char *message)
 The callback for "onWrite" of the bluetooth "onWrite'. More...
 
void onStatusMessageBLEServerCallback (char *message)
 The callback for "status messages" of the bluetooth. More...
 
void onWriteBLEServerCallbackFinish (char *message)
 The FINISH of callback for "onWrite" of the bluetooth "onWrite'. More...
 
void onWriteBLEServerCallback (char *message)
 The callback for "onWrite" of the bluetooth "onWrite'. More...
 
void refreshDelayButtonTouched_MainModule ()
 called by the feed operation to say the device is still running.. and count it as a button click. More...
 
boolean asyncCallOTAUpdate ()
 performs an async OTA update More...
 
void setAsyncCallOTAUpdate (bool flag)
 sets the async OTA flag (for next loop) More...
 
char * getPairedDevice_mainModule ()
 returns if the paired device is not NONE More...
 
char * getPairedDeviceAddress_mainModule ()
 returns if the paired device is not NONE More...
 
boolean isValidPairedDevice_mainModule ()
 returns if the paired device is not NONE. Note, the paired Name might be an address now (see below) More...
 
char * getPairedDeviceOrAddress_mainModule ()
 returns if the paired device is not NONE .. returns address or device More...
 
char * deviceName_mainModule ()
 gets the device name More...
 
void rebootDevice_mainModule ()
 
void poweroff_mainModule ()
 power off More...
 
void cleanEpromPreferences ()
 cleans the EPROM More...
 
char * main_JSONStringForWIFICredentials ()
 retrieve a JSON string for the ssid and ssid_password: {'ssid':<ssid>,'ssidPassword':<pass>"} More...
 
char * main_nextJSONWIFICredential ()
 ! cycle through the next WIFI saved credential More...
 
void main_saveWIFICredentials (char *ssid, char *ssid_password)
 save the WIFI credential More...
 
void main_cleanSavedWIFICredentials ()
 clean the saved WIFI credential, otherwise the AP mode doesn't work (6.3.22) More...
 
char * main_getUsername ()
 
char * main_getPassword ()
 return password More...
 
char * main_getScannedDeviceName ()
 return devicename More...
 
void main_setScannedDeviceName (char *deviceName)
 set the scanned device name More...
 
void main_setScannedGroupName (char *groupName)
 
char * main_getScannedGroupNameTopic ()
 
void main_updateMQTTInfo (char *ssid, char *ssid_password, char *username, char *password, char *guestPassword, char *deviceName, char *host, char *port, char *locationString)
 sets the WIFI and MQTT user/password. It's up to the code (below, maybe in future a register approach) to decide who needs to know More...
 
void main_dispatchSyncCommand (int syncCallCommand)
 the main sync command (no parameters yet) More...
 
void initAsyncCallFlags ()
 initialize the async call flags (with and without parameters) More...
 
void main_dispatchAsyncCommand (int asyncCallCommand)
 checks if any async commands are in 'dispatch' mode, and if so, invokes them, and sets their flag to false More...
 
void main_dispatchAsyncCommandWithString (int asyncCallCommand, char *parameter)
 
void invokeAsyncCommands ()
 checks if any async commands are in 'dispatch' mode, and if so, invokes them, and sets their flag to false More...
 
void changeButtonColor_MainModule ()
 2.21.25 add a way to change the button color (if any) More...
 
uint32_t getChipId ()
 3.17.24 get the chip id More...
 
char * getChipIdString ()
 3.17.24 get the chip id as a string More...
 
void setLUXThreshold_mainModule (int thresholdKind, int luxVal)
 set the threshold val More...
 
int getLUXThreshold_mainModule (int thresholdKind)
 get the threshold val More...
 
char * groupTopicFullName (char *groupName)
 returns a groupTopic to use as a topic More...
 
void blinkMessageCallback (char *message)
 callback for blinking led More...
 
void solidLightMessageCallback (char *message)
 callback for SOLID blinking led More...
 
void cleanSSID_EPROM_MessageCallback (char *message)
 clean the SSID eprom (MQTT_CLEAN_SSID_EPROM) More...
 
void singleClickTouched (char *whichButton)
 
void showText_mainModule (String text)
 
void solidLightOnOff (boolean onOff)
 callback for SOLID blinking led More...
 
void main_printModuleConfiguration ()
 
char * createCopy (char *stringA)
 
char * createCopy2 (const char *stringA)
 
boolean isEmptyString (char *stringA)
 informs if null or empty string More...
 
boolean startsWithChar (char *str, char c)
 a char* version of startsWith (after skipping spaces) More...
 
float getBatPercentage_mainModule ()
 start of the sensor updates ... TODO: tie these to the MQTT messaging as well.. More...
 
void sendMessageString_mainModule (char *messageString)
 adding a synchronous call to send a message over the network (assuming MQTT but not specified), this tacks on {device} and {t:time} More...
 
void sendMessageStringTopic_mainModule (char *messageString, char *topicString)
 adding a synchronous call to send a message over the network (assuming MQTT but not specified), this tacks on {device} and {t:time} More...
 
float getTemperature_mainModule ()
 retrieves the temperature . More...
 

Variables

boolean _shortPress_MainModule = false
 5.6.25 use the M5Atom ClassType More...
 
boolean _longPress_MainModule = false
 
boolean _longLongPress_MainModule = false
 
M5Atom_SocketModuleClass_M5Atom_SocketModuleClass
 instances of the M5AtomClassType More...
 
M5Atom_QRCodeModuleClass_M5Atom_QRCodeModuleClass
 
M5Atom_HDriverModuleClass_M5Atom_HDriverModuleClass
 
M5Atom_Core2ModuleClass_M5Atom_Core2ModuleClass
 
M5Atom_TinyGPSModuleClass_M5Atom_TinyGPSModuleClass
 
M5Atom_CameraModuleClass_M5Atom_CameraModuleClass
 
M5Atom_NoModuleClass_M5Atom_NoModuleClass
 
M5AtomClassType_M5AtomClassTypes [NUM_M5ATOM_CLASS]
 3.31.25 create array of plugs More...
 
M5AtomClassType_whichM5AtomClassType
 use this one... More...
 
BuzzerSensorClass_BuzzerSensorClass
 
KeyUnitSensorClass_KeyUnitSensorClass
 
PIRSensorClass_PIRSensorClass
 
ChainButtonClass_ChainButtonClass
 
SensorClassType_SensorClassTypes [NUM_SENSOR_CLASS_TYPES]
 
boolean _stopAllProcessing = false
 testing.. More...
 
char _asyncParameter [500]
 the parameter being sent to those commands passing an argument More...
 
char _JSONStringForWIFICredentials [200]
 global to store credentials when ever they are stored.. More...
 
char _messageStorage [MESSAGE_STORAGE_MAX]
 
char _fullStatusString [500]
 status string (URL query format) More...
 
char _smMode_MainModule [10]
 current smMode More...
 
char _deviceNameSave [50]
 saved deviceName storage.. More...
 
boolean _waitingForBigMessageEnd = false
 store a big message #MSG_START .. #MSG_END More...
 
char _bigMessage [500]
 
char _connectedBLEDeviceName [50]
 saved BLE connected name 8.26.22 More...
 
char _fullBLEDeviceName [100]
 full: ""Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead" More...
 
char _connectedBLEDeviceAddress [50]
 full: ""Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead" More...
 
char _serialBuffer [300]
 
int _feedCount_mainModule = 0
 5.3.22 added a feed count approach.. (NOTE: there is a _feedCount in Dispence.cpp ... and no linker error!!! ) More...
 
int _callbacksFunctionsMAXS [CALLBACKS_MODULE_MAX]
 the array of callback functions More...
 
boolean _callbacksInitializedMain = false
 flag for initializing if not yes More...
 
callbackSignature_allCallbacks [CALLBACKS_MODULE_MAX]
 array of known size (CALLBACKS_MODULE_MAX) of callbackSignatures More...
 
boolean _asyncCallOTAUpdateFlag = false
 3.28.22 .. implemented in ESP_IOT.ino More...
 
char * _MQTT_Password = (char*)""
 12.14.23 More...
 
char * _MQTT_Username = (char*)""
 
char _scannedDeviceName [100]
 
char _scannedGroupTopicName [100]
 
boolean _asyncCallFlags [ASYNC_CALL_MAX]
 storage for asyncCallCommands More...
 
boolean _asyncCallFlagsParameters [ASYNC_CALL_PARAMETERS_MAX]
 array of async flags for the different ASYNC_CALl values More...
 
uint32_t _chipID_MainModule = 0
 3.17.24 the unqiue chip id More...
 
char _chipIdString_MainModule [15]
 string like: 10311304 More...
 
int _thresholdLUXDark = 80
 
int _thresholdLUXLight = 0
 
char _groupTopicName [100]
 
char * _ON_LIGHT = (char*)"ON"
 
char * _OFF_LIGHT = (char*)"OFF"
 

/password/status?BLE:on&numfeeds=8&WIFI:on&AP:off

NEW: 4.30.22 returns a string in JSON format, such that {'battery':'84'}, {'buzzon':'off'} .. etc as a URL: SemanticMarker.org/bot/sample/scott

char * _lastSemanticMarkerDocFollow = NULL
 
int _saveWhichSMMode = 0
 the saved SMMode More...
 
boolean _connecteBLEisGEN3 = false
 whether connected GEN3 More...
 
PinUseStruct _pinUseStruct
 7.31.25 add this for a status, saw that QRCode was using 22 also .. so buzer didn't work. More...
 
void checkButtonA_MainModule ()
 big button on front of M5StickC Plus More...
 
void checkButtonB_MainModule ()
 big button on front of M5StickC Plus More...
 
char * main_currentStatusJSON ()
 status in JSON format, needs to return something as a ',' is already added before calling this.. More...
 
void addStatusStringFlag (const char *key, char *val)
 adds a query string "&key=value" More...
 
void addStatusBooleanFlag (const char *key, boolean flag)
 adds to _fullStatusString a query string "&key=value" More...
 
void addMoreStatusQueryString ()
 
char * main_currentStatusURL (boolean fullStatus)
 
void setSemanticMarkerDocFollow_mainModule (char *SMDocFollowAddress)
 sed the address to follow More...
 
char * getSemanticMarkerDocFollow_mainModule ()
 gets the semanticAddress SemanticMarker™ More...
 
void sendSemanticMarkerDocFollow_mainModule (const char *SMDocFollowAddress)
 sends the SM on the DOCFOLLOW channel (publish it..) More...
 
void setClockwiseMotorDirection_mainModule (boolean isClockwiseFlag)
 8.18.24 setting this will check for the factory setting.. More...
 
void processClientCommandChar_mainModule (char cmd)
 single character version of processClientCommand (since many used that already) More...
 
void setConfiguration_mainModule (char *configurationName)
 
int getTimeStamp_mainModule ()
 
int whichSMMode_mainModule (char *cmd)
 ************** SM Mode Processing *************** More...
 
boolean matchesSMMode_mainModule (char *cmd, int whichSMMode)
 returns if a match the mode. whichSMMode is 0..12 and == sm0 .. smn More...
 
char * charSMMode_mainModule (int whichSMMode)
 returns string form whichSMMode, sg "sm0", sm1 ... More...
 
boolean isMinimalMenuMode_mainModule ()
 returns which mode in (min or expanded) More...
 
void toggleMinimalMenuMode_mainModule ()
 toggles the menu mode More...
 
int minMenuModesMax_mainModule ()
 returns the current max of the MIN menu modes (using the setting of min or expanded) to determine More...
 
int maxMenuModes_mainModule ()
 returns the current max of the menu modes (using the setting of min or expanded) to determine More...
 
void setCurrentSMMode_mainModule (int whichSMMode)
 sets the current screen mode .. which can be used by Button and Display processing More...
 
int getCurrentSMMode_mainModule ()
 returns the current SM Mode More...
 
void incrementSMMode_mainModule ()
 increment the currentSMMode, wrapping and using the max menu More...
 
void decrementSMMode_mainModule ()
 increment the currentSMMode, wrapping and using the max menu More...
 
char * getFullBLEDeviceName_mainModule ()
 full: ""Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead" More...
 
boolean connectedBLEDeviceIsGEN3_mainModule ()
 whether the connected is a GEN3 (so the name isn't valid) More...
 
void setConnectedBLEDevice_mainModule (char *deviceName, boolean isGEN3)
 
char * connectedBLEDeviceName_mainModule ()
 returns the connected BLE Device name (the :NAME of advertisment, Address: 01:39:3f:33 part of name, or "" if nothing (not null) More...
 
char * connectedBLEDeviceNameAddress_mainModule ()
 returns address part of name. More...
 
M5AtomClassTypewhichM5AtomClassType ()
 6.6.25 get the current M5AtomClassType More...
 
void loop_Sensors_mainModule ()
 1.22.24 add setup and loop at main so it can call appropriate plugs More...
 
void setup_Sensors_mainModule ()
 1.22.24 setup of buttons More...
 
void buttonA_ShortPress_mainModule ()
 
void buttonA_LongPress_mainModule ()
 long press on buttonA (top button) More...
 
void buttonA_LongLongPress_mainModule ()
 long long press on buttonA (top button) More...
 
void buttonB_LongPress_mainModule ()
 the long press of the side button More...
 
void buttonB_ShortPress_mainModule ()
 the short press of the side button More...
 
void restartAllMenuStates_mainModule ()
 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 sendStatusMQTT_mainModule ()
 1.1.24 send status of this device after events.. More...
 
char * semanticMarkerToJSON_mainModule (char *semanticMarker)
 
PinUseStructgetPinUseStruct_mainModule ()
 get the pin use array More...
 
void registerPinUse_mainModule (long pin, String pinName, String moduleName, boolean isI2C)
 

Macro Definition Documentation

◆ CALLBACKS_BLE_CLIENT

#define CALLBACKS_BLE_CLIENT   2

Definition at line 710 of file MainModule.cpp.

◆ CALLBACKS_BLE_SERVER

#define CALLBACKS_BLE_SERVER   3

Definition at line 711 of file MainModule.cpp.

◆ CALLBACKS_BUTTON_MODULE

#define CALLBACKS_BUTTON_MODULE   1

Definition at line 709 of file MainModule.cpp.

◆ CALLBACKS_MAX_BLE_CLIENT

#define CALLBACKS_MAX_BLE_CLIENT   BLE_CLIENT_MAX_CALLBACKS

Definition at line 724 of file MainModule.cpp.

◆ CALLBACKS_MAX_BLE_SERVER

#define CALLBACKS_MAX_BLE_SERVER   BLE_SERVER_MAX_CALLBACKS

Definition at line 725 of file MainModule.cpp.

◆ CALLBACKS_MAX_BUTTON_MODULE

#define CALLBACKS_MAX_BUTTON_MODULE   MAX_CALLBACKS_BM

Definition at line 723 of file MainModule.cpp.

◆ CALLBACKS_MAX_MQTT

#define CALLBACKS_MAX_MQTT   MQTT_MAX_CALLBACKS

make sure these are the number of callbacks.. 0..n These values are from the respective .h of the modules

Definition at line 722 of file MainModule.cpp.

◆ CALLBACKS_MQTT

#define CALLBACKS_MQTT   0

8.16.25 MQTT

8.16.25 BLE SERVER 8.16.25 BLE CLIENT New RegisterCallback that works across a number of callback modules

callbacksModuleId

Definition at line 708 of file MainModule.cpp.

◆ GROUP_TOPIC_TO_SEND

#define GROUP_TOPIC_TO_SEND   (char*)"usersP/groups"

Definition at line 1886 of file MainModule.cpp.

◆ MESSAGE_STORAGE_MAX

#define MESSAGE_STORAGE_MAX   500

global for others to use..

Definition at line 411 of file MainModule.cpp.

◆ NEW_SENSORS

#define NEW_SENSORS

◆ NUM_M5ATOM_CLASS

#define NUM_M5ATOM_CLASS   7

make sure this is updated. 8.16.25 == 6 10.26.25 == 7

Definition at line 63 of file MainModule.cpp.

◆ NUM_SENSOR_CLASS_TYPES

#define NUM_SENSOR_CLASS_TYPES   4

5.14.25

11.27.25 add PIRSensor 12.19.25 48 hrs no power, high wind storm, flooding in lowlands - bad this will be the ChainButtonClass

Definition at line 87 of file MainModule.cpp.

◆ SERIAL_LOTS_

#define SERIAL_LOTS_

◆ TEMP_FIX_LOOP_NO

#define TEMP_FIX_LOOP_NO

◆ TRY_ASYNC_BLE_PROCESSING

#define TRY_ASYNC_BLE_PROCESSING

◆ TRY_DUPLICATES_works

#define TRY_DUPLICATES_works

◆ USE_NEW_M5ATOMCLASS

#define USE_NEW_M5ATOMCLASS

MainModule

Definition at line 5 of file MainModule.cpp.

◆ USE_SENSOR_CLASS

#define USE_SENSOR_CLASS

Definition at line 75 of file MainModule.cpp.

Typedef Documentation

◆ callbackSignature

typedef void(* callbackSignature) (char *)

Definition at line 749 of file MainModule.cpp.

Function Documentation

◆ addMoreStatusQueryString()

void addMoreStatusQueryString ( )

sets the "Module Status" in queryString == name=val&name=val ...

value of WIFI connected 8.16.25 MQTT

8.16.25 BLE CLIENT

connected == we are connected to another BLEServer

8.16.25 WIFI AP not done is what we look for ..

8.16.25 BLE SERVER

add a bleS=PTFeeder:name

show Z for buZZ

show G for gateway

8.10.25 #393 add stepper angle show SA for stepper angle float ..

P = paired

add the canister and stepper angle per #278

Definition at line 2363 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addStatusBooleanFlag()

void addStatusBooleanFlag ( const char *  key,
boolean  flag 
)

adds to _fullStatusString a query string "&key=value"

Definition at line 2356 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addStatusStringFlag()

void addStatusStringFlag ( const char *  key,
char *  val 
)

adds a query string "&key=value"

TODO: fix syntax. If just sensor sensor status: .... https://SemanticMarker.org/bot/sensor/scott@konacurrents.com/doggy/status?v=v2&dev=M5Ski&b=68&temp=66&c=0&t=8&W=on&M=on&B=on&C=on&A=off&T=on&S=on&Z=off&t=8 not working just added Z=on/off length = 157 going to remove the username/password to shorten..

Definition at line 2349 of file MainModule.cpp.

Here is the caller graph for this function:

◆ asyncCallOTAUpdate()

boolean asyncCallOTAUpdate ( )

performs an async OTA update

Definition at line 1078 of file MainModule.cpp.

◆ blinkMessageCallback()

void blinkMessageCallback ( char *  message)

callback for blinking led

12.19.25 Power back on, Snowing in mountains support the blink but using the plugin class 5.15.25 try the async CLICK click call 5.26.25 SYNC version

Definition at line 1899 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buttonA_LongLongPress_mainModule()

void buttonA_LongLongPress_mainModule ( )

long long press on buttonA (top button)

11.25.25 add long long long press on buttonA (top button)

5.6.25 use object version

Definition at line 3814 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buttonA_LongPress_mainModule()

void buttonA_LongPress_mainModule ( )

long press on buttonA (top button)

5.6.25 use object version

Definition at line 3790 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buttonA_ShortPress_mainModule()

void buttonA_ShortPress_mainModule ( )

BUTTON PROCESSING abstraction short press on buttonA (top button)

5.6.25 use object version

Definition at line 3767 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buttonB_LongPress_mainModule()

void buttonB_LongPress_mainModule ( )

the long press of the side button

Definition at line 3838 of file MainModule.cpp.

Here is the caller graph for this function:

◆ buttonB_ShortPress_mainModule()

void buttonB_ShortPress_mainModule ( )

the short press of the side button

Definition at line 3849 of file MainModule.cpp.

Here is the caller graph for this function:

◆ callCallbackMain()

void callCallbackMain ( int  callbacksModuleId,
int  callbackType,
char *  message 
)

performs the indirect callback based on the callbackType

Definition at line 819 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeButtonColor_MainModule()

void changeButtonColor_MainModule ( )

2.21.25 add a way to change the button color (if any)

Definition at line 1814 of file MainModule.cpp.

Here is the caller graph for this function:

◆ charSMMode_mainModule()

char * charSMMode_mainModule ( int  whichSMMode)

returns string form whichSMMode, sg "sm0", sm1 ...

returns string form whichSMMode, sg "sm0", sm1 ... This can (and is) called by multiple places (like ButtonProcessing and MainModule

Definition at line 3392 of file MainModule.cpp.

Here is the caller graph for this function:

◆ checkButtonA_MainModule()

void checkButtonA_MainModule ( )

big button on front of M5StickC Plus

NOTE: ths issue is the timer is interruped by the scanner.. so make long-long very long..

Definition at line 3863 of file MainModule.cpp.

Here is the caller graph for this function:

◆ checkButtonB_MainModule()

void checkButtonB_MainModule ( )

big button on front of M5StickC Plus

NOTE: ths issue is the timer is interruped by the scanner.. so make long-long very long..

Definition at line 3893 of file MainModule.cpp.

Here is the caller graph for this function:

◆ cleanEpromPreferences()

void cleanEpromPreferences ( )

cleans the EPROM

8.16.25 MQTT

8.16.25 WIFI AP

7.29.25 set the FIRST time ..

reboot

Definition at line 1175 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanSSID_EPROM_MessageCallback()

void cleanSSID_EPROM_MessageCallback ( char *  message)

clean the SSID eprom (MQTT_CLEAN_SSID_EPROM)

take a picture (calls the camera module).. what to do with picture??? TODO

call the already defined solid led defined in Dispense.cpp 8.16.25 WIFI AP clean_SSID_WIFICredentials(); now register an async call..

Definition at line 1938 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectedBLEDeviceIsGEN3_mainModule()

boolean connectedBLEDeviceIsGEN3_mainModule ( )

whether the connected is a GEN3 (so the name isn't valid)

whether the connected is a GEN3 (so the name isn't valid).

Definition at line 3487 of file MainModule.cpp.

Here is the caller graph for this function:

◆ connectedBLEDeviceName_mainModule()

char * connectedBLEDeviceName_mainModule ( )

returns the connected BLE Device name (the :NAME of advertisment, Address: 01:39:3f:33 part of name, or "" if nothing (not null)

ISSUE: if BLE, can only return the address.. it's up to the caller to know it might not match the Paired Name (eg DukeGEN3) returns the connected BLE Device name (the :NAME of advertisment, Address: 01:39:3f:33 part of name

8.16.25 BLE CLIENT

if connected, return the connected name, otherwise return empty string

Definition at line 3583 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectedBLEDeviceNameAddress_mainModule()

char * connectedBLEDeviceNameAddress_mainModule ( )

returns address part of name.

8.16.25 BLE CLIENT

if connected, return the connected name, otherwise return empty string

Definition at line 3607 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsSubstring()

bool containsSubstring ( String  message,
String  substring 
)

check if the string contains the other string. This is a poor man's grammer checker

check if the string contains the other string (if substring is "" then no match)

Definition at line 684 of file MainModule.cpp.

Here is the caller graph for this function:

◆ createCopy()

char * createCopy ( char *  stringA)

If nil it create one with just the null, so strlen = 0 NOTE: the strdup() might be used later..

Definition at line 2137 of file MainModule.cpp.

Here is the caller graph for this function:

◆ createCopy2()

char * createCopy2 ( const char *  stringA)

If nil it create one with just the null, so strlen = 0 NOTE: the strdup() might be used later..

Definition at line 2147 of file MainModule.cpp.

Here is the caller graph for this function:

◆ createMemory()

callbackSignature * createMemory ( int  max)

return dyamically created array of max

Definition at line 753 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrementSMMode_mainModule()

void decrementSMMode_mainModule ( )

increment the currentSMMode, wrapping and using the max menu

Definition at line 3464 of file MainModule.cpp.

◆ deviceName_mainModule()

char * deviceName_mainModule ( )

gets the device name

Definition at line 1139 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dummyCallbackMain()

void dummyCallbackMain ( char *  message)

example callback

Definition at line 729 of file MainModule.cpp.

Here is the caller graph for this function:

◆ feedCountMax_mainModule()

int feedCountMax_mainModule ( )

returns the max for this feeder

Definition at line 625 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ feedMessageCallback()

void feedMessageCallback ( char *  message)

8.16.25 MQTT example callback: but the scope would have the pCharacteristic defined, etc.. This is passed just before the setupMQTTNetworking() is called..

sends this single character to the StepperModule

increment the feed count .. TODO .. see if this is good place..

the FEED was send over MQTT, now what to do? WIth the StepperModule – it just performs the feeding internalls if using the BLE_CLIENT then we have the potential to send to over BLE to the server (another feeder, GEN3 or ESP32). The issue is that ESP32 feeders are receiving the same MQTT message (usually unless MQTT turned off So the gatewayMode can be set (or in the EPROM) using {'cmd':'gatewayOn'}

8.16.25 BLE CLIENT

send the feed over the BLE client (if connected)

11.26.25 try the STATUS on every feed

Definition at line 894 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBatPercentage_mainModule()

float getBatPercentage_mainModule ( )

start of the sensor updates ... TODO: tie these to the MQTT messaging as well..

the M5.Axp.GetBatVoltage() is VERY slow on the M5 (as there isn't one..)

Definition at line 2191 of file MainModule.cpp.

Here is the caller graph for this function:

◆ getChipId()

uint32_t getChipId ( )

3.17.24 get the chip id

Definition at line 1828 of file MainModule.cpp.

Here is the caller graph for this function:

◆ getChipIdString()

char * getChipIdString ( )

3.17.24 get the chip id as a string

Definition at line 1843 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentSMMode_mainModule()

int getCurrentSMMode_mainModule ( )

returns the current SM Mode

Definition at line 3446 of file MainModule.cpp.

Here is the caller graph for this function:

◆ getFeedCount_mainModule()

int getFeedCount_mainModule ( )

feedcount info..

Definition at line 643 of file MainModule.cpp.

Here is the caller graph for this function:

◆ getFeederType_mainModule()

int getFeederType_mainModule ( )

get the feeder type (Sepper 1,2,3 ...)

Definition at line 649 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFullBLEDeviceName_mainModule()

char * getFullBLEDeviceName_mainModule ( )

full: ""Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead"

returns full name and address, and service.

8.16.25 BLE CLIENT

Definition at line 3473 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLUXThreshold_mainModule()

int getLUXThreshold_mainModule ( int  thresholdKind)

get the threshold val

Definition at line 1869 of file MainModule.cpp.

◆ getPairedDevice_mainModule()

char * getPairedDevice_mainModule ( )

returns if the paired device is not NONE

Definition at line 1089 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPairedDeviceAddress_mainModule()

char * getPairedDeviceAddress_mainModule ( )

returns if the paired device is not NONE

Definition at line 1095 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPairedDeviceOrAddress_mainModule()

char * getPairedDeviceOrAddress_mainModule ( )

returns if the paired device is not NONE .. returns address or device

Definition at line 1120 of file MainModule.cpp.

Here is the call graph for this function:

◆ getPinUseStruct_mainModule()

PinUseStruct * getPinUseStruct_mainModule ( )

get the pin use array

Definition at line 3967 of file MainModule.cpp.

Here is the caller graph for this function:

◆ getSemanticMarkerDocFollow_mainModule()

char * getSemanticMarkerDocFollow_mainModule ( )

gets the semanticAddress SemanticMarker™

get the latest semantic marker for doc follow

Definition at line 2495 of file MainModule.cpp.

◆ getServerServiceName_mainModule()

char * getServerServiceName_mainModule ( )

10.10.25 #405 #406 see if the device is a PTClicker if the M5Atom class is one.. return the service name: PTClicker or PTFeeder

Definition at line 375 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTemperature_mainModule()

float getTemperature_mainModule ( )

retrieves the temperature .

retrieves the temperature in F.

return celcius float temperature = M5.Axp.GetTempInAXP192();

Definition at line 2250 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeStamp_mainModule()

int getTimeStamp_mainModule ( )

On the esp32, sec is all we can handle. We can return as a double if milisecond resolution is needed. This is the time since app started.. https://randomnerdtutorials.com/epoch-unix-time-esp32-arduino/

7.27.25 miliseconds .. convert to seconds

Definition at line 3342 of file MainModule.cpp.

Here is the caller graph for this function:

◆ groupTopicFullName()

char * groupTopicFullName ( char *  groupName)

returns a groupTopic to use as a topic

Definition at line 1888 of file MainModule.cpp.

Here is the caller graph for this function:

◆ incrementFeedCount_mainModule()

void incrementFeedCount_mainModule ( )

increments .. and if MAX goes to 0 – and sends a message on MQTT

8.16.25 MQTT

NOTE: don't send "feed" as it might trigger a FEED ...

called by the feed operation to say the device is still running.. and count it as a button click. Issue #145 8.8.22

Definition at line 656 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ incrementSMMode_mainModule()

void incrementSMMode_mainModule ( )

increment the currentSMMode, wrapping and using the max menu

Definition at line 3452 of file MainModule.cpp.

Here is the call graph for this function:

◆ initAsyncCallFlags()

void initAsyncCallFlags ( )

initialize the async call flags (with and without parameters)

storage for asyncCallCommands

Definition at line 1396 of file MainModule.cpp.

Here is the caller graph for this function:

◆ initCallbacksMain()

void initCallbacksMain ( )

init the callbacks to dummy callbacks

only place for #ifdef (NOTE some can be 0 based on the #ifdef module not being included.. 8.16.25 MQTT

8.16.25 BLE SERVER

8.16.25 BLE CLIENT

Definition at line 767 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initGlobals_mainModule()

void initGlobals_mainModule ( )

init globals strings

NOTE: this is definitely needed, as grabbing strings willy nilly can bomb or corrupt stuff..

1.7.24

Definition at line 431 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initSensorClassTypeArray()

void initSensorClassTypeArray ( )

init will look at those SensorClass known above, and look to see which ones are defined by the user in the SensorsStruct A report will show which ones were not found

create possible Sensor class instan ces 11.28.25 use the class name as identity()

12.19.25 add Class type for Chain

11.28.25 Clear day, M5 Out create array of instances POSSIBLE (the Sensors, pin1,pin2 – will instantiate them)

11.28.25 create array of Sensors

12.19.25 add ChainButtonClass

add check..

return the sensor specified or null

all the sensors defined sensors is an array of sensor

11.28.25 use the SensorClassType (like the M5AtomClassType pattern) go through the defined sensorName and instantiate those classes

find matching sensor instantiated

look for ths sensor mentioned..

set the running sensor type for this instnce (currently only 1 per sensor type)

call this setup and pin sets setup and then setPins..

1.22.26 the Chain will read the button definitions at setup time and loop time

call setup

exit loop

find missing sensors go throug the defined sensorName and instantiate those classes

missing instance

Definition at line 183 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invokeAsyncCommands()

void invokeAsyncCommands ( )

checks if any async commands are in 'dispatch' mode, and if so, invokes them, and sets their flag to false

8.16.25 BLE CLIENT

8.16.25 MQTT

The FINISH of callback for "onWrite" of the bluetooth "onWrite' 1.10.24 add ability to send a MQTT Semantic Marker message This sends a MQTT message. Currently GROUP not supported TODO: add GROUP 3.9.24 REST call now process those that don't have a string parameter 8.16.25 MQTT 8.16.25 WIFI AP 8.16.25 MQTT register the 2 callbacks for now.. this is a sending of the message 8.16.25 MQTT 8.16.25 BLE CLIENT 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 if not paired, then feed everyone except out device... if not BLE connected .. send wifi fee to all below... 8.16.25 BLE CLIENT returns whether connected over BLE as a client to a server(like a ESP feeder) If not connected over BLE &ndash; then send the MQTT feed message.. ??? WHY?? 8.16.25 MQTT only if not WIFI with BLE 8.20.24 put back to MQTT feed to all .. for now.. SerialCall.println("async_send_feed.1");

send a BLE feed command as we are connected

perform ACK too 8.16.25 MQTT

11.26.25 send Status instead

this is a sending of the message 5.15.25 Sodbuster Rod plowing/disking in minutes with Mark and Bud

set the persistence (Note, this is locally saved. If sending elsewhere .. then they have to set their value)

click call synchronously ...

OK: issue. if we are an ESP feeder, the STEPPER is on .. so we're good, if an M5 - then either send over BLE or MQTT

send via BLE or MQTT .. 8.16.25 BLE CLIENT returns whether connected over BLE as a client to a server(like a ESP feeder)

If not connected over BLE – then send the MQTT buzzon message.. 8.16.25 MQTT

send over BLE...

setGatewayOn/Off called from the processJSON message in MQTT or via the EPROM setting (TODO)

sends the status from the main module URL 8.16.25 MQTT

NO MORE: sendDocFollowMessageMQTT(statusURL);

8.16.25 MQTT

These are the ASYNC_CALL_PARAMETERS_MAX NO: just change our credentials ...

8.16.25 MQTT Restarts (or attempts) a restart of the WIFI using the existing credentials – vs the 'n' command

Definition at line 1462 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmptyString()

boolean isEmptyString ( char *  stringA)

informs if null or empty string

if an empty string

Definition at line 2156 of file MainModule.cpp.

Here is the caller graph for this function:

◆ isMinimalMenuMode_mainModule()

boolean isMinimalMenuMode_mainModule ( )

returns which mode in (min or expanded)

Definition at line 3402 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPTFeeder_mainModule()

boolean isPTFeeder_mainModule ( )

gets if PTFeeder a surrogate for the M5Atom class

Defines the name of the service of the server, which for M5 will be PTClicker

Definition at line 354 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTrueString_mainModule()

boolean isTrueString_mainModule ( String  valCmdString)

whether the string is TRUE, ON, 1

Definition at line 837 of file MainModule.cpp.

Here is the caller graph for this function:

◆ isValidPairedDevice_mainModule()

boolean isValidPairedDevice_mainModule ( )

returns if the paired device is not NONE. Note, the paired Name might be an address now (see below)

returns if the paired device is not NONE

Definition at line 1101 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop_mainModule()

void loop_mainModule ( )

called for the loop() of this plugin

6.20.25 works with full code (JSON, or single commands - with '.' as help) 6.19.25 Mt Peak finally (kept to 124 bpm) Per ##373 let the serial monitor get some input, and let us set a few features see if data on the serial input Re-indexed and now command completion works!!!!!! 3 years later.

See also
https://developer.apple.com/documentation/corespotlight/regenerating-your-app-s-indexes-on-demand?language=objc

save globally for the callback below..

call the callback specified from the caller (eg. NimBLE_PetTutor_Server .. or others)

10.16.25 add the M5.update here...

10.16.25 Mt out .. looks like storm comming implement the buttonA here.. big button on front of M5StickC Plus

10.16.25 seems the big button on M5ATOM is Button B ..

11.25.25 Cold 30's call the long long

11.27.25 Turkey Day, loop

Definition at line 533 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop_Sensors_mainModule()

void loop_Sensors_mainModule ( )

1.22.24 add setup and loop at main so it can call appropriate plugs

these are the plugin modules .. and only 1 active at a time except for ATOM

5.6.25 use object version

Definition at line 3629 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loopSensorClassTypeArray()

void loopSensorClassTypeArray ( )

11.27.25 Turkey Day, loop

return the sensor specified or null

all the sensors defined sensors is an array of sensor

go through the defined sensorName and call loop on those classes

this only works if there is an instance there of value .. the NULL doesn't work as this is a memory location somethwere. so the instantiator will now create a DUMMY SensorClass object .. so this works. The issue is there can be a sensor that doesn't exist so that slot is empty .. but the &sensors[i] BLOWS up

11.28.25 KLUDGE .. for now only this sensor has a loop

check sensor exists ..

Definition at line 102 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_cleanSavedWIFICredentials()

void main_cleanSavedWIFICredentials ( )

clean the saved WIFI credential, otherwise the AP mode doesn't work (6.3.22)

go through the saved WIFI credentials and empty them with "" (vs null)

cannot null but can make stringlen=0

Definition at line 1262 of file MainModule.cpp.

Here is the call graph for this function:

◆ main_credentialsUpdated()

void main_credentialsUpdated ( )

moved here 4.25.22 (entirely from ESP_IOT.ino)

April 8, 2022 set that the credentials are set. Called from the MQTT after processJSONMessage() found things were good..

8.16.25 WIFI AP

Definition at line 936 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_currentStatusJSON()

char * main_currentStatusJSON ( )

status in JSON format, needs to return something as a ',' is already added before calling this..

returns a string in JSON format, such that {'battery':'84'}, {'buzzon':'off'} .. etc

Sample format: {"status": [ { "BLE": "on" }, { "numfeeds": "8", "maxfeeds": "16" }, { "battery": "87" }, { "buzzon": "on" }, { "MQTT": "on" }, { "WIFI": "on" }, { "AP": "off" }, { "tilt": "55" } ] }

1.4.24 work on ATOM kinds without IFDEF (except to bring in the code)

5.6.25 use object version

Definition at line 2320 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_currentStatusURL()

char * main_currentStatusURL ( boolean  fullStatus)

returns a string in in URL so: status?battery=84'&buzzon='off' } .. etc if fullStatus, return everything, else just the ATOM stuff

7.20.25 add T too

8.16.25 MQTT

TODO: make sure no spaces ... unless escaped

8.16.25 MQTT

TODO: make sure no spaces ... unless escaped

5.6.25 use object version

TODO: put these somewhere somehow (expandable easily..architecturally. eg. setStatus("battery","87") key,val the JSON DB supports db["battery"]=87 like syntax..

Definition at line 2429 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_dispatchAsyncCommand()

void main_dispatchAsyncCommand ( int  asyncCallCommand)

checks if any async commands are in 'dispatch' mode, and if so, invokes them, and sets their flag to false

dispatches a call to the command specified. This is run on the next loop()

this just sets the flag, it's the next loop that makes the call

Definition at line 1413 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_dispatchAsyncCommandWithString()

void main_dispatchAsyncCommandWithString ( int  asyncCallCommand,
char *  parameter 
)

send an async call with a string parameter. This will set store the value and then async call the command (passing the parameter) These are the ASYNC_CALL_PARAMETERS_MAX

store in the parameter mailbox

this just sets the flag, it's the next loop that makes the call

6.15.25 Fathers Day seems issue when a GROVE or other sensor plugged in the main loop isn't working. SO for now, if the command is "r" then do an actual reboot..

Definition at line 1431 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_dispatchSyncCommand()

void main_dispatchSyncCommand ( int  syncCallCommand)

the main sync command (no parameters yet)

5.16.25 Fountainhead, Raining cold weekend start SYNC calls starting with the SYNC_CLICK_SOUND

5.15.25 see if the Buzzer class is defined .. if so, then call local message

perform the click sound.. this will be the sensors...

Definition at line 1358 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_getPassword()

char * main_getPassword ( )

return password

Definition at line 1289 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_getScannedDeviceName()

char * main_getScannedDeviceName ( )

return devicename

Definition at line 1295 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_getScannedGroupNameTopic()

char * main_getScannedGroupNameTopic ( )

return groupname – returns "" or nil if not set, or the FULL group name topic, or nil

Definition at line 1324 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_getUsername()

char * main_getUsername ( )

return the username and password 12.14.23 to support calling the SMART buttons (smrun) with parameters

Definition at line 1283 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_JSONStringForWIFICredentials()

char * main_JSONStringForWIFICredentials ( )

retrieve a JSON string for the ssid and ssid_password: {'ssid':<ssid>,'ssidPassword':<pass>"}

Definition at line 1199 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_nextJSONWIFICredential()

char * main_nextJSONWIFICredential ( )

! cycle through the next WIFI saved credential

! cycle through the next WIFI saved credential - return next one that isn't our current one..

WIFI_CREDENTIALS_MAX

jump out of loop if no match.. so index is valid

Definition at line 1205 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_printModuleConfiguration()

void main_printModuleConfiguration ( )

prints the module configuration by looking at #defines Eventually this might be an object returned letting the code know a capability is included for runtime (vs compile time) decisions

Module Configuration

[x] ESP_M5

8.16.25 MQTT [x] USE_MQTT_NETWORKING

8.16.25 BLE SERVER [x] USE_BLE_SERVER_NETWORKING

8.16.25 BLE CLIENT [x] USE_BLE_CLIENT_NETWORKING

8.16.25 WIFI AP [x] USE_WIFI_AP_MODULE

and print any preferences to show

Definition at line 1987 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_saveWIFICredentials()

void main_saveWIFICredentials ( char *  ssid,
char *  ssid_password 
)

save the WIFI credential

store the JSON version of these credentials..

look for an non matching slot.. if none, then use the first

jump out of loop if no match.. so index is valid, or NONE (which is the placeholder)

save in chosen index

Definition at line 1232 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_setScannedDeviceName()

void main_setScannedDeviceName ( char *  deviceName)

set the scanned device name

Definition at line 1302 of file MainModule.cpp.

Here is the caller graph for this function:

◆ main_setScannedGroupName()

void main_setScannedGroupName ( char *  groupName)

set the scanned group name 1.7.24

Definition at line 1310 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_updateMQTTInfo()

void main_updateMQTTInfo ( char *  ssid,
char *  ssid_password,
char *  username,
char *  password,
char *  guestPassword,
char *  deviceName,
char *  host,
char *  port,
char *  locationString 
)

sets the WIFI and MQTT user/password. It's up to the code (below, maybe in future a register approach) to decide who needs to know

sets the WIFI and MQTT user/password. It's up to the code to decide who needs to know (currently this calls APmodule..)

store the device name

store the JSON version of these credentials..

8.16.25 WIFI AP

Definition at line 1336 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ matchesSMMode_mainModule()

boolean matchesSMMode_mainModule ( char *  cmd,
int  whichSMMode 
)

returns if a match the mode. whichSMMode is 0..12 and == sm0 .. smn

Definition at line 3385 of file MainModule.cpp.

Here is the call graph for this function:

◆ maxMenuModes_mainModule()

int maxMenuModes_mainModule ( )

returns the current max of the menu modes (using the setting of min or expanded) to determine

Definition at line 3420 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ messageSend_mainModule()

void messageSend_mainModule ( char *  sendValue,
boolean  deviceNameSpecified 
)

TODO: have a callback regist approach.

12.28.23, 8.28.23 Adding a way for others to get informed on messages that arrive for the set,val 5.21.25 SEND and CMD will be treated the same and put to "send"

5.21.25 this will overlap with the "cmd" .. so send == cmd

5.6.25 use object version

Definition at line 873 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ messageSetVal_mainModule()

void messageSetVal_mainModule ( char *  setName,
char *  valValue,
boolean  deviceNameSpecified 
)

8.28.23 Adding a way for others to get informed on messages that arrive for the set,val 1.10.24 if deviceNameSpecified then this matches this device, otherwise for all. It's up to the receiver to decide if it has to be specified

5.6.25 use object version

1.24.26 call the same on the SensorClassType

Definition at line 848 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ messageSetVal_SensorClassTypeArray()

void messageSetVal_SensorClassTypeArray ( char *  setName,
char *  valValue,
boolean  deviceNameSpecified 
)

1.24.26 send the setval of the MQTT message ..TODO 11.27.25 Turkey Day, loop

return the sensor specified or null

all the sensors defined sensors is an array of sensor

go through the defined sensorName and call loop on those classes

this only works if there is an instance there of value .. the NULL doesn't work as this is a memory location somethwere. so the instantiator will now create a DUMMY SensorClass object .. so this works. The issue is there can be a sensor that doesn't exist so that slot is empty .. but the &sensors[i] BLOWS up

check sensor exists ..

forward the message

Definition at line 146 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ minMenuModesMax_mainModule()

int minMenuModesMax_mainModule ( )

returns the current max of the MIN menu modes (using the setting of min or expanded) to determine

Definition at line 3414 of file MainModule.cpp.

Here is the caller graph for this function:

◆ onBLEServerCallback()

void onBLEServerCallback ( char *  message)

The callback for "onWrite" of the bluetooth "onWrite'.

Definition at line 947 of file MainModule.cpp.

◆ onStatusMessageBLEServerCallback()

void onStatusMessageBLEServerCallback ( char *  message)

The callback for "status messages" of the bluetooth.

** The callback for "status messages" of the bluetooth

2.2.22 send this over bluetooth.. TODO.

Definition at line 954 of file MainModule.cpp.

Here is the caller graph for this function:

◆ onWriteBLEServerCallback()

void onWriteBLEServerCallback ( char *  message)

The callback for "onWrite" of the bluetooth "onWrite'.

send an async call with a string parameter. This will set store the value and then async call the command (passing the parameter) These are the ASYNC_CALL_PARAMETERS_MAX

Definition at line 1051 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onWriteBLEServerCallbackFinish()

void onWriteBLEServerCallbackFinish ( char *  message)

The FINISH of callback for "onWrite" of the bluetooth "onWrite'.

client never sends these wrapped messages of length 1, so process normally.. gets us out of potential infinite wait

we are done.. send big message to ourself..

Issue: the message is arriving via BLE, but if we call the MQTT process, it might call us back to send the message over BLE. This hangs things up! So short optimization for 'feed' will be to look for cmd and feed in message {cmd:feed} 8.19.22 issue #162

8.16.25 MQTT

the MQTTNetwork.processJSONMessage() will return true if the message was JSON and was processes, false otherwise.

processed by the MQTTNetworking code.. 8.16.25 BLE SERVER

perform feed...

look for ** sensor commands..

8.16.25 BLE SERVER

Definition at line 963 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poweroff_mainModule()

void poweroff_mainModule ( )

power off

Definition at line 1155 of file MainModule.cpp.

Here is the caller graph for this function:

◆ processClientCommandChar_mainModule()

void processClientCommandChar_mainModule ( char  cmd)

single character version of processClientCommand (since many used that already)

Keep ProcessClientCmd short to let the callback run. instead change the feeder state flag processes a message that might save in the EPROM.. the cmd is still passed onto other (like the stepper module)

the sentToStepper is only needed if there are 'actions' on the command, versus just setting persistent EPROM data. Like feed, buzzer, etc.. Thus we don't need to know much of their implementation.. or we just pass anyway!

only process things that are stored persistently.. 7.20.25 6 months T Using switch to guarentee unique case of single characters

start timer..

start timer..

Issue #332 8.17.2024

set autoRotoate as well..

default to clockwise == 0 8.18.24 setting this will check for the factory setting..

Issue #332 8.17.2024

8.18.24 setting this will check for the factory setting..

Issue #332 8.17.2024

set autoRotoate as well..

set autoRotoate as well.. 8.18.24 setting this will check for the factory setting..

11.25.25 toggle the buzzer, THIS is local already, but the toggle:buzzer will be ONLY be to a BLE device that way it sends 'F'

then toggle value

will be turned on so make sound.. the main sync command (no parameters yet)

this is a call to the connected device

this will be a BLE message to the connectd device sending a 'F" then toggle value see if connected to a BLE device.. send via BLE send a string of 13 or less characters. 11.27.25 Turkey Day, Nice day Mt Out. Also make the Buzzer sound will be turned on so make sound.. the main sync command (no parameters yet) dispatches a call to the command specified. This is run on the next loop() 6.20.25 dispatches a call to the command specified. This is run on the next loop() 8.16.25 MQTT send to ourself NOTE: the gateway is auto selected for now. A future version might manually set it in other situations (eg. my iPhone app should have a flag to not be a gateway at time) 7.25.25 chilly morning, Mt starting to come out. SPIFF clean SPIFF file"

upload SPIFF to web

number of lines to send TODO: configure thie number of lines to save..

Restarts (or attempts) a restart of the WIFI using the existing credentials – vs the 'n' command

7.24.25 use SPIFF

toggle spiff on/off

WIFI credential changes...

These are the ASYNC_CALL_PARAMETERS_MAX

NOTE: this is almost the same as 'w' except there might be more WIFI than 2 (so swap is different).

8.16.24 per #332

8.16.24 per #332

NOTE: no current mode to specify CCW or CW dynamically (non factory reset)

9.30.23 reverse direction

note: reboot not needed as the next time a feed happens, it reads this value

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

poweroff

7.12.25 0 == Clear SENSOR definitions

poweroff

reboot .. so the sensors are set..

7.9.25 1 == Init SENSOR definitions

12.21.25 Winter Solstice, Eagles, support the new Chain Buttons

7.19.25 add Clear Sensors

7.9.25 grabbed from BOOTSTRAP let someone update the atom to the recent OTA

8.16.25 MQTT retrieves from constant location

7.9.25 grabbed from BOOTSTRAP let someone update the atom to the recent OTA

8.16.25 MQTT retrieves from constant location

8.16.25 MQTT retrieves from constant location

8.18.25

8.16.25 MQTT send to ourself

returns if the BLEClient is turned on.. note, if connected to a BLE device, then disconnect

toggle spiff on/off

this is local buzzer on/off calling the current Atom Class

this will be a BLE message to the connectd device sending a 'F"

6.20.25

print out stuff

Definition at line 2541 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPreferences_mainModule()

void readPreferences_mainModule ( )

reads the preferences. Save is everytime the savePreference is called

reads the preferences. Save is everytime the savePreference is called 5.14.25 (Dead 5.14.74 3rd Wall of Sound) add the Sensors as well..

clean the cached, and initialize what are cached..

intiialize the preferences arrays from EPROM. This also updates the defaults BUT: the caches below are from the value retrieved (and defult if need be)

start the read-write of the EPROM

check some of the boolean ones to cache .. so don't have to go to the EPROM everytime..

9.4.25 STRANGE: the BOOLEAN aren't working too good so removing CLOCKWISE and STEPPER_2FEED **** NOTE: THis is where whether things are cached or not is set! Eventually all boolean and int could be cached.. CACHE SETTINGS (boolean)

8.2.24

9.3.25 strange wasn't working ... if in cache..

CACHE SETTINGS (int)

8.2.24 set the includeGroups

grab the state at the start, then it's only modified from a MQTT message

save parse (do it this way, instead of setIncludeGroups (as that stored in eprom again)

Close the Preferences

set onbootPreferences

5.14.25 (Dead 5.14.74 3rd Wall of Sound) add the Sensors as well..

1.23.26 do the same for chain 1.30.26 THIS is done whether we have the actual buttons or not, that is defined which SensorClass – ChainButtonClassType

Definition at line 549 of file PreferencesController.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rebootDevice_mainModule()

void rebootDevice_mainModule ( )

power of devices reboot

Definition at line 1148 of file MainModule.cpp.

Here is the caller graph for this function:

◆ refreshDelayButtonTouched_MainModule()

void refreshDelayButtonTouched_MainModule ( )

called by the feed operation to say the device is still running.. and count it as a button click.

called by the feed operation to say the device is still running.. and count it as a button click. Issue #145 8.8.22

Definition at line 1068 of file MainModule.cpp.

Here is the caller graph for this function:

◆ registerCallbackMain()

void registerCallbackMain ( int  callbacksModuleId,
int  callbackType,
void(*)(char *)  callback 
)

register the callback based on the callbackType. use the callbacksModuleId for which one..

Definition at line 800 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerPinUse_mainModule()

void registerPinUse_mainModule ( long  pin,
String  pinName,
String  moduleName,
boolean  isI2C 
)

7.31.25 store this information.. for STATUS 5.3.25 add a central clearing house for defining PIN use

See also
issue #365 central clearing house for all pins used to we can analyze if there are overlaps pin is the actual number, pinName is the local name (eg. IN1_PIN or VIN_PIN). moduleName is the module in the code, isI2C is whether this is a I2C bus (which we aren't using much yet)

5.3.25 create storage here

store globally

8.30.25 add the pin

increment

Definition at line 3980 of file MainModule.cpp.

Here is the caller graph for this function:

◆ resetFeedCount_mainModule()

void resetFeedCount_mainModule ( )

sets the feed count max

Definition at line 678 of file MainModule.cpp.

◆ restartAllMenuStates_mainModule()

void restartAllMenuStates_mainModule ( )

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

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 3925 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restartProcessesForOTAUpdate_mainModule()

void restartProcessesForOTAUpdate_mainModule ( )

restart all loops... while OTA working..

Definition at line 392 of file MainModule.cpp.

Here is the caller graph for this function:

◆ semanticMarkerToJSON_mainModule()

char * semanticMarkerToJSON_mainModule ( char *  semanticMarker)

3.23.25 rainy weekend create a JSON string from the SemanticMarker https://semanticmarker.org/bot/setdevice/scott@konacurrents.com/PASS/M5AtomSocket/socket/on} Create a JSON knowing the "bot" syntax, eg. setdevice/USER/PASS/device/<set>/<flag> defined in TokenParser.h

Definition at line 3945 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendMessageString_mainModule()

void sendMessageString_mainModule ( char *  messageString)

adding a synchronous call to send a message over the network (assuming MQTT but not specified), this tacks on {device} and {t:time}

Definition at line 2223 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendMessageStringTopic_mainModule()

void sendMessageStringTopic_mainModule ( char *  messageString,
char *  topicString 
)

adding a synchronous call to send a message over the network (assuming MQTT but not specified), this tacks on {device} and {t:time}

8.16.25 MQTT

12.19.23 Amber in air from Iceland. 50 years since Dead 12.19.73

NOTE: the # has to be there, otherwise the sendMessageMQTT ignores it..

send this message over MQTT

Definition at line 2230 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendSemanticMarkerDocFollow_mainModule()

void sendSemanticMarkerDocFollow_mainModule ( const char *  SMDocFollowAddress)

sends the SM on the DOCFOLLOW channel (publish it..)

8.16.25 MQTT

Definition at line 2501 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendStatusMQTT_mainModule()

void sendStatusMQTT_mainModule ( )

1.1.24 send status of this device after events..

TODO: have a callback regist approach.

Definition at line 3932 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAsyncCallOTAUpdate()

void setAsyncCallOTAUpdate ( bool  flag)

sets the async OTA flag (for next loop)

Definition at line 1083 of file MainModule.cpp.

◆ setClockwiseMotorDirection_mainModule()

void setClockwiseMotorDirection_mainModule ( boolean  isClockwiseFlag)

8.18.24 setting this will check for the factory setting..

toggle flag and save as that mode..

this says: factory is CW and we want to turn CCW so we have to go the opposite direction (!CW)

toggle flag as well,

this says: factory is CCW and we want to turn CW so we have to go the opposite direction (!CW)

set to what it thinks it is...

Definition at line 2508 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConfiguration_mainModule()

void setConfiguration_mainModule ( char *  configurationName)

8.20.25 Horses grazing if field first time for Mark and Bud add set/config PTStepper M5AtomCamera

poweroff

7.30.25 changing to the HDriver's board savePreference_mainModule(PREFERENCE_SENSORS_SETTING, _sensorsEPROM);

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug

for Tumbler .. use 200

See also
#390 this is the RPM of the stepper

set autoRotoate as well..

tumbler

9.5.25 set the 2step OFF for now

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

12.21.25 Winter Solstice, Eagles, Chain Button

poweroff

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug (non for now..

TODO.. Chain presskind = 0, short, 1, long, 2, longlong ButtonKind, number_1based, pressKind, setString, valString, device if localhost then internal message, otherwise external MQTT message

idea is you define the button and the press kind MatrixCell is Column Major 1,4, 7 // 2,5,8 // 3,6,9

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

poweroff

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug

1 second motor (overloads "angle" field) This is the RPM speed

See also
#390 this is the RPM of the stepper

set autoRotoate as well..

tumbler

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

poweroff

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug (non for now..

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug (non for now..

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

7.30.25 changing to the HDriver's board

7.31.25 if Scanner or QR then pin 22 used .. so make M5HDriver (basically don't have a sensor)

also specify the sensor plug (non for now..

10.24.25 also set BLE client and serve on, RAIN .. atosmopheric river

if set, the BLE Server (like PTFeeder) will tack on the device name (or none if not defined).

reboot .. so the sensors are set..

Definition at line 3117 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConnectedBLEDevice_mainModule()

void setConnectedBLEDevice_mainModule ( char *  deviceName,
boolean  isGEN3 
)

BLE Discovery Methods Connected to a BLE device with the advertised name. The syntax can include (PTFeeder:NAME) or just PTFeeder Being disconnected is already a flag isConnectedBLE ...

set the isGEN3 flag

now set the gateway based on if GEN3

seems device name = "Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead Note: the Address, eg "7c:9e:bd:48:af:92" is unique somehow.. lets use that to skip one.. parse out the 2nd half of name go past the : empty name (just PTFeeder) 8.29.23 send a message saying we connected.. parse for the address too.. strcpy(_fullBLEDeviceName, deviceName); seems device name = "Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead Note: the Address, eg "7c:9e:bd:48:af:92" is unique somehow.. lets use that to skip one..

parse out the 2nd half of name

empty name (just PTFeeder)

Definition at line 3495 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCurrentSMMode_mainModule()

void setCurrentSMMode_mainModule ( int  whichSMMode)

sets the current screen mode .. which can be used by Button and Display processing

This is needed now as message from external (not button pressing) causes a state change, but the button processing isn't knowing about it... sets the current screen mode .. which can be used by Button and Display processing whichSMMode 0..SM_LAST

Definition at line 3432 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLUXThreshold_mainModule()

void setLUXThreshold_mainModule ( int  thresholdKind,
int  luxVal 
)

set the threshold val

Definition at line 1856 of file MainModule.cpp.

Here is the caller graph for this function:

◆ setSemanticMarkerDocFollow_mainModule()

void setSemanticMarkerDocFollow_mainModule ( char *  SMDocFollowAddress)

sed the address to follow

SemanticMarker events This would see a DOCFollow message, and set the value.. then SM10 can display it..

Definition at line 2487 of file MainModule.cpp.

◆ setup_mainModule()

void setup_mainModule ( )

called from the setup()

THIS IS the setup() and loop() but using the "component" name, eg MQTTNetworking() This will perform preference initializtion as well called from the setup()

setup for the token parser (really just for testing) – an

init globals like strings (but nothing that needs preferences)

read the preferences from EPROM

must initialize the structs NOTE: this has to ber AFTER the preferences are read in..

a first time feature .. to get EPROM changed to a different default

7.12.22 {'dev':'m5",'cmd':'bleserveron'} or bleserveroff will work later.. #issue 116 .. turn off the BLE_Server for the M5

5.6.25 use object version

all ..

5.14.25 use the Sensor types first we have N sensors then we get which ones the user wants (the SENSORS_SETTING) then we instantiate, and provide ping, etc.

Definition at line 451 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_Sensors_mainModule()

void setup_Sensors_mainModule ( )

1.22.24 setup of buttons

setup of buttons and sensors

these are the plugin modules .. and only 1 active at a time except for ATOM

5.6.25 use the M5Atom ClassType

See also
https://www.cs.fsu.edu/~myers/cop3330/notes/dma.html

7.17.25

8.16.25 bring in the Camera

10.26.25 Power Out .. Wind Storm. Generator Running add a NoModule class

3.31.25 create array of plugs

7.17.25

8.16.25 bring in the Camera

10.26.25 Power Out .. Wind Storm. Generator Running add a NoModule class

add check..

use this one...

find the current atomKind. which is a string

find which one..

check against the identity.. (or make this part of that method?)

Matched..

now the setup() call

5.6.25 use object version

Definition at line 3662 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showText_mainModule()

void showText_mainModule ( String  text)

shows a FEED (or whatever) then blanks the screen after N seconds NOTE: This will be a scrolling text as sometime ..

Definition at line 1964 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ singleClickTouched()

void singleClickTouched ( char *  whichButton)

called on single click NOTE: with BLE_CLIENT_NETWORKING, the right button and top button send a BLE command for feeding..

8.16.25 WIFI AP for now, only send the FEED command via BLE_CLIENT if turned on. No reboot to AP mode yet.. 8.16.25 BLE CLIENT send the async FEED

dispatches a call to the command specified. This is run on the next loop()

Definition at line 1951 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solidLightMessageCallback()

void solidLightMessageCallback ( char *  message)

callback for SOLID blinking led

Definition at line 1924 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solidLightOnOff()

void solidLightOnOff ( boolean  onOff)

callback for SOLID blinking led

supports turning on the solid light..

Definition at line 1972 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startsWithChar()

boolean startsWithChar ( char *  str,
char  c 
)

a char* version of startsWith (after skipping spaces)

find first non space character, and if not '{' then return false

jump out if not a space, and 'i' will be the thing to look for

Definition at line 2171 of file MainModule.cpp.

Here is the caller graph for this function:

◆ stopAllProcesses_mainModule()

boolean stopAllProcesses_mainModule ( )

if stopped

try to disconnect..

Definition at line 397 of file MainModule.cpp.

Here is the caller graph for this function:

◆ stopMotor_mainModule()

void stopMotor_mainModule ( )

added 9.29.22 to support wildcards #196

6.7.25 hot air balloons over house.. stops the motor

Definition at line 347 of file MainModule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopProcessesForOTAUpdate_mainModule()

void stopProcessesForOTAUpdate_mainModule ( )

stop all loops... while OTA working..

Definition at line 387 of file MainModule.cpp.

Here is the caller graph for this function:

◆ toggleMinimalMenuMode_mainModule()

void toggleMinimalMenuMode_mainModule ( )

toggles the menu mode

Definition at line 3408 of file MainModule.cpp.

Here is the call graph for this function:

◆ whichM5AtomClassType()

M5AtomClassType * whichM5AtomClassType ( )

6.6.25 get the current M5AtomClassType

Definition at line 3623 of file MainModule.cpp.

◆ whichSMMode_mainModule()

int whichSMMode_mainModule ( char *  cmd)

************** SM Mode Processing ***************

returns an index from 0..max of SM matching cmd, or -1 if none

Definition at line 3359 of file MainModule.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ _allCallbacks

array of known size (CALLBACKS_MODULE_MAX) of callbackSignatures

Definition at line 764 of file MainModule.cpp.

◆ _asyncCallFlags

boolean _asyncCallFlags[ASYNC_CALL_MAX]

storage for asyncCallCommands

3.21.22 these are to setup for the next time the main loop() runs to call these commands.. The implementation is hard coded in the ESP_IO.ino TODO: make this a registeration approach

Definition at line 1391 of file MainModule.cpp.

◆ _asyncCallFlagsParameters

boolean _asyncCallFlagsParameters[ASYNC_CALL_PARAMETERS_MAX]

array of async flags for the different ASYNC_CALl values

Definition at line 1393 of file MainModule.cpp.

◆ _asyncCallOTAUpdateFlag

boolean _asyncCallOTAUpdateFlag = false

3.28.22 .. implemented in ESP_IOT.ino

Definition at line 1076 of file MainModule.cpp.

◆ _asyncParameter

char _asyncParameter[500]

the parameter being sent to those commands passing an argument

Definition at line 407 of file MainModule.cpp.

◆ _bigMessage

char _bigMessage[500]

Definition at line 422 of file MainModule.cpp.

◆ _BuzzerSensorClass

BuzzerSensorClass* _BuzzerSensorClass

Definition at line 89 of file MainModule.cpp.

◆ _callbacksFunctionsMAXS

int _callbacksFunctionsMAXS[CALLBACKS_MODULE_MAX]

the array of callback functions

the max of each module .. hard coded (or 0 if module not there)

Definition at line 743 of file MainModule.cpp.

◆ _callbacksInitializedMain

boolean _callbacksInitializedMain = false

flag for initializing if not yes

Definition at line 746 of file MainModule.cpp.

◆ _ChainButtonClass

ChainButtonClass* _ChainButtonClass

Definition at line 95 of file MainModule.cpp.

◆ _chipID_MainModule

uint32_t _chipID_MainModule = 0

3.17.24 the unqiue chip id

Definition at line 1823 of file MainModule.cpp.

◆ _chipIdString_MainModule

char _chipIdString_MainModule[15]

string like: 10311304

Definition at line 1825 of file MainModule.cpp.

◆ _connecteBLEisGEN3

boolean _connecteBLEisGEN3 = false

whether connected GEN3

Definition at line 3485 of file MainModule.cpp.

◆ _connectedBLEDeviceAddress

char _connectedBLEDeviceAddress[50]

full: ""Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead"

Definition at line 428 of file MainModule.cpp.

◆ _connectedBLEDeviceName

char _connectedBLEDeviceName[50]

saved BLE connected name 8.26.22

Definition at line 424 of file MainModule.cpp.

◆ _deviceNameSave

char _deviceNameSave[50]

saved deviceName storage..

Definition at line 418 of file MainModule.cpp.

◆ _feedCount_mainModule

int _feedCount_mainModule = 0

5.3.22 added a feed count approach.. (NOTE: there is a _feedCount in Dispence.cpp ... and no linker error!!! )

Definition at line 623 of file MainModule.cpp.

◆ _fullBLEDeviceName

char _fullBLEDeviceName[100]

full: ""Name: PTFeeder:HowieFeeder, Address: 7c:9e:bd:48:af:92, serviceUUID: 0xdead"

Definition at line 426 of file MainModule.cpp.

◆ _fullStatusString

char _fullStatusString[500]

status string (URL query format)

Definition at line 414 of file MainModule.cpp.

◆ _groupTopicName

char _groupTopicName[100]

storage for the group topic name Note NO "/" in the front of the path only "usersP"

Definition at line 1885 of file MainModule.cpp.

◆ _JSONStringForWIFICredentials

char _JSONStringForWIFICredentials[200]

global to store credentials when ever they are stored..

Definition at line 409 of file MainModule.cpp.

◆ _KeyUnitSensorClass

KeyUnitSensorClass* _KeyUnitSensorClass

Definition at line 91 of file MainModule.cpp.

◆ _lastSemanticMarkerDocFollow

char* _lastSemanticMarkerDocFollow = NULL

SemanticMarker events This would see a DOCFollow message, and set the value.. then SM10 can display it..

Definition at line 2485 of file MainModule.cpp.

◆ _longLongPress_MainModule

boolean _longLongPress_MainModule = false

Definition at line 34 of file MainModule.cpp.

◆ _longPress_MainModule

boolean _longPress_MainModule = false

Definition at line 33 of file MainModule.cpp.

◆ _M5Atom_CameraModuleClass

M5Atom_CameraModuleClass* _M5Atom_CameraModuleClass

8.16.25 bring in the CameraModule from 2022 6

Definition at line 55 of file MainModule.cpp.

◆ _M5Atom_Core2ModuleClass

M5Atom_Core2ModuleClass* _M5Atom_Core2ModuleClass

Definition at line 49 of file MainModule.cpp.

◆ _M5Atom_HDriverModuleClass

M5Atom_HDriverModuleClass* _M5Atom_HDriverModuleClass

Definition at line 47 of file MainModule.cpp.

◆ _M5Atom_NoModuleClass

M5Atom_NoModuleClass* _M5Atom_NoModuleClass

10.26.25 Power Out .. Wind Storm. Generator Running add a NoModule class

Definition at line 58 of file MainModule.cpp.

◆ _M5Atom_QRCodeModuleClass

M5Atom_QRCodeModuleClass* _M5Atom_QRCodeModuleClass

Definition at line 45 of file MainModule.cpp.

◆ _M5Atom_SocketModuleClass

M5Atom_SocketModuleClass* _M5Atom_SocketModuleClass

instances of the M5AtomClassType

Definition at line 43 of file MainModule.cpp.

◆ _M5Atom_TinyGPSModuleClass

M5Atom_TinyGPSModuleClass* _M5Atom_TinyGPSModuleClass

7.17.25 - Adding GPS 5

Definition at line 52 of file MainModule.cpp.

◆ _M5AtomClassTypes

M5AtomClassType* _M5AtomClassTypes[NUM_M5ATOM_CLASS]

3.31.25 create array of plugs

Definition at line 66 of file MainModule.cpp.

◆ _messageStorage

char _messageStorage[MESSAGE_STORAGE_MAX]

Definition at line 412 of file MainModule.cpp.

◆ _MQTT_Password

char* _MQTT_Password = (char*)""

12.14.23

Definition at line 1276 of file MainModule.cpp.

◆ _MQTT_Username

char* _MQTT_Username = (char*)""

Definition at line 1277 of file MainModule.cpp.

◆ _OFF_LIGHT

char* _OFF_LIGHT = (char*)"OFF"

Definition at line 1896 of file MainModule.cpp.

◆ _ON_LIGHT

char* _ON_LIGHT = (char*)"ON"

Definition at line 1895 of file MainModule.cpp.

◆ _pinUseStruct

PinUseStruct _pinUseStruct

7.31.25 add this for a status, saw that QRCode was using 22 also .. so buzer didn't work.

#define PIN_USE_MAX 10 struct pinUseStruct { int pinUseCount; ! string describing the module, etc char *pinUseArray[PIN_USE_MAX]; ! each pin long pinNumArray[PIN_USE_MAX]; } _pinUseStruct; global for use. This is an object (not a pointer) and has all the storage created statically

Definition at line 3965 of file MainModule.cpp.

◆ _PIRSensorClass

PIRSensorClass* _PIRSensorClass

Definition at line 93 of file MainModule.cpp.

◆ _saveWhichSMMode

int _saveWhichSMMode = 0

the saved SMMode

Definition at line 3430 of file MainModule.cpp.

◆ _scannedDeviceName

char _scannedDeviceName[100]

Definition at line 1278 of file MainModule.cpp.

◆ _scannedGroupTopicName

char _scannedGroupTopicName[100]

Definition at line 1279 of file MainModule.cpp.

◆ _SensorClassTypes

11.28.25 Clear day, M5 Out create array of instances POSSIBLE (the Sensors, pin1,pin2 – will instantiate them)

Definition at line 99 of file MainModule.cpp.

◆ _serialBuffer

char _serialBuffer[300]

storage for reading from the serial buffer 6.20.25 (Sam Sprague grad Western party)

Definition at line 530 of file MainModule.cpp.

◆ _shortPress_MainModule

boolean _shortPress_MainModule = false

5.6.25 use the M5Atom ClassType

See also
https://www.cs.fsu.edu/~myers/cop3330/notes/dma.html 5.9.25 – Dead 77 7.17.25 - Adding GPS 8.16.25 bring in the CameraModule from 2022 10.26.25 Power Out .. Wind Storm. Generator Running add a NoModule class 7.24.25 Hot Day, Ballon last night, Mt Out for the 'C' option of atom color 10.16.25 add buttons

Definition at line 32 of file MainModule.cpp.

◆ _smMode_MainModule

char _smMode_MainModule[10]

current smMode

Definition at line 416 of file MainModule.cpp.

◆ _stopAllProcessing

boolean _stopAllProcessing = false

testing..

Definition at line 385 of file MainModule.cpp.

◆ _thresholdLUXDark

int _thresholdLUXDark = 80

1.12.24 add a temporary LUX dark threshholdKind = 0 (LIGHT), 1=(DARK) .. others might be 2=super dark

Definition at line 1853 of file MainModule.cpp.

◆ _thresholdLUXLight

int _thresholdLUXLight = 0

Definition at line 1854 of file MainModule.cpp.

◆ _waitingForBigMessageEnd

boolean _waitingForBigMessageEnd = false

store a big message #MSG_START .. #MSG_END

Definition at line 421 of file MainModule.cpp.

◆ _whichM5AtomClassType

M5AtomClassType* _whichM5AtomClassType

use this one...

Definition at line 69 of file MainModule.cpp.