You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
878 B
32 lines
878 B
#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 "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);
|