Skip to content

Commit 2310d9f

Browse files
authored
Merge pull request #14 from jerryneedell/jerryn_fix_header
fix error when no header requested
2 parents 011fdfb + 6ebc70c commit 2310d9f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_rfm69.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,11 @@ def receive(self, timeout=0.5, keep_listening=True, with_header=False,
779779
else:
780780
packet = bytearray(fifo_length)
781781
device.readinto(packet)
782-
if (rx_filter != _RH_BROADCAST_ADDRESS and packet[0] != _RH_BROADCAST_ADDRESS
783-
and packet[0] != rx_filter):
784-
packet = None
785-
if not with_header: # skip the header if not wanted
786-
packet = packet[4:]
782+
if (rx_filter != _RH_BROADCAST_ADDRESS and packet[0] != _RH_BROADCAST_ADDRESS
783+
and packet[0] != rx_filter):
784+
packet = None
785+
elif not with_header: # skip the header if not wanted
786+
packet = packet[4:]
787787

788788
# Listen again if necessary and return the result packet.
789789
if keep_listening:

0 commit comments

Comments
 (0)