diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-06 15:44:41 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-06 15:44:41 +0000 |
commit | 77598342d00348e0b97f05b2c6735bdf8dde8e33 (patch) | |
tree | a6d10071812c10e0221dc7a8d15d603f9e4b1ad8 /nuttx/examples/nsh | |
parent | bf15faf28c3826541af41632784beaefdb9a2254 (diff) | |
download | px4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.gz px4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.bz2 px4-nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.zip |
TFTP Get integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@885 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh')
-rw-r--r-- | nuttx/examples/nsh/README.txt | 6 | ||||
-rw-r--r-- | nuttx/examples/nsh/nsh_netcmds.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/nuttx/examples/nsh/README.txt b/nuttx/examples/nsh/README.txt index 0c0bc2eba..74f23692f 100644 --- a/nuttx/examples/nsh/README.txt +++ b/nuttx/examples/nsh/README.txt @@ -574,7 +574,7 @@ Command Dependencies on Configuration Settings echo -- exec -- exit -- - get CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558 + get CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558* help -- ifconfig CONFIG_NET ls CONFIG_NFILE_DESCRIPTORS > 0 @@ -587,7 +587,7 @@ Command Dependencies on Configuration Settings mount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT ping CONFIG_NET && CONFIG_NET_ICMP && CONFIG_NET_ICMP_PING && !CONFIG_DISABLE_CLOCK && !CONFIG_DISABLE_SIGNALS ps -- - put CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558 + put CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558* pwd !CONFIG_DISABLE_ENVIRON && CONFIG_NFILE_DESCRIPTORS > 0 rm !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 rmdir !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 @@ -599,6 +599,8 @@ Command Dependencies on Configuration Settings unset !CONFIG_DISABLE_ENVIRON usleep !CONFIG_DISABLE_SIGNALS +* NOTE: Because of hardware padding, the actual required size may be larger. + NSH-Specific Configuration Settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/examples/nsh/nsh_netcmds.c b/nuttx/examples/nsh/nsh_netcmds.c index 33eeb9966..3bc0d1e7e 100644 --- a/nuttx/examples/nsh/nsh_netcmds.c +++ b/nuttx/examples/nsh/nsh_netcmds.c @@ -389,6 +389,7 @@ errout: int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { struct tftpc_args_s args; + char *fullpath; /* Parse the input parameter list */ @@ -397,9 +398,13 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return ERROR; } + /* Get the full path to the local file */ + + fullpath = nsh_getfullpath(vtbl, args.srcpath); + /* Then perform the TFTP get operation */ - if (tftpget(args.srcpath, args.destpath, args.ipaddr, args.binary) != OK) + if (tftpget(args.srcpath, fullpath, args.ipaddr, args.binary) != OK) { nsh_output(vtbl, g_fmtcmdfailed, argv[0], "tftpget", NSH_ERRNO); } @@ -410,6 +415,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { free(args.destpath); } + free(fullpath); return OK; } #endif |