具体看你干什么。at_exe_cmd() 头文件有注释,根据注释搞一下就行。
我在app_main里用at_self_cmd_get_mode返回的是0,是什么原因?
是在app_main里用at_self_cmd_write_data等函数操作吗?
#include "nvs_flash.h"
#include "esp_event.h"
#include "esp_err.h"
#include "esp_at.h"
#include "esp_at_init.h"
#include "esp_at_self_cmd.h"
void app_main(void)
{
esp_at_main_preprocess();
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_at_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_at_init();
bool y = at_self_cmd_get_mode();
if (y) {
printf("AT: self cmd is enabled\r\n");
} else {
printf("AT: self cmd is disabled\r\n");
}
}