| 1234567891011121314151617181920 |
- #ifndef WIFICONFIG_H
- #define WIFICONFIG_H
- #include <WiFiManager.h>
- #include <Preferences.h>
- extern String deviceID;
- extern String serverAddress; // 声明外部变量
- extern uint16_t serverPort; // MQTT 端口号
- extern uint16_t otaPort; // 新增 OTA 端口号
- // WiFi 配置和服务器参数设置
- void loadServerParams();
- void setupWiFiConfig();
- bool connectWiFiWithTimeout(uint32_t timeoutMs);
- // 声明 feedWatchdog 函数
- void feedWatchdog();
- void setConstantOn(bool constantOn); // 设置 LED 常亮或关闭
- void addBlinkTask(int blinkCount); // 添加闪烁任务,接受一个 int 参数
- #endif
|