Mon Jul 3 09:44:49 PDT 2000 Project Notes (udpdata): This sample is not really set up to run without special support software running on a remote host. It was used it to test UDP throughput to a PC using a special version of Perl which was hacked to do UDP transfers. For various reasons, we cannot distribute this version of Perl. The sample project takes a "trigger" UDP packet from the PC which tells the PicoWeb how much "dummy" data to send back using one or more UDP packets. The response UDP packets are limited to 1024 bytes of "payload" data. Therefore, if the PC sends a "trigger" packet requesting 16K bytes of data, then a total of 16 1024-byte UDP packets will be sent by the PicoWeb in quick succession. Using this setup, we determined the maximum sustained rate at which we could move UDP data from the PicoWeb to a laptop PC (running Windows NT) with a PCMCIA Ethernet card was 239 Kbytes/sec. As for a description of the various routines in this project: The routine "import_udp" gets called each time a UDP packet is received by the PicoWeb. This routine looks at the first two bytes of the incoming UDP packet and then saves this 16-bit number, the total amount of dummy UDP data to return. This routine then zeros the counter which keeps track of how much UDP data has been returned. Also, this routine calls "set_client" to remember the IP address and port of the incoming UDP packet. This information will be used to send back one or more response UDP data packets. The routine "udp_loop_processing" is called each time through the PicoWeb "fast idle" loop. It checks whether any UDP "response" data needs to be sent. If so, it uses a routine called "movedata" (see pcode instruction "pf2x") to setup for UDP data transfer and then build up the UDP packet''s data. The routine "udp_loop_processing" then calls the routine "mem_udp_send_client" to complete the checksum the UDP packet and to send the newly formed packet out on the network. The routine "set_client" records the IP address and port number from an incoming UDP packet for later use. The routine "movedata" is called to setup for creating the data for the UDP packet. UDP data is supplied two bytes at a time by a co-routine whose address is stored in the Z-register. This co-routine is named "movedata_next" in this sample project. Each time this "co-routine" is called it is expected to supply 16-bits of new UDP data in the Y-register (after first calling "f2x_checksum" to compute a running UDP checksum). Note that this project also can send data to the serial port using "parameters" supplied as part of a GET request URL line The string after "C=" in the URL is send out the serial port. Any data returned by the serial port (within 1 s) is output to the Web page. (See CGI routine "sertest".) This has nothing to do with the "UDP part" of the project.