Skip to content

Commit c97379f

Browse files
authored
Merge branch 'master' into pylint-update
2 parents d6dc78f + de4ab4e commit c97379f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

adafruit_rfm69.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ def send(
705705
The timeout is just to prevent a hang (arbitrarily set to 2 seconds)
706706
The keep_listening argument should be set to True if you want to start listening
707707
automatically after the packet is sent. The default setting is False.
708+
709+
Returns: True if success or False if the send timed out.
708710
"""
709711
# Disable pylint warning to not use length as a check for zero.
710712
# This is a puzzling warning as the below code is clearly the most
@@ -745,16 +747,11 @@ def send(
745747
else:
746748
# Enter idle mode to stop receiving other packets.
747749
self.idle()
748-
if timed_out:
749-
raise RuntimeError("Timeout during packet send")
750750

751-
def receive(
752-
self,
753-
timeout=0.5,
754-
keep_listening=True,
755-
with_header=False,
756-
rx_filter=_RH_BROADCAST_ADDRESS,
757-
):
751+
return not timed_out
752+
753+
def receive(self, timeout=0.5, keep_listening=True, with_header=False,
754+
rx_filter=_RH_BROADCAST_ADDRESS):
758755
"""Wait to receive a packet from the receiver. Will wait for up to timeout_s amount of
759756
seconds for a packet to be received and decoded. If a packet is found the payload bytes
760757
are returned, otherwise None is returned (which indicates the timeout elapsed with no

0 commit comments

Comments
 (0)