2021-08-20 05:24 AM
I am working on lwip, tcp/ip, RTOS application with stm32f746 discovery board . By clicking a button on the server with html page, i can toggle a LED on the board with the help of the code below:
if (recv_err == ERR_OK)
{
if (netconn_err(conn) == ERR_OK)
{
netbuf_data(inbuf, (void**)&buf, &buflen);
if ((buflen >=5) && (strncmp(buf, "GET /", 5) == 0))
{
if (strncmp((char const *)buf,"GET /setled", 11) == 0) //setled is the name of the class
{
HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); // led on the board
}
}
The problem is that, how do i get the text i wrote in an html page into the mcu?
For example i have an input box, i write in :50, how can i get that if the number is 50 do this if 150 do another etc.
Thank you 🙂
2021-08-20 05:27 PM
>how do i get the text i wrote in an html page into the mcu?
There should be some button on the page. User clicks it and it sends a POST request to the server.
Or something more modern, like a websocket...
2021-08-20 08:05 PM
LwIP has typically used FSDATA to represent the files served up, basically taking files and creating C arrays and related structures which can subsequently be compiled and linked.
2021-08-22 02:36 AM
See also this and other videos (https://www.youtube.com/watch?v=yqTMGnk1nDU&t=1s) which is exactly what you're doing.