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 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 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 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: 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 57600
$ sudo stty -F /dev/ttyS0 $ sudo stty -F /dev/ttyS0
start rz on the Linux host: Start rz on the Linux host:
$ sudo rz </dev/ttyS0 >/dev/ttyS0 $ 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 Where filename is the full path to the file to send (i.e., it begins
with the '/' character). 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 struct zm_transition_s
{ {
uint8_t type; /* Event (Frame type) */ uint8_t type; /* Event (Frame type) */
uint8_t next; /* Next state */
bool bdiscard; /* TRUE: discard buffered input */ bool bdiscard; /* TRUE: discard buffered input */
uint8_t next; /* Next state */
action_t action; /* Transition action */ action_t action; /* Transition action */
}; };

View File

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