mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-09 17:45:39 +00:00
uart tool - http page stub
This commit is contained in:
@ -609,6 +609,39 @@ int http_fn_flash_read_tool(http_request_t *request) {
|
||||
poststr(request,htmlEnd);
|
||||
|
||||
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
}
|
||||
int http_fn_uart_tool(http_request_t *request) {
|
||||
char tmpA[256];
|
||||
|
||||
http_setup(request, httpMimeTypeHTML);
|
||||
poststr(request,htmlHeader);
|
||||
poststr(request,g_header);
|
||||
poststr(request,"<h4>UART Tool</h4>");
|
||||
|
||||
|
||||
if(http_getArg(request->url,"data",tmpA,sizeof(tmpA))) {
|
||||
|
||||
hprintf128(request,"<h3>Sent %s!</h3>",tmpA);
|
||||
} else {
|
||||
strcpy(tmpA,"Hello UART world");
|
||||
}
|
||||
|
||||
poststr(request,"<form action=\"/uart_tool\">");
|
||||
|
||||
poststr(request,"<label for=\"data\">data:</label><br>\
|
||||
<input type=\"text\" id=\"data\" name=\"data\"");
|
||||
hprintf128(request," value=\"%s\" size=\"40\"><br>",tmpA);
|
||||
poststr(request,"<br>\
|
||||
<input type=\"submit\" value=\"Submit\">\
|
||||
</form> ");
|
||||
|
||||
poststr(request,htmlReturnToCfg);
|
||||
HTTP_AddBuildFooter(request);
|
||||
poststr(request,htmlEnd);
|
||||
|
||||
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
}
|
||||
@ -759,6 +792,7 @@ int http_fn_cfg(http_request_t *request) {
|
||||
poststr(request,"<form action=\"ota\"><input type=\"submit\" value=\"OTA (update software by WiFi)\"/></form>");
|
||||
poststr(request,"<form action=\"cmd_single\"><input type=\"submit\" value=\"Execute custom command\"/></form>");
|
||||
poststr(request,"<form action=\"flash_read_tool\"><input type=\"submit\" value=\"Flash Read Tool\"/></form>");
|
||||
poststr(request,"<form action=\"uart_tool\"><input type=\"submit\" value=\"UART Tool\"/></form>");
|
||||
|
||||
#if PLATFORM_BK7231T | PLATFORM_BK7231N
|
||||
k = config_get_tableOffsets(BK_PARTITION_NET_PARAM,&i,&j);
|
||||
|
||||
@ -14,6 +14,7 @@ int http_fn_cfg_loglevel_set(http_request_t *request);
|
||||
int http_fn_cfg_wifi(http_request_t *request);
|
||||
int http_fn_cfg_mac(http_request_t *request);
|
||||
int http_fn_flash_read_tool(http_request_t *request);
|
||||
int http_fn_uart_tool(http_request_t *request);
|
||||
int http_fn_cfg_quick(http_request_t *request);
|
||||
int http_fn_cfg_ha(http_request_t *request);
|
||||
int http_fn_cfg(http_request_t *request);
|
||||
|
||||
@ -510,6 +510,7 @@ int HTTP_ProcessPacket(http_request_t *request) {
|
||||
if(http_checkUrlBase(urlStr,"cfg_mac")) return http_fn_cfg_mac(request);
|
||||
|
||||
if(http_checkUrlBase(urlStr,"flash_read_tool")) return http_fn_flash_read_tool(request);
|
||||
if(http_checkUrlBase(urlStr,"uart_tool")) return http_fn_uart_tool(request);
|
||||
if(http_checkUrlBase(urlStr,"config_dump_table")) return http_fn_config_dump_table(request);
|
||||
|
||||
if(http_checkUrlBase(urlStr,"cfg_quick")) return http_fn_cfg_quick(request);
|
||||
|
||||
Reference in New Issue
Block a user