| 1234567891011121314151617181920212223242526272829303132 |
- #include <freertos/FreeRTOS.h>
- #include <freertos/timers.h>
- #include <freertos/task.h>
- #include <esp_log.h>
- #include "board.h"
- #include "boards/common/wifi_board.h"
- #include "boards/esp32-s3-touch-amoled-1.8/config.h"
- #include "iot/thing.h"
- #define TAG "BoardControl"
- namespace iot {
- class BoardControl : public Thing {
- public:
- BoardControl() : Thing("BoardControl", "当前 AI 机器人管理和控制") {
- // 修改重新配网
- methods_.AddMethod("ResetWifiConfiguration", "重新配网", ParameterList(),
- [this](const ParameterList& parameters) {
- ESP_LOGI(TAG, "ResetWifiConfiguration");
- auto board = static_cast<WifiBoard*>(&Board::GetInstance());
- if (board && board->GetBoardType() == "wifi") {
- board->ResetWifiConfiguration();
- }
- });
- }
- };
- } // namespace iot
- DECLARE_THING(BoardControl);
|