Skip to content

Commit 4894d64

Browse files
committed
Allow extended messages.
1 parent 70d6deb commit 4894d64

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

adafruit_radio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252

5353
#: Maximum length of a message (in bytes).
54-
MAX_LENGTH = 21
54+
MAX_LENGTH = 248
5555

5656
#: Amount of time to advertise a message (in seconds).
5757
AD_DURATION = 0.5
@@ -158,7 +158,7 @@ def receive_full(self):
158158
"""
159159
try:
160160
for entry in self.ble.start_scan(
161-
AdafruitRadio, minimum_rssi=-255, timeout=1
161+
AdafruitRadio, minimum_rssi=-255, timeout=1, extended=True
162162
):
163163
# Extract channel and unique message ID bytes.
164164
chan, uid = struct.unpack("<BB", entry.msg[:2])

tests/test_adafruit_radio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ def test_radio_receive_full_no_messages(radio):
136136
radio.ble.start_scan.return_value = []
137137
assert radio.receive_full() is None
138138
radio.ble.start_scan.assert_called_once_with(
139-
adafruit_radio.AdafruitRadio, minimum_rssi=-255, timeout=1
139+
adafruit_radio.AdafruitRadio, minimum_rssi=-255, timeout=1,
140+
extended=True
140141
)
141142
radio.ble.stop_scan.assert_called_once_with()
142143

0 commit comments

Comments
 (0)