diff options
Diffstat (limited to 'nuttx/examples')
-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 |