Skip to content

Commit de4ab4e

Browse files
authored
Merge pull request #27 from geekguy-wy/remove_runtime_send_error
Remove the "RuntimeError: Timeout during packet send" error generated…
2 parents a4c646a + 7d2c097 commit de4ab4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adafruit_rfm69.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ def send(self, data, timeout=2., keep_listening=False,
687687
The timeout is just to prevent a hang (arbitrarily set to 2 seconds)
688688
The keep_listening argument should be set to True if you want to start listening
689689
automatically after the packet is sent. The default setting is False.
690+
691+
Returns: True if success or False if the send timed out.
690692
"""
691693
# Disable pylint warning to not use length as a check for zero.
692694
# This is a puzzling warning as the below code is clearly the most
@@ -727,8 +729,8 @@ def send(self, data, timeout=2., keep_listening=False,
727729
else:
728730
# Enter idle mode to stop receiving other packets.
729731
self.idle()
730-
if timed_out:
731-
raise RuntimeError('Timeout during packet send')
732+
733+
return not timed_out
732734

733735
def receive(self, timeout=0.5, keep_listening=True, with_header=False,
734736
rx_filter=_RH_BROADCAST_ADDRESS):

0 commit comments

Comments
 (0)