uart tool - http page stub

This commit is contained in:
openshwprojects
2022-03-03 01:14:52 +01:00
parent 45ca733244
commit b60e6fc138
3 changed files with 36 additions and 0 deletions

View File

@ -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);