up apihttps
All checks were successful
Build / Build (push) Successful in 8m45s

This commit is contained in:
2024-11-10 04:24:44 +00:00
parent 7925d4de83
commit 558fdc1f09
3 changed files with 16 additions and 13 deletions

View File

@@ -1,9 +1,10 @@
#ifndef __USER_API_H__
#define __USER_API_H__
#include "stdbool.h"
extern unsigned int scantext(char text,unsigned int start,char* data);
extern void gettext(unsigned int start,unsigned int stop,char* data,char* text);
extern void gettext(unsigned int start,unsigned int stop,char*,char*);
extern bool iftext(char* ifdata,char* dataif);
#endif // __USER_API_H__

View File

@@ -3,7 +3,7 @@
#include "user_api.h"
static const char *TAG = "user_api";
// static const char *TAG = "user_api";
unsigned int scantext(char text,unsigned int start,char* data) {
while (data[start] != '\0')

View File

@@ -327,9 +327,9 @@ static void http_get_index_html(struct netconn *conn) {
netconn_write(conn, htmltou5, strlen(htmltou5), NETCONN_NOCOPY);
// httpd_resp_send_chunk(req, NULL, 0);
return ESP_OK;
// return ESP_OK;
}
void httpd_resp_send_chunk_(struct netconn *conn, const char *buf){
err_t httpd_resp_send_chunk_(struct netconn *conn, const char *buf){
return netconn_write(conn, buf, strlen(buf), NETCONN_NOCOPY);
}
static void http_get_rehome(struct netconn *conn) {
@@ -341,7 +341,7 @@ static void http_get_rehome(struct netconn *conn) {
</body>"
httpd_set_type(conn, HTTPD_TYPE_TEXT);
netconn_write(conn, STR, 137, NETCONN_NOCOPY);
return ESP_OK;
// return ESP_OK;
#undef STR
}
static void http_get_wifi(struct netconn *conn) {
@@ -511,7 +511,7 @@ static void http_get_wifi(struct netconn *conn) {
</main></body></html>"
httpd_set_type(conn, HTTPD_TYPE_TEXT);
netconn_write(conn, STR, 6624, NETCONN_NOCOPY);
return ESP_OK;
// return ESP_OK;
#undef STR
}
static void http_post_wifi(struct netconn *conn,char* buf,uint16_t le) {
@@ -519,11 +519,12 @@ static void http_post_wifi(struct netconn *conn,char* buf,uint16_t le) {
// char* buf = malloc(req->content_len + 1);
// size_t off = 0;
int ret;
// int ret;
if (!buf) {
httpd_send_500(conn);
return ESP_FAIL;
return;
// return ESP_FAIL;
}
// while (off < req->content_len) {
@@ -605,7 +606,7 @@ static void http_post_wifi(struct netconn *conn,char* buf,uint16_t le) {
netconn_write(conn, buf, le, NETCONN_NOCOPY);
// free (req_hdr);
// free (buf);
return ESP_OK;
// return ESP_OK;
}
static void http_get_css_css(struct netconn *conn) {
httpd_set_type(conn, "text/css");
@@ -651,7 +652,7 @@ static void http_get_css_css(struct netconn *conn) {
httpd_resp_send_chunk_(conn, "border-right:1px solid #555;border-bottom:1px solid #555;}\r\nbody.invert .q[role=img]{-webkit-filter:invert(1);filter:invert(1);}\r\ninput:disabled {opacity: 0.5;}\r\n");
// httpd_resp_send_chunk(req, NULL, 0);
return ESP_OK;
// return ESP_OK;
}
static void http_get_wifi_config_json(struct netconn *conn) {
// char
@@ -711,7 +712,7 @@ static void http_get_wifi_config_json(struct netconn *conn) {
netconn_write(conn, "]}", strlen("]}"), NETCONN_NOCOPY);
// httpd_resp_send(req, STR, 6616);
// netconn_write(conn, NULL, 0, NETCONN_NOCOPY);
return ESP_OK;
// return ESP_OK;
}
static void http_get_ota(struct netconn *req) {
httpd_set_type(req, HTTPD_TYPE_TEXT);
@@ -747,8 +748,9 @@ static void http_post_ota_rul(struct netconn *req,char* buf,uint16_t le) {
// int ret;
if (!buf) {
httpd_resp_send_500(req);
return ESP_FAIL;
httpd_send_500(req);
return;
// return ESP_FAIL;
}
// while (off < req->content_len) {
// /* Read data received in the request */