Specifications
Getting Started 35
Program Description
This program begins to show the range of applications for an Ethernet-enabled embedded
system controller, so let’s look closely at its operation.
As with PingLED.c, several network addresses must be defined before this application
can work. The most important is again MY_IP_ADDRESS, which defines the RCM2100
system’s IP address. The netmask value should be set if the default of 255.255.255.0 is not
correct.
If you are using the system on a local network and will not be trying to access it from out-
side that network, the MY_GATEWAY value does not matter. If you want to be able to reach
the system from outside the local network, you must specify a valid gateway address.
Generally, the other defined values may be left at their default settings. If you are operat-
ing the system behind a firewall or proxy and need to specify a host port for redirection,
you should comment out the line reading:
#define REDIRECTHOST MY_IP_ADDRESS
Then uncomment the next line, which defines a specific redirection host and port:
#define REDIRECTHOST "my host.com:8080"
Be sure to enter the host port where indicated by "my host.com:8080"
.
This application creates dynamic HTML web pages on the fly. For simplicity, all of the
web page components—shell HTML, image GIFs, etc.—are imported into flash memory
using the #ximport statements. It is also possible to read these files from other locations,
including the onboard flash file system, but this application keeps things simple by load-
ing all the components into working memory.
The program then defines four instances of an LED toggling function, which are basic
CGI functions that swap the values “ledon.gif” and “ledoff.gif” as the contents of the
ledn strings, and then force a reload of the web page to change the associated LED
image. The physical LEDs on the Prototyping Board are turned on or off to match the
ledn strings displayed on the web page.
More Information
Refer to the Dynamic C TCP/IP User’s Manual for complete details on the Dynamic C
implementation of TCP/IP protocols.