01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CGI Examples Available - <strong>SC12</strong> <strong>@CHIP</strong>-<strong>RTOS</strong> <strong>V1.10</strong><br />

<strong>IPC<strong>@CHIP</strong></strong> <strong>Documentation</strong> Index CGI News<br />

CGI Examples<br />

Available CGI API examples in C:<br />

1. minicgi.c - Builds an HTML page<br />

2. countcgi.c - Builds a dynamic HTML page<br />

3. dk40cgi.c - Reads DK40 I/O pins<br />

4. dk40_set.c - Reads and writes DK40 I/O pins<br />

5. secure.c - Example of password protected page<br />

6. submit.c - Building of formular<br />

7. submit2.c - Formulars with multiple items<br />

Also there are source files (cgiapi.c, cgiapi.h) containing wrapper functions which provide a C-Library interface to<br />

the assembly language/software interrupt based CGI API.<br />

Available Turbo Pascal examples:<br />

1. cgimini.pas - Builds an HTML page<br />

2. countcgi.pas - Builds a dynamic HTML page<br />

Examples in C<br />

For understanding CGI in the <strong>IPC<strong>@CHIP</strong></strong> we provide some example programs written in C. The examples are<br />

compiled with various versions of Borland and Microsoft compilers. Which compiler version was used for a<br />

particular example is stated within the example's source files. The include file cgi.h contains all the required<br />

type definitions and constants.<br />

1. minicgi.exe<br />

The CGI function installed by this program produces a HTML page which contains some of the browser's<br />

request parameters. This program was tested and compiled with Borland C 3.0 and Microsoft Visual C<br />

1.52 The compiler differences are described in the source files.<br />

Examples browser inputs:<br />

http://192.168.205.4/minicgi<br />

http://192.168.205.4/minicgi?Argument<br />

2. countcgi.exe<br />

We build a dynamic HTML page which contains the current value of a counter incremented in the main<br />

loop of the program. This program is tested and compiled with Borland C 3.0 and Microsoft Visual C<br />

1.52. The compilers differences are described in the source files.<br />

Example browser input:<br />

http://192.168.205.4/countcgi<br />

Page 375 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!