Main Page | Modules | Directories | File List | Globals | Related Pages

Main Routines

Initialization and HTTP connection handling. More...

Defines

#define JUMP_RESET   { asm("cli"); asm("call 0"); }
 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("cli"); asm("call 0"); }
 

CPU reset macro.

Start all over on fatal initialization errors.

Note:
This function currently works on AVR systems only. On other architectures an endless loop will be entered.

Definition at line 160 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 260 of file webport.c.

References CHARON_CONTROL_CGI, CHARON_STATUS_CGI, CharonLedControl(), CharonSwitchStatus(), CpuPortControl(), CpuPortStatus(), HTTP_THREAD_STACK, JUMP_RESET, MYIP, MYMAC, MYMASK, NUM_HTTP_THREADS, OPTO_STATUS_CGI, PORT_CONTROL_CGI, PORT_STATUS_CGI, RELAY_CONTROL_CGI, Service(), ServiceThread(), SpiOptoStatus(), SpiRelayControl(), and WP_STATUSOUT.

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 175 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. It can be started more than once to support parallel connections.

Definition at line 241 of file webport.c.

References Service().

Referenced by main().


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