Skip to content

Commit b163dcd

Browse files
ES-Alexanderpatrickelectric
authored andcommitted
pingmessage: [consistency] added ERROR parser status, to match ping-cpp
1 parent bc4675e commit b163dcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

brping/pingmessage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ class PingParser(object):
291291
WAIT_PAYLOAD = 9 # Waiting for the last byte of the payload to come in
292292
WAIT_CHECKSUM_L = 10 # Waiting for the checksum low byte
293293
WAIT_CHECKSUM_H = 11 # Waiting for the checksum high byte
294+
ERROR = 12 # Checksum didn't check out
294295

295296
def __init__(self):
296297
self.buf = bytearray()
@@ -366,9 +367,8 @@ def wait_checksum_h(self, msg_byte):
366367
self.parsed += 1
367368
return self.NEW_MESSAGE
368369
else:
369-
# TODO add/return error state
370-
print("parse error")
371370
self.errors += 1
371+
return self.ERROR
372372

373373
return self.state
374374

0 commit comments

Comments
 (0)