Skip to content

XMODEM-checksum (aka XMODEM-128) and some fixes#362

Open
yabu76 wants to merge 12 commits into
tio:masterfrom
yabu76:xmodem_checksum
Open

XMODEM-checksum (aka XMODEM-128) and some fixes#362
yabu76 wants to merge 12 commits into
tio:masterfrom
yabu76:xmodem_checksum

Conversation

@yabu76

@yabu76 yabu76 commented Feb 14, 2026

Copy link
Copy Markdown

Added features:

Fixes:

Internal Improvements:

  • Refactoring XYMODEM codes
    • Adjust code style to comply with clang-format rules
    • Add error cases to read_poll()

yabu76 added 12 commits August 14, 2025 09:03
Refactoring.
- separete routines from xmodem_send_xxx,
  - xmsend_inirial_handshake
  - xmsend_wait_response,
  - xmsend_repeat_eot_and_wait_response
- separete routines from xmodem_receive,
  - xmrecv_drain_pending_chars
- separete routines from xymodem_send,
  - ymodem_send_1k
- rename routines.
  - crc16 --> calculate_crc16
  - update_CRC --> update_crc16
  - xmodem_1k --> xmodem_send_1k
  - xmodem_send --> xmodem_send_128b
  - receive_packet --> xmrecv_receive_packet
- rename struct types.
  - xpacket --> xpacket_128b
- separete xpacket's header / footer
  - xpacket_hdr, xpacket_ftr_crc

Fix error code handling.
- use 'rc' for system call's return code,
  and add 'err' for xymodem function's return code (OK, ERR, ...)
- add ERR_TMO to return codes
- change USER_CAN to ERR_USER_CAN, because it is negative value

Fix xmrecv_receive_packet()'s argument packet to pointer type.
If output-line-delay is non-zero and output-delay is any, line delay
time set output-line-delay.
If output-line-delay is zero and output-delay is non-zero, line delay
time set output-delay.

It was previously (output-line-delay + output-delay) in any case.
Also, since the buffer was flushed after the line delay, there was a
possibility that the delay would be reduced or not applied at all.
When the input mode is set to line, the left bracket cannot be input.
Note: XMODEM_SUM refers to the early XMODEM 128bytes/Checksum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant