summaryrefslogtreecommitdiff
path: root/nuttx/examples/wget
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-28 19:49:28 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-28 19:49:28 +0000
commit4d94719cf982033183a5d641ef741f5e229d212d (patch)
tree6e4e30215926ce1f068e9e7738a470fc7dea18a1 /nuttx/examples/wget
parent305d77e4688822294cd49112b4d8d73c48619979 (diff)
downloadpx4-nuttx-4d94719cf982033183a5d641ef741f5e229d212d.tar.gz
px4-nuttx-4d94719cf982033183a5d641ef741f5e229d212d.tar.bz2
px4-nuttx-4d94719cf982033183a5d641ef741f5e229d212d.zip
Add wget command to NSH
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1657 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/wget')
-rw-r--r--nuttx/examples/wget/host.c5
-rw-r--r--nuttx/examples/wget/target.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/nuttx/examples/wget/host.c b/nuttx/examples/wget/host.c
index 6d59e0eb1..40fda1af9 100644
--- a/nuttx/examples/wget/host.c
+++ b/nuttx/examples/wget/host.c
@@ -56,7 +56,8 @@
* Name: callback
****************************************************************************/
-static void callback(FAR char **buffer, int offset, int datend, FAR int *buflen)
+static void callback(FAR char **buffer, int offset, int datend,
+ FAR int *buflen, FAR void *arg)
{
(void)write(1, &((*buffer)[offset]), datend - offset);
}
@@ -89,7 +90,7 @@ int main(int argc, char **argv, char **envp)
}
printf("WGET: Getting %s\n", argv[1]);
- ret = wget(argv[1], buffer, 1024, callback);
+ ret = wget(argv[1], buffer, 1024, callback, NULL);
if (ret < 0)
{
fprintf(stderr, "WGET: wget failed: %s\n", strerror(errno));
diff --git a/nuttx/examples/wget/target.c b/nuttx/examples/wget/target.c
index 89716014c..9d3476964 100644
--- a/nuttx/examples/wget/target.c
+++ b/nuttx/examples/wget/target.c
@@ -94,7 +94,8 @@ static char g_iobuffer[512];
* Name: callback
****************************************************************************/
-static void callback(FAR char **buffer, int offset, int datend, FAR int *buflen)
+static void callback(FAR char **buffer, int offset, int datend,
+ FAR int *buflen, FAR void *arg)
{
(void)write(1, &((*buffer)[offset]), datend - offset);
}
@@ -155,6 +156,6 @@ int user_start(int argc, char *argv[])
/* Then start the server */
- wget(CONFIG_EXAMPLE_WGET_URL, g_iobuffer, 512, callback);
+ wget(CONFIG_EXAMPLE_WGET_URL, g_iobuffer, 512, callback, NULL);
return 0;
}