![]() |
LightHub
v4.0.0
Smarthome controller firmware
|
#include "main.h"#include "statusled.h"#include "flashstream.h"#include "config.h"#include <Dhcp.h>Macros | |
| #define | ESP_EEPROM_SIZE 4096-10 |
Enumerations | |
| enum | heaterMode { HEATER_HEAT, HEATER_OFF, HEATER_ERROR } |
Functions | |
| PubSubClient | mqttClient (ethClient) |
| void | cleanConf () |
| bool | isNotRetainingStatus () |
| uint16_t | httpHandler (Client &client, String request, uint8_t method, long contentLength, bool authorized, String &response) |
| int | inTopic (char *topic, topicType tt) |
| void | mqttCallback (char *topic, byte *payload, unsigned int length) |
| void | printMACAddress () |
| char * | getStringFromConfig (aJsonObject *a, int i) |
| char * | getStringFromConfig (aJsonObject *a, char *name) |
| void | setupOTA (void) |
| void | setupSyslog () |
| lan_status | lanLoop () |
| void | onMQTTConnect () |
| void | ip_ready_config_loaded_connecting_to_broker () |
| void | onInitialStateInitLAN () |
| void | resetHard () |
| void | Changed (int i, DeviceAddress addr, float currentTemp) |
| int | cmdFunctionHelp (int arg_cnt, char **args) |
| void | printCurentLanConfig () |
| int | cmdFunctionKill (int arg_cnt, char **args) |
| int | cmdFunctionReboot (int arg_cnt, char **args) |
| void | applyConfig () |
| void | printConfigSummary () |
| int | cmdFunctionLoad (int arg_cnt, char **args) |
| int | loadConfigFromEEPROM () |
| int | cmdFunctionSave (int arg_cnt, char **args) |
| int | cmdFunctionLoglevel (int arg_cnt, char **args) |
| int | cmdFunctionIp (int arg_cnt, char **args) |
| int | cmdFunctionClearEEPROM (int arg_cnt, char **args) |
| int | cmdFunctionPwd (int arg_cnt, char **args) |
| int | cmdFunctionOTAPwd (int arg_cnt, char **args) |
| int | cmdFunctionSetMac (int arg_cnt, char **args) |
| int | cmdFunctionGet (int arg_cnt, char **args) |
| void | printBool (bool arg) |
| void | headerHandlerProc (String header) |
| int | loadConfigFromHttp () |
| void | preTransmission () |
| void | postTransmission () |
| void | TimerHandler (void) |
| void | setup_main () |
| void | printFirmwareVersionAndBuildOptions () |
| void | publishStat () |
| void | setupMacAddress () |
| void | setupCmdArduino () |
| void | loop_main () |
| void | owIdle (void) |
| void | ethernetIdle (void) |
| void | modbusIdle (void) |
| void | inputLoop (short cause) |
| void | inputSetup (void) |
| void | pollingLoop (void) |
| void | thermoRelay (int pin, heaterMode on) |
| void | thermoLoop (void) |
Variables | |
| Streamlog debugSerial & | debugSerialPort |
| flashStream | sysConfStream |
| long | timer0_overflow_count |
| EthernetClient | ethClient |
| StatusLED | statusLED (ledRED) |
| lan_status | lanStatus = INITIAL_STATE |
| const char configserver[] | PROGMEM = CONFIG_SERVER |
| char * | deviceName = NULL |
| aJsonObject * | topics = NULL |
| aJsonObject * | root = NULL |
| aJsonObject * | items = NULL |
| aJsonObject * | inputs = NULL |
| aJsonObject * | mqttArr = NULL |
| aJsonObject * | modbusObj = NULL |
| aJsonObject * | owArr = NULL |
| aJsonObject * | dmxArr = NULL |
| volatile uint32_t | timerPollingCheck = 0 |
| volatile uint32_t | timerInputCheck = 0 |
| volatile uint32_t | timerLanCheckTime = 0 |
| volatile uint32_t | timerThermostatCheck = 0 |
| volatile uint32_t | timerSensorCheck =0 |
| volatile unsigned long | timerCount =0 |
| volatile int16_t | timerNumber =-1 |
| volatile int8_t | timerHandlerBusy =0 |
| aJsonObject * | pollingItem = NULL |
| bool | owReady = false |
| bool | configOk = false |
| bool | configLoaded = false |
| bool | initializedListeners = false |
| volatile int8_t | ethernetIdleCount =0 |
| volatile int8_t | configLocked = 0 |
| ModbusMaster | node |
| bool | wifiInitialized |
| int8_t | mqttErrorRate =0 |
| const char * | headerKeys [] ={"ETag"} |
| volatile int8_t | inputLoopBusy = 0 |
| #define ESP_EEPROM_SIZE 4096-10 |
| enum heaterMode |
| void applyConfig | ( | ) |
| void Changed | ( | int | i, |
| DeviceAddress | addr, | ||
| float | currentTemp | ||
| ) |
| void cleanConf | ( | ) |
| int cmdFunctionClearEEPROM | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionGet | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionHelp | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionIp | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionKill | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionLoad | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionLoglevel | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionOTAPwd | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionPwd | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionReboot | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionSave | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| int cmdFunctionSetMac | ( | int | arg_cnt, |
| char ** | args | ||
| ) |
| void ethernetIdle | ( | void | ) |
| char* getStringFromConfig | ( | aJsonObject * | a, |
| char * | name | ||
| ) |
| char* getStringFromConfig | ( | aJsonObject * | a, |
| int | i | ||
| ) |
| void headerHandlerProc | ( | String | header | ) |
| uint16_t httpHandler | ( | Client & | client, |
| String | request, | ||
| uint8_t | method, | ||
| long | contentLength, | ||
| bool | authorized, | ||
| String & | response | ||
| ) |
| void inputLoop | ( | short | cause | ) |
| void inputSetup | ( | void | ) |
| int inTopic | ( | char * | topic, |
| topicType | tt | ||
| ) |
| void ip_ready_config_loaded_connecting_to_broker | ( | ) |
| bool isNotRetainingStatus | ( | ) |
| lan_status lanLoop | ( | ) |
| int loadConfigFromEEPROM | ( | ) |
| int loadConfigFromHttp | ( | ) |
| void loop_main | ( | ) |
| void modbusIdle | ( | void | ) |
| void mqttCallback | ( | char * | topic, |
| byte * | payload, | ||
| unsigned int | length | ||
| ) |
| PubSubClient mqttClient | ( | ethClient | ) |
| void onInitialStateInitLAN | ( | ) |
| void onMQTTConnect | ( | ) |
strncat(buf,item->name,sizeof(buf)); strncat(buf,",",sizeof(buf));
mqttClient.publish(topic,buf,true);
| void owIdle | ( | void | ) |
| void pollingLoop | ( | void | ) |
| void postTransmission | ( | ) |
| void preTransmission | ( | ) |
| void printBool | ( | bool | arg | ) |
| void printConfigSummary | ( | ) |
| void printCurentLanConfig | ( | ) |
| void printFirmwareVersionAndBuildOptions | ( | ) |
| void printMACAddress | ( | ) |
| void publishStat | ( | ) |
| void resetHard | ( | ) |
| void setup_main | ( | ) |
| void setupCmdArduino | ( | ) |
| void setupMacAddress | ( | ) |
| void setupOTA | ( | void | ) |
| void setupSyslog | ( | ) |
| void thermoLoop | ( | void | ) |
| void thermoRelay | ( | int | pin, |
| heaterMode | on | ||
| ) |
| void TimerHandler | ( | void | ) |
| bool configLoaded = false |
| volatile int8_t configLocked = 0 |
| bool configOk = false |
| Streamlog infoSerial& debugSerialPort |
| char* deviceName = NULL |
| aJsonObject* dmxArr = NULL |
| EthernetClient ethClient |
| volatile int8_t ethernetIdleCount =0 |
| const char* headerKeys[] ={"ETag"} |
| bool initializedListeners = false |
| volatile int8_t inputLoopBusy = 0 |
| aJsonObject* inputs = NULL |
| aJsonObject* items = NULL |
| lan_status lanStatus = INITIAL_STATE |
| aJsonObject* modbusObj = NULL |
| aJsonObject* mqttArr = NULL |
| int8_t mqttErrorRate =0 |
| ModbusMaster node |
| aJsonObject* owArr = NULL |
| bool owReady = false |
| aJsonObject* pollingItem = NULL |
| const char verval_P [] PROGMEM = CONFIG_SERVER |
| aJsonObject* root = NULL |
| systemConfig sysConf & sysConfStream |
|
extern |
| volatile unsigned long timerCount =0 |
| volatile int8_t timerHandlerBusy =0 |
| volatile uint32_t timerInputCheck = 0 |
| volatile uint32_t timerLanCheckTime = 0 |
| volatile int16_t timerNumber =-1 |
| volatile uint32_t timerPollingCheck = 0 |
| volatile uint32_t timerSensorCheck =0 |
| volatile uint32_t timerThermostatCheck = 0 |
| aJsonObject* topics = NULL |
| bool wifiInitialized |