Main Page | Modules | File List | Related Pages

Main Routines

Initialization and HTTP connection handling. More...

Defines

#define JUMP_RESET   asm volatile("cli\n\tcall 0\n\t" ::)
 CPU reset macro.


Functions

void Service (void)
 Process a single HTTP request.

 ServiceThread (void *arg)
 Background thread to process HTTP requests.

int main (void)
 Main entry of our application.


Detailed Description

Initialization and HTTP connection handling.

The C main routine is hidden inside the Nut/OS library to perform some initialization tasks before starting the application code by calling NutMain().


Define Documentation

#define JUMP_RESET   asm volatile("cli\n\tcall 0\n\t" ::)
 

CPU reset macro.

Start all over on fatal initialization errors.

Definition at line 88 of file webport.c.

Referenced by main().


Function Documentation

int main void   ) 
 

Main entry of our application.

Nut/OS automatically calls this entry after initialization.

This routine will do all required initialization, start some background threads and then process incoming HTTP requests together with the concurrently running background threads.

Definition at line 170 of file webport.c.

References CpuPortControl(), CpuPortStatus(), HTTP_THREAD_STACK, JUMP_RESET, NUM_HTTP_THREADS, OPTO_STATUS_CGI, PORT_CONTROL_CGI, PORT_STATUS_CGI, RELAY_CONTROL_CGI, Service(), ServiceThread(), SpiOptoStatus(), and SpiRelayControl().

void Service void   ) 
 

Process a single HTTP request.

This routine performs the whole cycle of a HTTP request.

  • Creating a socket.
  • Listening on the defined port.
  • Processing the request.
  • Closing the socket.

Definition at line 100 of file webport.c.

References HTTP_PORT, and LOW_MEM_MARK.

Referenced by main(), and ServiceThread().

ServiceThread void *  arg  ) 
 

Background thread to process HTTP requests.

This thread calls Service() in an endless loop.

Definition at line 152 of file webport.c.

References Service().

Referenced by main().


© 2002-2004 by egnite Software GmbH - visit http://www.ethernut.de/