Skip to content

Commit 5590672

Browse files
committed
Timeout in getc should be treated as a NAK and cause a resend
This change allowed 1k mode to successfully load to a Sierra Wireless SL6087, with mode='xmodem1k' and pad='\xff'
1 parent 3d7fbfa commit 5590672

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

xmodem/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ def callback(total_packets, success_count, error_count)
311311
if callable(callback):
312312
callback(total_packets, success_count, error_count)
313313
break
314-
if char == NAK:
315-
self.log.warn('send error: NAK received '
314+
else:
315+
self.log.warn('send error: non-ACK received '
316316
'for block %d', sequence)
317317
error_count += 1
318318
if callable(callback):
@@ -328,12 +328,6 @@ def callback(total_packets, success_count, error_count)
328328
# return to loop and resend
329329
continue
330330

331-
# protocol error
332-
self.log.error('send error: expected ACK, NAK; got %r, '
333-
'aborting.', char)
334-
self.abort(timeout=timeout)
335-
return False
336-
337331
# keep track of sequence
338332
sequence = (sequence + 1) % 0x100
339333

0 commit comments

Comments
 (0)