export block_transaction_t object and it's parse function
This commit is contained in:
parent
83ab4dcba2
commit
25feb4f9fb
|
|
@ -84,6 +84,21 @@ typedef struct
|
|||
void (*HandlerRoutine)(char *VarData, void *arg);
|
||||
} dyn_var_handler_t;
|
||||
|
||||
#define MEM_OBLECT_MAX_LENGTH 32
|
||||
typedef struct
|
||||
{
|
||||
int opertype;
|
||||
int operphase;
|
||||
int part;
|
||||
int parts;
|
||||
int size;
|
||||
char mem_object[MEM_OBLECT_MAX_LENGTH];
|
||||
char filepath[FILE_PATH_MAX];
|
||||
struct stat file_stat;
|
||||
FILE *f;
|
||||
int open_file_timeout;
|
||||
} blockdata_transaction_t;
|
||||
|
||||
esp_err_t start_file_server(void);
|
||||
HTTP_IO_RESULT HTTPPostApp(httpd_req_t *req, const char *filename, char *PostData);
|
||||
int HTTPPrint(httpd_req_t *req, char* buf, char* var);
|
||||
|
|
@ -93,5 +108,7 @@ esp_err_t download_get_handler(httpd_req_t *req);
|
|||
esp_err_t upload_post_handler(httpd_req_t *req);
|
||||
esp_err_t delete_post_handler(httpd_req_t *req);
|
||||
|
||||
esp_err_t ParseBlockDataObject(char *argres, blockdata_transaction_t *ft);
|
||||
void FileBlockHandler(char *argres, int rw);
|
||||
|
||||
#endif /* COMPONENTS_WEB_GUI_APPLICATION_INCLUDE_HTTPSERVER_H_ */
|
||||
|
|
|
|||
|
|
@ -119,6 +119,6 @@ esp_err_t SetConfVar(char* name, char* val, rest_var_types *tp);
|
|||
esp_err_t ServiceDataHandler(data_message_t *MSG);
|
||||
sys_error_code SysVarsPayloadHandler(data_message_t *MSG);
|
||||
void GetSysErrorDetales(sys_error_code err, const char **br, const char **ds);
|
||||
void FileBlockHandler(char *argres, int rw);
|
||||
|
||||
|
||||
#endif /* COMPONENTS_WEBGUIAPP_INCLUDE_SYSTEMAPPLICATION_H_ */
|
||||
|
|
|
|||
|
|
@ -43,27 +43,12 @@
|
|||
#define WRITE_ORERATION 3
|
||||
|
||||
static const char *dirpath = "/data/";
|
||||
#define MEM_OBLECT_MAX_LENGTH 32
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int opertype;
|
||||
int operphase;
|
||||
int part;
|
||||
int parts;
|
||||
int size;
|
||||
char mem_object[MEM_OBLECT_MAX_LENGTH];
|
||||
char filepath[FILE_PATH_MAX];
|
||||
struct stat file_stat;
|
||||
FILE *f;
|
||||
int open_file_timeout;
|
||||
} file_transaction_t;
|
||||
|
||||
static file_transaction_t FileTransaction = {
|
||||
static blockdata_transaction_t FileTransaction = {
|
||||
.opertype = 0
|
||||
};
|
||||
|
||||
static esp_err_t parse_raw_data_object(char *argres, file_transaction_t *ft)
|
||||
esp_err_t ParseBlockDataObject(char *argres, blockdata_transaction_t *ft)
|
||||
{
|
||||
struct jReadElement result;
|
||||
jRead(argres, "", &result);
|
||||
|
|
@ -158,7 +143,7 @@ static esp_err_t parse_raw_data_object(char *argres, file_transaction_t *ft)
|
|||
void FileBlockHandler(char *argres, int rw)
|
||||
{
|
||||
|
||||
if (parse_raw_data_object(argres, &FileTransaction) != ESP_OK)
|
||||
if (ParseBlockDataObject(argres, &FileTransaction) != ESP_OK)
|
||||
return;
|
||||
|
||||
//Phase of file operation calculate
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user