diff --git a/adafruit_rfm69.py b/adafruit_rfm69.py index 17de383..e4908ea 100644 --- a/adafruit_rfm69.py +++ b/adafruit_rfm69.py @@ -687,6 +687,8 @@ def send(self, data, timeout=2., keep_listening=False, The timeout is just to prevent a hang (arbitrarily set to 2 seconds) The keep_listening argument should be set to True if you want to start listening automatically after the packet is sent. The default setting is False. + + Returns: True if success or False if the send timed out. """ # Disable pylint warning to not use length as a check for zero. # 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, else: # Enter idle mode to stop receiving other packets. self.idle() - if timed_out: - raise RuntimeError('Timeout during packet send') + + return not timed_out def receive(self, timeout=0.5, keep_listening=True, with_header=False, rx_filter=_RH_BROADCAST_ADDRESS):