If you haven’t already it’s a good idea to read the Network Protocol Analyzer Utilities and PC Ethernet Ports sections of this manual now so that you can setup Wireshark to monitor your computers Ethernet port and see activity on the network as it happens. Without this it’s hard to see with your own eyes what the stack is actually doing!
The sample project, which is all provided in ap-main.c and ap-main.h, is configured with DHCP enabled. If you wish to manually set an IP address, for instance if your network does not have a DHCP server or if you are directly connecting your device to your computer, alter the initialise() function.
Compile and run the project on your hardware. If the Network Interface Controller IC (nic) is connected to a network (connected to a hub, switch or directly to another Ethernet device) LED A will light. LED B will light when the driver has an IP address. If you are using manual IP settings then this will be immediate but if you are using DHCP this will be once the DHCP server has been found and the IP settings obtained.
To view the sample web page:

enter the following in your browsers address bar:
“http://embedded-device/”, or just “embedded-device”
This is the name the sample project sets as the drivers NetBIOS name. If your browser doesn’t display the sample web page shown above and doesn’t display a ‘not found’ error page then its likely that your DNS service is stopping your computer trying the NetBIOS service, so instead enter the IP address of the device in the browsers address bar. If you are using DHCP you can find what IP address the DHCP server assigned by looking at your Wireshark log or by using your debugger to view the value of the variable our_ip_address.
The sample page shown demonstrates the serving of a single web page and an image, the inclusion of dynamic data in each of the form fields, and the three different types of form input methods you may use.
If you have a POP3 or SMTP account to use the web page allows you to trigger the sending or receiving of email. The sample functions that is passed each received email doesn’t do anything with the data but can be made to by adding your own code. The sample functions that is called to provide the email contents when triggering an email send will generate a simple email with a text file attached. Triggering a send or receive of email can also be monitored using Wireshark so you can see POP3 and SMTP driver in action.
You can also test the uploading of a file using the third form. Again the sample functions don’t do anything with the received file data but can be made to if you add your own code to them.
The 2 switch inputs provide the following functions:-
Switch A Press to trigger the following:
Requests time from SNTP server
Opens a client UDP socket, sends a broadcast UDP packet to port 6452 containing the text “Hello World” and the waits for a response, timing out and resetting if none is received
Switch B Press to trigger the following:
Attempts to opens a client TCP socket connected to a remote device with IP address 192.168.0.20 (alter as required) using port 4102. If the connection is accepted by the remote device it will then sends a TCP packet containing the text “Hello World” and the wait for a response. If a response is received or if it times out it will then request the socket to be closed.
The sample project also implements a constantly running UDP server socket and TCP server socket which provide the following functions:
If you setup another device to send a UDP packet to port 6451 the sample socket will automatically respond with a broadcast packet containing the text “Hello World”.
If you setup another device to connect using TCP to 4101 the driver will accept the connection and wait for a single packet. It will automatically respond with a packet containing the text “Hello World”. The TCP server will remain connected until the remote client disconnects.
The sample projects may be used as a starting point to write a new application or just as a reference for including the driver in your own project.