Xmodem download algoritme

Verzend een NAK elke 10 seconden totdat een pakket is ontvangen

Als er een pakket ontvangen is dan moet er gechecked worden voor een SOH

if SOH then

get block number

calculate One’s complement to block number

compare complement to the complement sent in the packet

if local complement <> remote complement then
Send NAK and repeat process
Else
get 128 bytes of data
calculate checksum
compare local checksum to packet checksum
if local checksum <> packet checksum then
Send NAK and repeat process
Else
write data to file
send ACK
End if
End if
Read next SOH
if SOH = EOT then transmission successful
if SOH = CAN then transmission aborted
if SOH = &H01 then get next packet (repeat)

Laat een reactie achter