diff --git a/include/SystemApplication.h b/include/SystemApplication.h index 54af10f..41e64ce 100644 --- a/include/SystemApplication.h +++ b/include/SystemApplication.h @@ -28,6 +28,8 @@ #include "jRead.h" #include "jWrite.h" +#define REAST_API_DEBUG_MODE 1 + #define EXPECTED_MAX_DATA_RESPONSE_SIZE (4096) #define VAR_MAX_NAME_LENGTH 32 #define VAR_MAX_VALUE_LENGTH 128 diff --git a/src/RestApiHandler.c b/src/RestApiHandler.c index a043ace..bd79dc7 100644 --- a/src/RestApiHandler.c +++ b/src/RestApiHandler.c @@ -340,7 +340,7 @@ esp_err_t GetConfVar(char *name, char *val, rest_var_types *tp) esp_ip4addr_ntoa((const esp_ip4_addr_t*) V->ref, val, 16); break; case VAR_FUNCT: - ((void (*)(char*, int)) (V->ref))(val, 0); + ((void (*)(char*, int)) (V->ref))(val, 1); break; case VAR_ERROR: break; diff --git a/src/SysComm.c b/src/SysComm.c index f1c437c..2bc4c73 100644 --- a/src/SysComm.c +++ b/src/SysComm.c @@ -155,9 +155,9 @@ static sys_error_code SysPayloadTypeVarsHandler(data_message_t *MSG) strcat(expr, "'"); jRead_string(MSG->inputDataBuffer, expr, VarValue, VAR_MAX_VALUE_LENGTH, &i); - +#if REAST_API_DEBUG_MODE ESP_LOGI(TAG, "Got write variable %s:%s", VarName, VarValue); - +#endif esp_err_t res = ESP_ERR_INVALID_ARG; rest_var_types tp = VAR_ERROR; if (MSG->parsedData.msgType == DATA_MESSAGE_TYPE_COMMAND) @@ -201,7 +201,9 @@ static sys_error_code SysPayloadTypeVarsHandler(data_message_t *MSG) unsigned char sha_print[32 * 2 + 1]; BytesToStr(MSG->parsedData.sha256, sha_print, 32); sha_print[32 * 2] = 0x00; +#if REAST_API_DEBUG_MODE ESP_LOGI(TAG, "SHA256 of DATA object is %s", sha_print); +#endif jwObj_string("signature", (char*) sha_print); } else @@ -257,7 +259,9 @@ static sys_error_code SysDataParser(data_message_t *MSG) unsigned char sha_print[32 * 2 + 1]; BytesToStr(MSG->parsedData.sha256, sha_print, 32); sha_print[32 * 2] = 0x00; +#if REAST_API_DEBUG_MODE ESP_LOGI(TAG, "SHA256 of DATA object is %s", sha_print); +#endif free(hashbuf); } else diff --git a/src/WiFiTransport.c b/src/WiFiTransport.c index 7706b9b..5c5d390 100644 --- a/src/WiFiTransport.c +++ b/src/WiFiTransport.c @@ -597,6 +597,7 @@ static void wifi_scan(void *arg) { uint16_t number = DEFAULT_SCAN_LIST_SIZE; uint16_t ap_count = 0; + vTaskDelay(pdMS_TO_TICKS(2000)); //delay for command result get before network break memset(ap_info, 0, sizeof(ap_info)); while (esp_wifi_scan_start(NULL, true) == ESP_ERR_WIFI_STATE) {