summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/Documentation/NuttX.html6
-rw-r--r--nuttx/configs/c5471evm/defconfig31
-rw-r--r--nuttx/configs/c5471evm/dhcpconfig31
-rw-r--r--nuttx/configs/c5471evm/netconfig31
-rw-r--r--nuttx/configs/c5471evm/nshconfig31
-rw-r--r--nuttx/configs/ez80f910200kitg/ostest/defconfig15
-rw-r--r--nuttx/configs/ez80f910200zco/dhcpd/defconfig15
-rw-r--r--nuttx/configs/ez80f910200zco/httpd/defconfig15
-rw-r--r--nuttx/configs/ez80f910200zco/nettest/defconfig17
-rw-r--r--nuttx/configs/ez80f910200zco/nsh/defconfig15
-rw-r--r--nuttx/configs/ez80f910200zco/ostest/defconfig15
-rw-r--r--nuttx/configs/ez80f910200zco/poll/defconfig15
-rw-r--r--nuttx/examples/README.txt36
-rw-r--r--nuttx/examples/wget/Makefile.host2
-rw-r--r--nuttx/examples/wget/target.c17
-rw-r--r--nuttx/include/net/uip/webclient.h18
-rw-r--r--nuttx/netutils/webclient/webclient.c22
18 files changed, 277 insertions, 59 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 424dacb91..e250ac7ef 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/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/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 59e40d1d6..a592cf57a 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/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 &lt;spudmonkey@racsa.co.cr&gt;
(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 &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/configs/c5471evm/defconfig b/nuttx/configs/c5471evm/defconfig
index 8bd0ddba6..3c778d294 100644
--- a/nuttx/configs/c5471evm/defconfig
+++ b/nuttx/configs/c5471evm/defconfig
@@ -102,6 +102,16 @@ 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
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
@@ -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/nuttx/configs/c5471evm/dhcpconfig b/nuttx/configs/c5471evm/dhcpconfig
index d8be43c1c..50596e337 100644
--- a/nuttx/configs/c5471evm/dhcpconfig
+++ b/nuttx/configs/c5471evm/dhcpconfig
@@ -102,6 +102,16 @@ 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
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
@@ -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/nuttx/configs/c5471evm/netconfig b/nuttx/configs/c5471evm/netconfig
index fc735fa86..312b11414 100644
--- a/nuttx/configs/c5471evm/netconfig
+++ b/nuttx/configs/c5471evm/netconfig
@@ -120,6 +120,16 @@ 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
#
# CONFIG_EXAMPLE - identifies the subdirectory in examples
@@ -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/nuttx/configs/c5471evm/nshconfig b/nuttx/configs/c5471evm/nshconfig
index 74120c99d..ac0ca2582 100644
--- a/nuttx/configs/c5471evm/nshconfig
+++ b/nuttx/configs/c5471evm/nshconfig
@@ -102,6 +102,16 @@ 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
#
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
@@ -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/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig
index b5a04b202..51d6c3e0b 100644
--- a/nuttx/configs/ez80f910200kitg/ostest/defconfig
+++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig
@@ -716,6 +716,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/dhcpd/defconfig b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
index 5d59fabcc..6ffc90611 100644
--- a/nuttx/configs/ez80f910200zco/dhcpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
@@ -764,6 +764,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/httpd/defconfig b/nuttx/configs/ez80f910200zco/httpd/defconfig
index 7e49a0011..04ad0cb99 100644
--- a/nuttx/configs/ez80f910200zco/httpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/httpd/defconfig
@@ -772,6 +772,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/nettest/defconfig b/nuttx/configs/ez80f910200zco/nettest/defconfig
index f4cc622fc..2aff4d370 100644
--- a/nuttx/configs/ez80f910200zco/nettest/defconfig
+++ b/nuttx/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
@@ -757,6 +757,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/nsh/defconfig b/nuttx/configs/ez80f910200zco/nsh/defconfig
index 2cf6cf581..352542fb5 100644
--- a/nuttx/configs/ez80f910200zco/nsh/defconfig
+++ b/nuttx/configs/ez80f910200zco/nsh/defconfig
@@ -757,6 +757,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig
index 1b49f66da..95243d13f 100644
--- a/nuttx/configs/ez80f910200zco/ostest/defconfig
+++ b/nuttx/configs/ez80f910200zco/ostest/defconfig
@@ -740,6 +740,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/ez80f910200zco/poll/defconfig b/nuttx/configs/ez80f910200zco/poll/defconfig
index c73a568c7..21521105f 100644
--- a/nuttx/configs/ez80f910200zco/poll/defconfig
+++ b/nuttx/configs/ez80f910200zco/poll/defconfig
@@ -757,6 +757,21 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
#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
#
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/examples/README.txt b/nuttx/examples/README.txt
index 2c83dcd4f..f90dbffc5 100644
--- a/nuttx/examples/README.txt
+++ b/nuttx/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/nuttx/examples/wget/Makefile.host b/nuttx/examples/wget/Makefile.host
index 057649902..267a4e435 100644
--- a/nuttx/examples/wget/Makefile.host
+++ b/nuttx/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/nuttx/examples/wget/target.c b/nuttx/examples/wget/target.c
index 68bd47f4a..9f0b69b40 100644
--- a/nuttx/examples/wget/target.c
+++ b/nuttx/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>
@@ -87,6 +88,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/nuttx/include/net/uip/webclient.h b/nuttx/include/net/uip/webclient.h
index 1e485559d..58664335c 100644
--- a/nuttx/include/net/uip/webclient.h
+++ b/nuttx/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/nuttx/netutils/webclient/webclient.c b/nuttx/netutils/webclient/webclient.c
index 25d68558b..823863a51 100644
--- a/nuttx/netutils/webclient/webclient.c
+++ b/nuttx/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 */