JXCT Soil Sensor 7-in-1 3.10.1
IoT система мониторинга почвы на базе ESP32
|
Централизованные константы системы JXCT. Подробнее...
#include <Arduino.h>
#include <stddef.h>
#include <stdint.h>
Переменные | |
constexpr unsigned long | DEFAULT_SENSOR_READ_INTERVAL = 5000 |
constexpr unsigned long | DEFAULT_MQTT_PUBLISH_INTERVAL = 30000 |
constexpr unsigned long | DEFAULT_THINGSPEAK_INTERVAL = 60000 |
constexpr unsigned long | DEFAULT_NTP_UPDATE_INTERVAL = 3600000 |
constexpr unsigned long | MODBUS_CACHE_TIMEOUT = 3000 |
constexpr unsigned long | MODBUS_RETRY_DELAY = 500 |
constexpr unsigned long | DNS_CACHE_TTL = 180000 |
constexpr unsigned long | MQTT_RECONNECT_INTERVAL = 3000 |
constexpr unsigned long | SENSOR_JSON_CACHE_TTL = 500 |
constexpr unsigned long | STATUS_PRINT_INTERVAL = 30000 |
constexpr unsigned long | JXCT_WATCHDOG_TIMEOUT_SEC = 30 |
constexpr unsigned long | JXCT_BUTTON_HOLD_TIME_MS = 2000 |
constexpr unsigned long | LED_BLINK_SLOW = 1000 |
constexpr unsigned long | LED_BLINK_NORMAL = 500 |
constexpr unsigned long | LED_BLINK_FAST = 100 |
constexpr int | DEFAULT_WEB_SERVER_PORT = 80 |
constexpr int | DEFAULT_MQTT_PORT = 1883 |
constexpr int | DEFAULT_DNS_PORT = 53 |
constexpr uint8_t | DEFAULT_MODBUS_ADDRESS = 1 |
constexpr size_t | MQTT_BUFFER_SIZE = 512 |
constexpr size_t | JSON_BUFFER_SIZE = 256 |
constexpr size_t | TOPIC_BUFFER_SIZE = 128 |
constexpr size_t | CLIENT_ID_BUFFER_SIZE = 32 |
constexpr size_t | HOSTNAME_BUFFER_SIZE = 64 |
constexpr int | WIFI_CONNECTION_ATTEMPTS = 20 |
constexpr int | MQTT_CONNECTION_ATTEMPTS = 3 |
constexpr unsigned long | WIFI_CONNECTION_TIMEOUT = 10000 |
constexpr unsigned long | MODBUS_BAUD_RATE = 9600 |
constexpr uint8_t | MODBUS_DATA_BITS = 8 |
constexpr uint8_t | MODBUS_STOP_BITS = 1 |
constexpr uint8_t | MODBUS_PARITY = 0 |
constexpr uint8_t | MODBUS_MAX_RETRIES = 3 |
constexpr unsigned long | MODBUS_RESPONSE_TIMEOUT = 2000 |
constexpr unsigned long | MODBUS_FRAME_DELAY = 100 |
constexpr float | SENSOR_TEMP_MIN = -45.0F |
constexpr float | SENSOR_TEMP_MAX = 115.0F |
constexpr float | SENSOR_HUMIDITY_MIN = 0.0F |
constexpr float | SENSOR_HUMIDITY_MAX = 100.0F |
constexpr float | SENSOR_PH_MIN = 3.0F |
constexpr float | SENSOR_PH_MAX = 9.0F |
constexpr uint16_t | SENSOR_EC_MIN = 0 |
constexpr uint16_t | SENSOR_EC_MAX = 10000 |
constexpr uint16_t | SENSOR_NPK_MIN = 0 |
constexpr uint16_t | SENSOR_NPK_MAX = 1999 |
constexpr float | TEMP_MIN_VALID = SENSOR_TEMP_MIN |
constexpr float | TEMP_MAX_VALID = SENSOR_TEMP_MAX |
constexpr float | HUM_MIN_VALID = SENSOR_HUMIDITY_MIN |
constexpr float | HUM_MAX_VALID = SENSOR_HUMIDITY_MAX |
constexpr int | EC_MAX_VALID = SENSOR_EC_MAX |
constexpr int | NPK_MAX_VALID = SENSOR_NPK_MAX |
constexpr unsigned long | CONFIG_INTERVAL_MIN = 1000 |
constexpr unsigned long | CONFIG_INTERVAL_MAX = 3600000 |
constexpr unsigned long | CONFIG_THINGSPEAK_MIN = 15000 |
constexpr unsigned long | CONFIG_THINGSPEAK_MAX = 7200000 |
constexpr int | CONFIG_MQTT_PORT_MIN = 1 |
constexpr int | CONFIG_MQTT_PORT_MAX = 65535 |
constexpr uint8_t | MOVING_AVERAGE_WINDOW_MIN = 1 |
constexpr uint8_t | MOVING_AVERAGE_WINDOW_MAX = 20 |
constexpr uint8_t | MOVING_AVERAGE_WINDOW_DEFAULT = 5 |
constexpr float | DEFAULT_DELTA_TEMPERATURE = 0.5F |
constexpr float | DEFAULT_DELTA_HUMIDITY = 2.0F |
constexpr float | DEFAULT_DELTA_PH = 0.1F |
constexpr float | DEFAULT_DELTA_EC = 50.0F |
constexpr float | DEFAULT_DELTA_NPK = 10.0F |
constexpr uint8_t | DEFAULT_FORCE_PUBLISH_CYCLES = 10 |
constexpr float | EXPONENTIAL_ALPHA_MIN = 0.1F |
constexpr float | EXPONENTIAL_ALPHA_MAX = 0.9F |
constexpr float | EXPONENTIAL_ALPHA_DEFAULT = 0.3F |
constexpr float | OUTLIER_THRESHOLD_MIN = 1.5F |
constexpr float | OUTLIER_THRESHOLD_MAX = 4.0F |
constexpr float | OUTLIER_THRESHOLD_DEFAULT = 2.5F |
constexpr float | KALMAN_PROCESS_NOISE = 0.01F |
constexpr float | KALMAN_MEASUREMENT_NOISE = 0.1F |
constexpr float | KALMAN_INITIAL_UNCERTAINTY = 1.0F |
constexpr float | CALIBRATION_OFFSET_MAX = 10.0F |
constexpr float | CALIBRATION_DRIFT_MAX = 0.1F |
constexpr uint8_t | STATISTICS_WINDOW_SIZE = 20 |
constexpr float | MIN_STANDARD_DEVIATION = 0.01F |
constexpr const char * | JXCT_WIFI_AP_PASS = "12345678" |
constexpr const char * | WIFI_HOSTNAME_PREFIX = "jxct-" |
constexpr const char * | MQTT_TOPIC_STATE = "/state" |
constexpr const char * | MQTT_TOPIC_STATUS = "/status" |
constexpr const char * | MQTT_TOPIC_COMMAND = "/command" |
constexpr const char * | MQTT_TOPIC_AVAILABILITY = "/availability" |
constexpr const char * | HASS_DISCOVERY_PREFIX = "homeassistant/sensor/" |
constexpr const char * | HASS_CONFIG_SUFFIX = "/config" |
constexpr const char * | HTTP_CACHE_CONTROL = "no-cache, no-store, must-revalidate" |
constexpr const char * | HTTP_CONTENT_TYPE_HTML = "text/html; charset=utf-8" |
constexpr const char * | HTTP_CONTENT_TYPE_JSON = "application/json" |
constexpr const char * | HTTP_CONTENT_TYPE_PLAIN = "text/plain" |
constexpr int | RESET_BUTTON_PIN = 0 |
constexpr int | JXCT_STATUS_LED_PIN = 2 |
constexpr int | MODBUS_RX_PIN = 16 |
constexpr int | MODBUS_TX_PIN = 17 |
constexpr int | MODBUS_DE_PIN = 4 |
constexpr int | MODBUS_RE_PIN = 5 |
constexpr size_t | SENSOR_TASK_STACK_SIZE = 4096 |
constexpr size_t | RESET_BUTTON_TASK_STACK_SIZE = 2048 |
constexpr size_t | WEB_SERVER_TASK_STACK_SIZE = 8192 |
constexpr UBaseType_t | SENSOR_TASK_PRIORITY = 2 |
constexpr UBaseType_t | RESET_BUTTON_TASK_PRIORITY = 1 |
constexpr UBaseType_t | WEB_SERVER_TASK_PRIORITY = 1 |
constexpr size_t | MAX_CONFIG_JSON_SIZE = 2048 |
constexpr size_t | MAX_SENSOR_JSON_SIZE = 512 |
constexpr size_t | MAX_LOG_MESSAGE_SIZE = 256 |
constexpr int | LOG_LEVEL_ERROR = 0 |
constexpr int | LOG_LEVEL_WARN = 1 |
constexpr int | LOG_LEVEL_INFO = 2 |
constexpr int | LOG_LEVEL_DEBUG = 3 |
constexpr bool | DEBUG_MODBUS_ENABLED = false |
constexpr bool | DEBUG_MQTT_ENABLED = false |
constexpr bool | DEBUG_WIFI_ENABLED = false |
constexpr int | DEFAULT_SEPARATOR_LENGTH = 60 |
constexpr int | JXCT_REDIRECT_DELAY_MS = 1000 |
constexpr int | HTTP_OK = 200 |
constexpr int | HTTP_FORBIDDEN = 403 |
constexpr int | HTTP_REDIRECT_TEMPORARY = 302 |
constexpr int | HTTP_REDIRECT_PERMANENT = 307 |
constexpr int | HTTP_BAD_REQUEST = 400 |
constexpr int | HTTP_SEE_OTHER = 303 |
constexpr int | JSON_DOC_SMALL = 512 |
constexpr int | JSON_DOC_MEDIUM = 1024 |
constexpr unsigned long | SECONDS_IN_MINUTE = 60 |
constexpr unsigned long | MINUTES_IN_HOUR = 60 |
constexpr unsigned long | HOURS_IN_DAY = 24 |
constexpr unsigned long | MILLISECONDS_IN_SECOND = 1000 |
constexpr int | WEB_OPERATION_DELAY_MS = 2000 |
constexpr const char * | API_VERSION_V1 = "v1" |
constexpr const char * | API_VERSION_CURRENT = API_VERSION_V1 |
constexpr int | CONFIG_VERSION_CURRENT = 1 |
constexpr int | CONFIG_VERSION_MIN_SUPPORTED = 1 |
constexpr size_t | OTA_BUFFER_SIZE = 1024 |
constexpr unsigned long | OTA_TIMEOUT = 300000 |
constexpr const char * | OTA_UPDATE_URL_TEMPLATE = "https://api.github.com/repos/%s/%s/releases/latest" |
constexpr unsigned long | REPORT_CACHE_TTL_MS = 300000 |
constexpr int | JSON_DOC_LARGE = 2048 |
constexpr int | TEST_SUCCESS_RATE_THRESHOLD = 90 |
constexpr int | TESTS_TOTAL_COUNT = 13 |
constexpr int | TESTS_PASSED_COUNT = 13 |
constexpr float | TEST_SUCCESS_RATE_MAX = 100.0F |
constexpr const char * | TEST_TIMESTAMP_EXAMPLE = "2025-01-22T12:00:00Z" |
constexpr int | TECH_DEBT_CODE_SMELLS = 66 |
constexpr int | TECH_DEBT_DUPLICATED_LINES = 933 |
constexpr int | TECH_DEBT_SECURITY_HOTSPOTS = 134 |
constexpr float | TECH_DEBT_DEBT_RATIO = 1.93F |
constexpr float | TECH_DEBT_COVERAGE = 70.8F |
constexpr unsigned long | REPORTS_AUTOREFRESH_INTERVAL_MS = 300000 |
constexpr unsigned long | CONFIG_SENSOR_INTERVAL_MIN_MS = 1000 |
constexpr unsigned long | CONFIG_SENSOR_INTERVAL_MAX_MS = 300000 |
constexpr unsigned long | CONFIG_MQTT_INTERVAL_MIN_MS = 60000 |
constexpr unsigned long | CONFIG_MQTT_INTERVAL_MAX_MS = 3600000 |
constexpr unsigned long | CONFIG_THINGSPEAK_INTERVAL_MIN_MS = 300000 |
constexpr unsigned long | CONFIG_THINGSPEAK_INTERVAL_MAX_MS = 7200000 |
constexpr unsigned long | CONFIG_WEB_INTERVAL_MIN_MS = 1000 |
constexpr unsigned long | CONFIG_WEB_INTERVAL_MAX_MS = 60000 |
constexpr int | CONFIG_SENSOR_INTERVAL_MIN_SEC = 1 |
constexpr int | CONFIG_SENSOR_INTERVAL_MAX_SEC = 300 |
constexpr int | CONFIG_MQTT_INTERVAL_MIN_MIN = 1 |
constexpr int | CONFIG_MQTT_INTERVAL_MAX_MIN = 60 |
constexpr int | CONFIG_THINGSPEAK_INTERVAL_MIN_MIN = 5 |
constexpr int | CONFIG_THINGSPEAK_INTERVAL_MAX_MIN = 120 |
constexpr int | CONFIG_WEB_INTERVAL_MIN_SEC = 1 |
constexpr int | CONFIG_WEB_INTERVAL_MAX_SEC = 60 |
constexpr float | CONFIG_DELTA_HUMIDITY_MIN = 0.5F |
constexpr float | CONFIG_DELTA_HUMIDITY_MAX = 10.0F |
constexpr float | CONFIG_DELTA_PH_MIN = 0.01F |
constexpr float | CONFIG_DELTA_PH_MAX = 1.0F |
constexpr int | CONFIG_DELTA_EC_MIN = 10 |
constexpr int | CONFIG_DELTA_EC_MAX = 500 |
constexpr int | CONFIG_DELTA_NPK_MIN = 1 |
constexpr int | CONFIG_DELTA_NPK_MAX = 50 |
constexpr int | CONFIG_AVG_WINDOW_MIN = 5 |
constexpr int | CONFIG_AVG_WINDOW_MAX = 15 |
constexpr int | CONFIG_FORCE_CYCLES_MIN = 5 |
constexpr int | CONFIG_FORCE_CYCLES_MAX = 50 |
constexpr float | CONFIG_STEP_HUMIDITY = 0.5F |
constexpr float | CONFIG_STEP_PH = 0.01F |
constexpr unsigned long | CONVERSION_SEC_TO_MS = 1000 |
constexpr unsigned long | CONVERSION_MIN_TO_MS = 60000 |
constexpr size_t | CONFIG_JSON_DOC_SIZE = 2048 |
constexpr size_t | CONFIG_JSON_ROOT_SIZE = 1024 |
constexpr size_t | REPORTS_JSON_DOC_SIZE = 1024 |
constexpr size_t | REPORTS_JSON_DOC_LARGE_SIZE = 2048 |
constexpr size_t | OTA_JSON_DOC_SIZE = 256 |
constexpr unsigned long | OTA_PROGRESS_LOG_THRESHOLD = 65536 |
constexpr unsigned long | OTA_DELAY_MS = 2000 |
constexpr unsigned long | OTA_UPDATE_INTERVAL_MS = 1000 |
constexpr int | OTA_STAGE_CONNECTION = 25 |
constexpr int | OTA_STAGE_DOWNLOAD = 50 |
constexpr int | OTA_STAGE_VERIFY = 75 |
constexpr int | OTA_STAGE_FINISH = 90 |
constexpr int | OTA_STAGE_INSTALL = 95 |
constexpr int | OTA_STAGE_CHECK = 30 |
constexpr int | OTA_STAGE_DEFAULT = 25 |
constexpr float | TEST_DATA_TEMP_BASE = 20.0F |
constexpr float | TEST_DATA_HUM_BASE = 60.0F |
constexpr int | TEST_DATA_EC_BASE = 1200 |
constexpr float | TEST_DATA_PH_BASE = 6.3F |
constexpr int | TEST_DATA_NPK_BASE = 800 |
constexpr float | TEST_DATA_HUM_VARIATION = 10.0F |
constexpr int | TEST_DATA_EC_VARIATION = 300 |
constexpr int | TEST_DATA_EC_VARIATION_SMALL = 200 |
constexpr int | TEST_DATA_EC_VARIATION_MIN = 100 |
constexpr float | TEST_DATA_NPK_FACTOR = 6.5F |
constexpr float | TEST_DATA_NPK_INCREASE_N = 1.20F |
constexpr float | TEST_DATA_NPK_INCREASE_P = 1.15F |
constexpr float | TEST_DATA_NPK_INCREASE_K = 1.10F |
constexpr float | TEST_DATA_NPK_DECREASE_N = 0.90F |
constexpr float | TEST_DATA_NPK_DECREASE_P = 1.05F |
constexpr float | TEST_DATA_NPK_DECREASE_K = 1.25F |
constexpr int | HTTP_REDIRECT = 302 |
constexpr int | SUCCESS_RATE_THRESHOLD = 90 |
constexpr unsigned long | NTP_TIMESTAMP_2000 = 946684800 |
constexpr size_t | SENSOR_JSON_DOC_SIZE = 1024 |
Централизованные константы системы JXCT.
Все магические числа и конфигурационные константы в одном месте
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |