We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc4675e commit b163dcdCopy full SHA for b163dcd
brping/pingmessage.py
@@ -291,6 +291,7 @@ class PingParser(object):
291
WAIT_PAYLOAD = 9 # Waiting for the last byte of the payload to come in
292
WAIT_CHECKSUM_L = 10 # Waiting for the checksum low byte
293
WAIT_CHECKSUM_H = 11 # Waiting for the checksum high byte
294
+ ERROR = 12 # Checksum didn't check out
295
296
def __init__(self):
297
self.buf = bytearray()
@@ -366,9 +367,8 @@ def wait_checksum_h(self, msg_byte):
366
367
self.parsed += 1
368
return self.NEW_MESSAGE
369
else:
- # TODO add/return error state
370
- print("parse error")
371
self.errors += 1
+ return self.ERROR
372
373
return self.state
374
0 commit comments