Fix an error in the ordering of fields in zm_transition_s structure; update documentation

This commit is contained in:
Gregory Nutt 2013-07-14 12:34:45 -06:00
parent 4d439eda39
commit 3fddcfd334
3 changed files with 35 additions and 6 deletions

View File

@ -4,6 +4,8 @@ README
Using NuttX Zmodem with a Linux Host
====================================
Sending Files from the Target to the Linux Host PC
--------------------------------------------------
The NuttX Zmodem commands have been verified against the rzsz programs
running on a Linux PC. To send a file to the PC, first make sure that
the serial port is configured to work with the board:
@ -11,7 +13,7 @@ Using NuttX Zmodem with a Linux Host
$ sudo stty -F /dev/ttyS0 57600
$ sudo stty -F /dev/ttyS0
start rz on the Linux host:
Start rz on the Linux host:
$ sudo rz </dev/ttyS0 >/dev/ttyS0
@ -38,4 +40,31 @@ Using NuttX Zmodem with a Linux Host
Where filename is the full path to the file to send (i.e., it begins
with the '/' character).
Receiving Files on the Target from the Linux Host PC
----------------------------------------------------
To send a file to the target, first make sure that the serial port on the
host is configured to work with the board:
$ sudo stty -F /dev/ttyS0 57600
$ sudo stty -F /dev/ttyS0
Start rz on the on the target:
nsh> rz -d /dev/ttyS1
Then use the sz command on Linux to send the file to the target:
$ sudo sz <filename> t </dev/ttyS0 >/dev/ttyS0
Where <filename> is the file that you want to send.
The resulting file will be found where you have configured the Zmodem
"sandbox" via CONFIG_SYSTEM_ZMODEM_MOUNTPOINT.
You can add the az -v option multiple times, each increases the level
of debug output. If you want to capture the Linux rz output, then
re-direct stderr to a log file by adding 2>az.log to the end of the
rz command.
If you don't have the az command on your Linux box, the package to
install rzsz (or possibily lrzsz).

View File

@ -287,8 +287,8 @@ typedef int (*action_t)(FAR struct zm_state_s *pzm);
struct zm_transition_s
{
uint8_t type; /* Event (Frame type) */
uint8_t next; /* Next state */
bool bdiscard; /* TRUE: discard buffered input */
uint8_t next; /* Next state */
action_t action; /* Transition action */
};

View File

@ -81,14 +81,14 @@
* <---- ZRINIT ZMR_START
* ZSINIT ---->
* <---- ZACK ZMR_INITWAIT
* ZFILE ---->
* ZFILE ---->
* <---- ZRPOS ZMR_FILEINFO
* ZDATA ---->
* <---- ZCRC ZMR_CRCWAIT
* ZCRC ----> ZMR_READREADY
* Data packets ----> ZMR_READING
* Last packet ---->
* ZEOF ---->
* ZEOF ---->
* <---- ZRINIT
* ZFIN ---->
* <---- ZFIN ZMR_FINISH
@ -955,7 +955,7 @@ static int zmr_zfin(FAR struct zm_state_s *pzm)
* meaning that we are all done.
*/
zmdbg("PSTATE %d:%d->%d.%d: send ZFIN\n",
zmdbg("PSTATE %d:%d->%d.%d: Send ZFIN\n",
pzm->pstate, pzm->psubstate, PSTATE_IDLE, PIDLE_ZPAD);
zmdbg("ZMR_STATE %d\n", pzm->state);