|
@@ -32,7 +32,7 @@ pthread_t thread_console;
|
|
static void * console_thread();
|
|
static void * console_thread();
|
|
void console_start();
|
|
void console_start();
|
|
static const char * TAG = "console";
|
|
static const char * TAG = "console";
|
|
-
|
|
|
|
|
|
+extern bool bypass_wifi_manager;
|
|
|
|
|
|
|
|
|
|
/* Prompt to be printed before each line.
|
|
/* Prompt to be printed before each line.
|
|
@@ -56,6 +56,12 @@ void process_autoexec(){
|
|
uint8_t autoexec_flag=0;
|
|
uint8_t autoexec_flag=0;
|
|
|
|
|
|
char * str_flag = get_nvs_value_alloc(NVS_TYPE_STR, "autoexec");
|
|
char * str_flag = get_nvs_value_alloc(NVS_TYPE_STR, "autoexec");
|
|
|
|
+ if(!bypass_wifi_manager){
|
|
|
|
+ ESP_LOGW(TAG, "Procesing autoexec commands while wifi_manager active. Wifi related commands will be ignored.");
|
|
|
|
+ }
|
|
|
|
+#if RECOVERY_APPLICATION
|
|
|
|
+ ESP_LOGD(TAG, "Processing autoexec commands in recovery mode. Squeezelite commands will be ignored.")
|
|
|
|
+#endif
|
|
|
|
|
|
if(str_flag !=NULL ){
|
|
if(str_flag !=NULL ){
|
|
autoexec_flag=atoi(str_flag);
|
|
autoexec_flag=atoi(str_flag);
|
|
@@ -66,8 +72,18 @@ void process_autoexec(){
|
|
ESP_LOGD(TAG,"Getting command name %s", autoexec_name);
|
|
ESP_LOGD(TAG,"Getting command name %s", autoexec_name);
|
|
autoexec_value= get_nvs_value_alloc(NVS_TYPE_STR, autoexec_name);
|
|
autoexec_value= get_nvs_value_alloc(NVS_TYPE_STR, autoexec_name);
|
|
if(autoexec_value!=NULL ){
|
|
if(autoexec_value!=NULL ){
|
|
- ESP_LOGI(TAG,"Running command %s = %s", autoexec_name, autoexec_value);
|
|
|
|
- run_command(autoexec_value);
|
|
|
|
|
|
+ if(!bypass_wifi_manager && strstr(autoexec_value, "join ")!=NULL ){
|
|
|
|
+ ESP_LOGW(TAG,"Ignoring wifi join command.");
|
|
|
|
+ }
|
|
|
|
+#if RECOVERY_APPLICATION
|
|
|
|
+ else if(!strstr(autoexec_value, "squeezelite " ) ){
|
|
|
|
+ ESP_LOGW(TAG,"Ignoring command. ");
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+ else {
|
|
|
|
+ ESP_LOGI(TAG,"Running command %s = %s", autoexec_name, autoexec_value);
|
|
|
|
+ run_command(autoexec_value);
|
|
|
|
+ }
|
|
ESP_LOGD(TAG,"Freeing memory for command %s name", autoexec_name);
|
|
ESP_LOGD(TAG,"Freeing memory for command %s name", autoexec_name);
|
|
free(autoexec_value);
|
|
free(autoexec_value);
|
|
}
|
|
}
|