Hi,
I’m trying to find information regarding interface between HTTP server and c.
I was searching source code for CGI, but did not find anything.
Is there any example or documenation?
I need to read data (string, numeric) from form and put results back.
I googled internet for AJAX and FreeRTOS and did not find anything usable.
There is simple example that shows dynamic change of page from local file, which is nice, but how to exchange data with run-time, not via files?
The HTTP server as it is currently, doesn’t have any hooks yet to pass data to the application. But it would certainly be very useful.
The approach that I like is using JQuery, which is a library “on top of” JS and AJAX. The JQuery application in the browser will send requests to the embedded application in a form like this:
/request?temperature=?
/request?temperature=23.5
Or using JSON expressions:
/request?add={"colour":"red","weight":1200}
When loading pages, the browser sends GET commands. The above requests will also be sent as a GET. The difference is the question mark: if it is present the HTTP driver will no even attempt to search for a directory or file named “/request”. In stead the string will be forwarded
" In stead the string will be forwarded" to … ?
I played a little bit with AJAX and lhttpd on Linux, it can pass strings (via CGI) to python script.
What would be equivalent in FreeRTOS httpd?
Above is simple request, it starts python script and sends DIR command via python to the target. It is not ajax - I didn’t managed to access form field from ajax - I’ll finish ajax example in few days.
When do you think xHTTPApplicationHook will be available?
Still on holiday, but I restart on the first of August. If you write me an email ( h point tibosch on freertos point org ), we’ll make a setup for this and test it.