apps/system/zmodem: Fix an incompatibility with the way that CRCs are calculated.

This commit is contained in:
Gregory Nutt 2018-05-27 08:43:22 -06:00
parent d413571621
commit 9ac16049b8
3 changed files with 3 additions and 6 deletions

View File

@ -80,9 +80,10 @@ Using NuttX Zmodem with a Linux Host
$ sudo stty -F /dev/ttyS0 9600 # Select 9600 BAUD
$ sudo stty -F /dev/ttyS0 crtscts # Enables CTS/RTS handshaking *
$ sudo stty -F /dev/ttyS0 raw # Puts the TTY in raw mode
$ sudo stty -F /dev/ttyS0 # Show the TTY configuration
* Only is hardware flow control is enabled.
* Only if hardware flow control is enabled.
Start rz on the Linux host (using /dev/ttyS0 as an example):

View File

@ -235,11 +235,10 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer,
*ptr++ = term;
/* Calcualate and transfer the final CRC value */
/* Calculate and transfer the final CRC value */
if (zbin == ZBIN)
{
crc = (uint32_t)crc16part(g_zeroes, 2, (uint16_t)crc);
ptr = zm_putzdle(pzm, ptr, (crc >> 8) & 0xff);
ptr = zm_putzdle(pzm, ptr, crc & 0xff);
}
@ -314,7 +313,6 @@ int zm_sendhexhdr(FAR struct zm_state_s *pzm, int type,
/* crc-1 crc-2 */
crc = crc16part(g_zeroes, 2, crc);
ptr = zm_puthex8(ptr, (crc >> 8) & 0xff);
ptr = zm_puthex8(ptr, crc & 0xff);
@ -391,7 +389,6 @@ int zm_sendbin16hdr(FAR struct zm_state_s *pzm, int type,
/* crc-1 crc-2 */
crc = crc16part(g_zeroes, 2, crc);
ptr = zm_putzdle(pzm, ptr, (crc >> 8) & 0xff);
ptr = zm_putzdle(pzm, ptr, crc & 0xff);

View File

@ -1047,7 +1047,6 @@ static int zms_sendpacket(FAR struct zm_state_s *pzm)
if (!bcrc32)
{
crc = (uint32_t)crc16part(g_zeroes, 2, (uint16_t)crc);
ptr = zm_putzdle(pzm, ptr, (crc >> 8) & 0xff);
ptr = zm_putzdle(pzm, ptr, crc & 0xff);
}