mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-19 05:58:21 +03:00
rolling
This commit is contained in:
@@ -121,7 +121,7 @@ static esp_err_t http_resp_dir_html(httpd_req_t *req, const char *dirpath, const
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
if (!readonly) {
|
||||
FILE *fd = fopen("/sdcard/html/upload_script.html", "r");
|
||||
FILE *fd = OpenFileAndWait("/sdcard/html/upload_script.html", "r");
|
||||
char *chunk = ((struct file_server_data *)req->user_ctx)->scratch;
|
||||
size_t chunksize;
|
||||
do {
|
||||
@@ -231,7 +231,7 @@ static esp_err_t logfileact_get_handler(httpd_req_t *req)
|
||||
std::string currentfilename = LogFile.GetCurrentFileName();
|
||||
|
||||
|
||||
fd = fopen(currentfilename.c_str(), "r");
|
||||
fd = OpenFileAndWait(currentfilename.c_str(), "r");
|
||||
if (!fd) {
|
||||
ESP_LOGE(TAG, "Failed to read existing file : %s", filepath);
|
||||
/* Respond with 500 Internal Server Error */
|
||||
@@ -337,7 +337,7 @@ static esp_err_t download_get_handler(httpd_req_t *req)
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
fd = fopen(filepath, "r");
|
||||
fd = OpenFileAndWait(filepath, "r");
|
||||
if (!fd) {
|
||||
ESP_LOGE(TAG, "Failed to read existing file : %s", filepath);
|
||||
/* Respond with 500 Internal Server Error */
|
||||
@@ -424,7 +424,7 @@ static esp_err_t upload_post_handler(httpd_req_t *req)
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
fd = fopen(filepath, "w");
|
||||
fd = OpenFileAndWait(filepath, "w");
|
||||
if (!fd) {
|
||||
ESP_LOGE(TAG, "Failed to create file : %s", filepath);
|
||||
/* Respond with 500 Internal Server Error */
|
||||
@@ -710,7 +710,7 @@ void unzip(std::string _in_zip_file, std::string _target_directory){
|
||||
zw = std::string(archive_filename);
|
||||
zw = _target_directory + zw;
|
||||
printf("Filename to extract: %s", zw.c_str());
|
||||
FILE* fpTargetFile = fopen(zw.c_str(), "wb");
|
||||
FILE* fpTargetFile = OpenFileAndWait(zw.c_str(), "wb");
|
||||
fwrite(p, 1, (uint)uncomp_size, fpTargetFile);
|
||||
fclose(fpTargetFile);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#include "Helper.h"
|
||||
|
||||
#include "esp_http_server.h"
|
||||
|
||||
|
||||
@@ -25,7 +27,7 @@ char scratch[SCRATCH_BUFSIZE];
|
||||
|
||||
esp_err_t send_file(httpd_req_t *req, std::string filename, struct stat * file_stat)
|
||||
{
|
||||
FILE *fd = fopen(filename.c_str(), "r");
|
||||
FILE *fd = OpenFileAndWait(filename.c_str(), "r");
|
||||
if (!fd) {
|
||||
ESP_LOGE(TAG, "Failed to read existing file : %s", filename.c_str());
|
||||
/* Respond with 500 Internal Server Error */
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
#include "ClassLogFile.h"
|
||||
|
||||
#include "Helper.h"
|
||||
|
||||
|
||||
|
||||
#define BUFFSIZE 1024
|
||||
@@ -89,7 +91,7 @@ static bool ota_example_task(std::string fn)
|
||||
|
||||
int data_read;
|
||||
|
||||
FILE* f = fopen(fn.c_str(), "rb"); // vorher nur "r"
|
||||
FILE* f = OpenFileAndWait(fn.c_str(), "rb"); // vorher nur "r"
|
||||
data_read = fread(ota_write_data, 1, BUFFSIZE, f);
|
||||
|
||||
while (data_read > 0) {
|
||||
|
||||
Reference in New Issue
Block a user