#Relay HTTP parameters to a serial port

<i>written by the John Crispin</i>

The following example explains how a CGI written in C can be used to relay HTTP parameters to a serial port. 

When calling the CGI, you are presented with 2 forms, that can be used to send ascii or hex data to the serial port. 
Once data was sent, the code will sleep for 1 second and then see if an answer was received. 

This example can be tested together with the example given in @h1='35'. 

The code should be self explainatory and it should be easy to modify it for your needs. 
Simply copy the compiled executable to the cgi folder and browse to it.

@source='./main.c'

##Dowload

<ul>
<li><a href="./main.c">main.c</a>
<li><a href="./lib_tty.c">lib_tty.c</a>
<li><a href="./lib_tty.h">lib_tty.h</a>
<li><a href="./Makefile">Makefile</a>
</ul>
