#ifndef AMPEL_WEB_CONFIG_H_ #define AMPEL_WEB_CONFIG_H_ #if defined(ESP8266) # include #elif defined(ESP32) # include #endif namespace config { void save(); // Save config to EEPROM char* ampel_name(); // WiFi char* selected_ssid(); char* ampel_password(); // For Access Point, and for HTML page extern bool &is_wifi_on; // [true / false] extern uint16_t &wifi_timeout; // [s] // Sensor extern uint16_t &measurement_timestep; // [s] Value between 2 and 1800 (range for SCD30 sensor). extern uint16_t &altitude_above_sea_level; // [m] extern uint16_t &co2_calibration_level; // [ppm] extern bool &auto_calibrate_sensor; // [true / false] extern float &temperature_offset; // [K] Sign isn't relevant. // LED extern uint8_t &max_brightness; extern uint8_t &min_brightness; extern uint16_t &led_count; // Time server extern char *ntp_server; extern int16_t &time_zone; // [h] extern bool &daylight_saving_time; // [true / false] //CSV bool is_csv_active(); // [true / false] extern uint16_t &csv_interval; // [s] // MQTT bool is_mqtt_active(); // [true / false] extern char *mqtt_server; extern char *mqtt_user; extern char *mqtt_password; extern char *mqtt_topic_prefix; extern uint16_t &mqtt_port; extern uint16_t &mqtt_sending_interval; // [s] extern bool &mqtt_encryption; // [true / false] extern bool &allow_mqtt_commands; // [true / false] // HTTP const char http_user[] = "admin"; // "admin" by default // LORAWAN #if defined(ESP32) bool is_lorawan_active(); // also defined for ESP8266, and set to false extern uint16_t &lorawan_sending_interval; extern char *lorawan_device_eui; extern char *lorawan_app_key; extern char *lorawan_app_eui; #endif // Transmission rate constexpr uint32_t bauds = 115200; } namespace web_config { void initialize(); void setWifiConnectionCallback(void (*success_function)()); void setWifiFailCallback(void (*fail_function)()); void update(); #if defined(ESP8266) extern ESP8266WebServer http; #elif defined(ESP32) extern WebServer http; #endif } #endif