- 引入了新的全局变量,用于跟踪 Wi-Fi 和 MQTT 连接状态。 - 实现了 Wi-Fi 和 MQTT 连接状态的 getter 和 setter 函数。 - 增加了管理网络信息和时间同步的功能。 - 更新了主应用程序逻辑,以反映 UI 中的当前连接状态。 - 改进了 Wi-Fi 连接处理,以定期发布网络信息。 -土壤湿度和空气温度的综合阈值变量被整合到 UI 中。
61 lines
1.9 KiB
C
61 lines
1.9 KiB
C
#ifndef EEZ_LVGL_UI_VARS_H
|
|
#define EEZ_LVGL_UI_VARS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// enum declarations
|
|
|
|
// Flow global variables
|
|
|
|
enum FlowGlobalVariables {
|
|
FLOW_GLOBAL_VARIABLE_AIR_TEMPERATURE = 0,
|
|
FLOW_GLOBAL_VARIABLE_AIR_HUMIDITY = 1,
|
|
FLOW_GLOBAL_VARIABLE_SOIL_MOISTURE = 2,
|
|
FLOW_GLOBAL_VARIABLE_LIGHT_INTENSITY = 3,
|
|
FLOW_GLOBAL_VARIABLE_WIFI_DISCONNECTED = 4,
|
|
FLOW_GLOBAL_VARIABLE_WIFI_CONNECTED = 5,
|
|
FLOW_GLOBAL_VARIABLE_MQTT_DISCONNECTED = 6,
|
|
FLOW_GLOBAL_VARIABLE_MQTT_CONNECTED = 7,
|
|
FLOW_GLOBAL_VARIABLE_IOT_NET_INFO = 8,
|
|
FLOW_GLOBAL_VARIABLE_SNTP_TIME = 9,
|
|
FLOW_GLOBAL_VARIABLE_AIR_TEMP_NUM = 10,
|
|
FLOW_GLOBAL_VARIABLE_SOIL_MOIS_NUM = 11
|
|
};
|
|
|
|
// Native global variables
|
|
|
|
extern const char *get_var_air_temperature();
|
|
extern void set_var_air_temperature(const char *value);
|
|
extern const char *get_var_air_humidity();
|
|
extern void set_var_air_humidity(const char *value);
|
|
extern const char *get_var_soil_moisture();
|
|
extern void set_var_soil_moisture(const char *value);
|
|
extern const char *get_var_light_intensity();
|
|
extern void set_var_light_intensity(const char *value);
|
|
extern bool get_var_wifi_disconnected();
|
|
extern void set_var_wifi_disconnected(bool value);
|
|
extern bool get_var_wifi_connected();
|
|
extern void set_var_wifi_connected(bool value);
|
|
extern bool get_var_mqtt_disconnected();
|
|
extern void set_var_mqtt_disconnected(bool value);
|
|
extern bool get_var_mqtt_connected();
|
|
extern void set_var_mqtt_connected(bool value);
|
|
extern const char *get_var_iot_net_info();
|
|
extern void set_var_iot_net_info(const char *value);
|
|
extern const char *get_var_sntp_time();
|
|
extern void set_var_sntp_time(const char *value);
|
|
extern const char *get_var_air_temp_num();
|
|
extern void set_var_air_temp_num(const char *value);
|
|
extern const char *get_var_soil_mois_num();
|
|
extern void set_var_soil_mois_num(const char *value);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /*EEZ_LVGL_UI_VARS_H*/ |