Skip to content

Commit ccedcec

Browse files
authored
Merge pull request #71 from alpyen/fix-zero-length-payload-detection
Fix detection of zero payload length packets
2 parents 7406763 + 44e353d commit ccedcec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pySerialTransfer/pySerialTransfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def available(self):
540540
self.state = find_payload_len
541541

542542
elif self.state == find_payload_len:
543-
if recChar <= MAX_PACKET_SIZE:
543+
if recChar > 0 and recChar <= MAX_PACKET_SIZE:
544544
self.bytesToRec = recChar
545545
self.payIndex = 0
546546
self.state = find_payload

0 commit comments

Comments
 (0)