WiFiConfig.h 638 B

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