Skip to content

Commit

Permalink
brping: pingmessage: Fix payload_length check
Browse files Browse the repository at this point in the history
This should be zero and not one, the error was introduced in a rework on #110:
https://github.com/bluerobotics/ping-python/pull/110/files#diff-ed2c04d88418d534a1ae078d8a994d08848d370ca71de0d0af5ab5f7b6f19d99R345

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Nov 30, 2021
1 parent 2e687b2 commit 8c60085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brping/pingmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def wait_src_id(self, msg_byte):
def wait_dst_id(self, msg_byte):
self.buf.append(msg_byte)
self.state += 1
if self.payload_length == 1: # no payload bytes -> skip waiting
if self.payload_length == 0: # no payload bytes -> skip waiting
self.state += 1

def wait_payload(self, msg_byte):
Expand Down

0 comments on commit 8c60085

Please sign in to comment.