diff --git a/ChangeLog b/ChangeLog index 424dacb91bd9674c7b42aca201a590b605d58fb8..e250ac7ef9877ab91e05e0cc0caaf5b4f7b2a78f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -672,4 +672,6 @@ (submitted by JPelletier). The is the same fix that was needed for the eZ80 and fixed in 0.4.2. * netutils: Added logic to support a simple wget() function - * examples/wget: Added a test for wget() + * examples/wget: Added a test for wget() (Not yet tested because of + some current networking limitations). + * lib/strncasecmp: Fix cut'n'paste error in function name. diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 59e40d1d67c917983483c3b5ee7e554c0db40a11..a592cf57a5fdcdded318aa2a71dd96568b93fff1 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@ <tr align="center" bgcolor="#e4e4e4"> <td> <h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1> - <p>Last Updated: March 25, 2009</p> + <p>Last Updated: March 28, 2009</p> </td> </tr> </table> @@ -1363,7 +1363,9 @@ nuttx-0.4.4 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> (submitted by JPelletier). The is the same fix that was needed for the eZ80 and fixed in 0.4.2. * netutils: Added logic to support a simple wget() function - * examples/wget: Added a test for wget() + * examples/wget: Added a test for wget() (Not yet tested because of + some current networking limitations). + * lib/strncasecmp: Fix cut'n'paste error in function name. pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/configs/c5471evm/defconfig b/configs/c5471evm/defconfig index 8bd0ddba61cdae085888cf9b226a7113777391a7..3c778d294c009c261b4571b57dcae24f38313611 100644 --- a/configs/c5471evm/defconfig +++ b/configs/c5471evm/defconfig @@ -101,6 +101,16 @@ CONFIG_UART_MODEM_PARITY=0 CONFIG_UART_IRDA_2STOP=0 CONFIG_UART_MODEM_2STOP=0 +# +# C5471 Ethernet Driver settings +CONFIG_C5471_NET_STATS=n +ETHERNET_PHY_LU3X31T_T64=1 +ETHERNET_PHY_AC101L=2 +CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 +CONFIG_NET_C5471_AUTONEGOTIATION=y +CONFIG_NET_C5471_BASET100=n +CONFIG_NET_C5471_BASET10=n + # # General build options # @@ -366,14 +376,19 @@ CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0) # -# C5471 Ethernet Driver settings -CONFIG_C5471_NET_STATS=n -ETHERNET_PHY_LU3X31T_T64=1 -ETHERNET_PHY_AC101L=2 -CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 -CONFIG_NET_C5471_AUTONEGOTIATION=y -CONFIG_NET_C5471_BASET100=n -CONFIG_NET_C5471_BASET10=n +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) # # Stack and heap information diff --git a/configs/c5471evm/dhcpconfig b/configs/c5471evm/dhcpconfig index d8be43c1ca0804849c26e5b1eac12be0aa5ba2ab..50596e3370d3e57bcfeb016d305cb712ad94905d 100644 --- a/configs/c5471evm/dhcpconfig +++ b/configs/c5471evm/dhcpconfig @@ -101,6 +101,16 @@ CONFIG_UART_MODEM_PARITY=0 CONFIG_UART_IRDA_2STOP=0 CONFIG_UART_MODEM_2STOP=0 +# +# C5471 Ethernet Driver settings +CONFIG_C5471_NET_STATS=n +ETHERNET_PHY_LU3X31T_T64=1 +ETHERNET_PHY_AC101L=2 +CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 +CONFIG_NET_C5471_AUTONEGOTIATION=y +CONFIG_NET_C5471_BASET100=n +CONFIG_NET_C5471_BASET10=n + # # General build options # @@ -366,14 +376,19 @@ CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0) # -# C5471 Ethernet Driver settings -CONFIG_C5471_NET_STATS=n -ETHERNET_PHY_LU3X31T_T64=1 -ETHERNET_PHY_AC101L=2 -CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 -CONFIG_NET_C5471_AUTONEGOTIATION=y -CONFIG_NET_C5471_BASET100=n -CONFIG_NET_C5471_BASET10=n +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) # # Stack and heap information diff --git a/configs/c5471evm/netconfig b/configs/c5471evm/netconfig index fc735fa86625d001746560af7a380f8efcdeb170..312b11414cf4da0b04ef0485a97fc4f1c1f2e27a 100644 --- a/configs/c5471evm/netconfig +++ b/configs/c5471evm/netconfig @@ -119,6 +119,16 @@ CONFIG_UART_MODEM_PARITY=0 CONFIG_UART_IRDA_2STOP=0 CONFIG_UART_MODEM_2STOP=0 +# +# C5471 Ethernet Driver settings +CONFIG_C5471_NET_STATS=n +ETHERNET_PHY_LU3X31T_T64=1 +ETHERNET_PHY_AC101L=2 +CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 +CONFIG_NET_C5471_AUTONEGOTIATION=y +CONFIG_NET_C5471_BASET100=n +CONFIG_NET_C5471_BASET10=n + # # General OS setup # @@ -366,14 +376,19 @@ CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0) # -# C5471 Ethernet Driver settings -CONFIG_C5471_NET_STATS=n -ETHERNET_PHY_LU3X31T_T64=1 -ETHERNET_PHY_AC101L=2 -CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 -CONFIG_NET_C5471_AUTONEGOTIATION=y -CONFIG_NET_C5471_BASET100=n -CONFIG_NET_C5471_BASET10=n +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) # # Stack and heap information diff --git a/configs/c5471evm/nshconfig b/configs/c5471evm/nshconfig index 74120c99d9ab5c18a75aed4aa17fb3346474f566..ac0ca2582ce0d2b78e8c29a4e925382eef462cf4 100644 --- a/configs/c5471evm/nshconfig +++ b/configs/c5471evm/nshconfig @@ -101,6 +101,16 @@ CONFIG_UART_MODEM_PARITY=0 CONFIG_UART_IRDA_2STOP=0 CONFIG_UART_MODEM_2STOP=0 +# +# C5471 Ethernet Driver settings +CONFIG_C5471_NET_STATS=n +ETHERNET_PHY_LU3X31T_T64=1 +ETHERNET_PHY_AC101L=2 +CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 +CONFIG_NET_C5471_AUTONEGOTIATION=y +CONFIG_NET_C5471_BASET100=n +CONFIG_NET_C5471_BASET10=n + # # General build options # @@ -366,14 +376,19 @@ CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0) # -# C5471 Ethernet Driver settings -CONFIG_C5471_NET_STATS=n -ETHERNET_PHY_LU3X31T_T64=1 -ETHERNET_PHY_AC101L=2 -CONFIG_C5471_ETHERNET_PHY=ETHERNET_PHY_LU3X31T_T64 -CONFIG_NET_C5471_AUTONEGOTIATION=y -CONFIG_NET_C5471_BASET100=n -CONFIG_NET_C5471_BASET10=n +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) # # Stack and heap information diff --git a/configs/ez80f910200kitg/ostest/defconfig b/configs/ez80f910200kitg/ostest/defconfig index b5a04b20241f057e2ba65f59bd91c9343eb266e6..51d6c3e0be0c664f3f0db72a8200649c124cc959 100644 --- a/configs/ez80f910200kitg/ostest/defconfig +++ b/configs/ez80f910200kitg/ostest/defconfig @@ -715,6 +715,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/dhcpd/defconfig b/configs/ez80f910200zco/dhcpd/defconfig index 5d59fabcc234a6c2176a64d31dd8a721a7f4fda5..6ffc90611997e27b228e669140dd91a818b123f2 100644 --- a/configs/ez80f910200zco/dhcpd/defconfig +++ b/configs/ez80f910200zco/dhcpd/defconfig @@ -763,6 +763,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/httpd/defconfig b/configs/ez80f910200zco/httpd/defconfig index 7e49a0011f423c83e8d7cb1b91f43b9360190296..04ad0cb9986145d7d2db5f6c531b3fff0bcc3cbb 100644 --- a/configs/ez80f910200zco/httpd/defconfig +++ b/configs/ez80f910200zco/httpd/defconfig @@ -771,6 +771,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/nettest/defconfig b/configs/ez80f910200zco/nettest/defconfig index f4cc622fc90466796fc39ed247ffff58c35affc5..2aff4d370e2ed060a06768a7aadd9663a1de5ae0 100644 --- a/configs/ez80f910200zco/nettest/defconfig +++ b/configs/ez80f910200zco/nettest/defconfig @@ -224,7 +224,7 @@ CONFIG_HAVE_LIBM=n # semaphore. This value may be set to zero if no more than one # thread is expected to wait for a semaphore. # -CONFIG_EXAMPLE=nettest +CONFIG_EXAMPLE=wget CONFIG_DEBUG=y CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_NET=n @@ -756,6 +756,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/nsh/defconfig b/configs/ez80f910200zco/nsh/defconfig index 2cf6cf5812b2fe07db0c6a70b18c6dd2205309d6..352542fb53402e145bfe95a2b217e7f31e01190c 100644 --- a/configs/ez80f910200zco/nsh/defconfig +++ b/configs/ez80f910200zco/nsh/defconfig @@ -756,6 +756,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/ostest/defconfig b/configs/ez80f910200zco/ostest/defconfig index 1b49f66dab83c7ad4bc8f782da0af6762a2e450e..95243d13fd51b55edbbf61a2f380afaad78cfbcb 100644 --- a/configs/ez80f910200zco/ostest/defconfig +++ b/configs/ez80f910200zco/ostest/defconfig @@ -739,6 +739,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/configs/ez80f910200zco/poll/defconfig b/configs/ez80f910200zco/poll/defconfig index c73a568c73eda485d9af54b97798dc4c36d05c51..21521105fa0d54afb693c7af2ef90b927b6a91e2 100644 --- a/configs/ez80f910200zco/poll/defconfig +++ b/configs/ez80f910200zco/poll/defconfig @@ -756,6 +756,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" #CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 #CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 +# +# Settings for examples/wget +# CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file +# CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') +# CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) +# CONFIG_EXAMPLE_WGET_IPADDR - Target IP address +# CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess +# CONFIG_EXAMPLE_WGET_NETMASK - Network mask +CONFIG_EXAMPLE_WGET_HOSTNAME="www.nuttx.org" +CONFIG_EXAMPLE_WGET_FILENAME="/index.html" +CONFIG_EXAMPLE_WGET_NOMAC=y +CONFIG_EXAMPLE_WGET_IPADDR=(10L<<24|0L<<16|0L<<8|2L) +CONFIG_EXAMPLE_WGET_DRIPADDR=(10L<<24|0L<<16|0L<<8|1L) +CONFIG_EXAMPLE_WGET_NETMASK=(255L<<24|255L<<16|255L<<8|0L) + # # Stack and heap information # diff --git a/examples/README.txt b/examples/README.txt index 2c83dcd4f7bec2546b0476df4cf741614cbf21f3..f90dbffc540b8c0480403fa79a8f22caf9d4534f 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -308,7 +308,7 @@ examples/usbserial serial messages. examples/usbstorage -^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^ This example registers a block device driver, then exports the block the device using the USB storage class driver. Configuration options: @@ -347,3 +347,37 @@ examples/usbstorage Error results are always shown in the trace output +examples/wget +^^^^^^^^^^^^^ + + A simple web client example. It will obtain a file from a server using the HTTP + protocol. Settings unique to this example include: + + CONFIG_EXAMPLE_WGET_HOSTNAME - The host that serves the file + CONFIG_EXAMPLE_WGET_FILENAME - The name of the file to get (with leading '/') + CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC) + CONFIG_EXAMPLE_WGET_IPADDR - Target IP address + CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess + CONFIG_EXAMPLE_WGET_NETMASK - Network mask + + This example uses netutils/webclient. Additional configuration settings apply + to that code as follows (but built-in defaults are probably OK): + + CONFIG_WEBCLIENT_GETMIMETYPE, CONFIG_WEBCLIENT_MAXHTTPLINE, + CONFIG_WEBCLIENT_MAXMIMESIZE, CONFIG_WEBCLIENT_MAXHOSTNAME, + CONFIG_WEBCLIENT_MAXFILENAME + + Of course, the example also requires other settings including CONFIG_NET and + CONFIG_NET_TCP. The example also uses the uIP resolver which requires CONFIG_UDP. + + WARNNG: As of this writing, wget is untested on the target platform. At present + it has been tested only in the host-based configuration described in the following + note. The primary difference is that the target version will rely on the also + untested uIP name resolver. + + NOTE: For test purposes, this example can be built as a host-based wget function. + This can be built as follows: + + cd examples/wget + make -f Makefile.host + diff --git a/examples/wget/Makefile.host b/examples/wget/Makefile.host index 057649902b5392a41e39870ddd975cea111aef66..267a4e435c49c68a385095e61ce2532961f14040 100644 --- a/examples/wget/Makefile.host +++ b/examples/wget/Makefile.host @@ -40,7 +40,7 @@ include $(TOPDIR)/Make.defs OBJS = host.o1 webclient.o1 BIN = wget -HOSTCFLAGS += -DCONFIG_NETUTILS_WEBCLIENT_HOST=1 +HOSTCFLAGS += -DCONFIG_WEBCLIENT_HOST=1 HOSTCFLAGS += -I. -include hostdefs.h VPATH = $(TOPDIR)/netutils/webclient:. diff --git a/examples/wget/target.c b/examples/wget/target.c index 68bd47f4a6c251e03dcdd7e900a6577e22e5dc65..9f0b69b40f914a605ebbbf5103bf0fdd16fb8aa5 100644 --- a/examples/wget/target.c +++ b/examples/wget/target.c @@ -40,6 +40,7 @@ #include <nuttx/config.h> #include <sys/types.h> +#include <unistd.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -86,6 +87,21 @@ static char g_iobuffer[512]; +/**************************************************************************** + * Private Functions + ****************************************************************************/ +/**************************************************************************** + * Name: callback + ****************************************************************************/ + +static void callback(FAR char **buffer, int offset, int datend, FAR int *buflen) +{ + (void)write(1, &((*buffer)[offset]), datend - offset); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ /**************************************************************************** * user_initialize ****************************************************************************/ @@ -106,7 +122,6 @@ void user_initialize(void) int user_start(int argc, char *argv[]) { struct in_addr addr; - static uip_ipaddr_t addr; #if defined(CONFIG_EXAMPLE_WGET_NOMAC) uint8 mac[IFHWADDRLEN]; #endif diff --git a/include/net/uip/webclient.h b/include/net/uip/webclient.h index 1e485559da0128d262b4e3e21babd5f5fc7c7bcb..58664335c6d53dacc14606b8d87c6bb15791cfb6 100644 --- a/include/net/uip/webclient.h +++ b/include/net/uip/webclient.h @@ -46,7 +46,7 @@ * Included Files ****************************************************************************/ -#ifndef CONFIG_NETUTILS_WEBCLIENT_HOST +#ifndef CONFIG_WEBCLIENT_HOST # include <nuttx/config.h> #endif #include <sys/types.h> @@ -55,20 +55,20 @@ * Pre-processor definitions ****************************************************************************/ -#ifndef CONFIG_NETUTILS_WEBCLIENT_MAXHTTPLINE -# define CONFIG_NETUTILS_WEBCLIENT_MAXHTTPLINE 200 +#ifndef CONFIG_WEBCLIENT_MAXHTTPLINE +# define CONFIG_WEBCLIENT_MAXHTTPLINE 200 #endif -#ifndef CONFIG_NETUTILS_WEBCLIENT_MAXMIMESIZE -# define CONFIG_NETUTILS_WEBCLIENT_MAXMIMESIZE 32 +#ifndef CONFIG_WEBCLIENT_MAXMIMESIZE +# define CONFIG_WEBCLIENT_MAXMIMESIZE 32 #endif -#ifndef CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME -# define CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME 40 +#ifndef CONFIG_WEBCLIENT_MAXHOSTNAME +# define CONFIG_WEBCLIENT_MAXHOSTNAME 40 #endif -#ifndef CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME -# define CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME 100 +#ifndef CONFIG_WEBCLIENT_MAXFILENAME +# define CONFIG_WEBCLIENT_MAXFILENAME 100 #endif /**************************************************************************** diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c index 25d68558bfc3b0695f5a03187a472824db0d3ee0..823863a510f52d66d5d0671c3d068c8c7987594a 100644 --- a/netutils/webclient/webclient.c +++ b/netutils/webclient/webclient.c @@ -48,7 +48,7 @@ * Included Files ****************************************************************************/ -#ifndef CONFIG_NETUTILS_WEBCLIENT_HOST +#ifndef CONFIG_WEBCLIENT_HOST # include <nuttx/config.h> # include <nuttx/compiler.h> # include <debug.h> @@ -107,14 +107,14 @@ struct wget_s /* Buffer HTTP header data and parse line at a time */ - char line[CONFIG_NETUTILS_WEBCLIENT_MAXHTTPLINE]; + char line[CONFIG_WEBCLIENT_MAXHTTPLINE]; int ndx; #ifdef CONFIG_WEBCLIENT_GETMIMETYPE - char mimetype[CONFIG_NETUTILS_WEBCLIENT_MAXMIMESIZE]; + char mimetype[CONFIG_WEBCLIENT_MAXMIMESIZE]; #endif - char hostname[CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME]; - char filename[CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME]; + char hostname[CONFIG_WEBCLIENT_MAXHOSTNAME]; + char filename[CONFIG_WEBCLIENT_MAXFILENAME]; }; /**************************************************************************** @@ -353,7 +353,7 @@ static inline int wget_parseheaders(struct wget_s *ws) ws->hostname[i] = 0; break; } - else if (i < CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME-1) + else if (i < CONFIG_WEBCLIENT_MAXHOSTNAME-1) { ws->hostname[i] = *dest; } @@ -362,12 +362,12 @@ static inline int wget_parseheaders(struct wget_s *ws) /* Copy the location */ - strncpy(ws->filename, dest, CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME-1); + strncpy(ws->filename, dest, CONFIG_WEBCLIENT_MAXFILENAME-1); /* Make sure that everything is NULL terminated */ - ws->hostname[CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME-1] = '\0'; - ws->filename[CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME-1] = '\0'; + ws->hostname[CONFIG_WEBCLIENT_MAXHOSTNAME-1] = '\0'; + ws->filename[CONFIG_WEBCLIENT_MAXFILENAME-1] = '\0'; nvdbg("New hostname='%s' filename='%s'\n", ws->hostname, ws->filename); } } @@ -416,8 +416,8 @@ int wget(uint16 port, memset(&ws, 0, sizeof(struct wget_s)); ws.buffer = buffer; ws.buflen = buflen; - strncpy(ws.hostname, hostname, CONFIG_NETUTILS_WEBCLIENT_MAXHOSTNAME); - strncpy(ws.filename, filename, CONFIG_NETUTILS_WEBCLIENT_MAXFILENAME); + strncpy(ws.hostname, hostname, CONFIG_WEBCLIENT_MAXHOSTNAME); + strncpy(ws.filename, filename, CONFIG_WEBCLIENT_MAXFILENAME); /* The following sequence may repeat indefinitely if we are redirected */