Skip to content

Commit 1c55b5d

Browse files
committed
changed 'wait' argument to 'timeout', and added unit information to docstring
1 parent 33f7b83 commit 1c55b5d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

adafruit_ble_radio.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@ def send_bytes(self, message):
142142
time.sleep(AD_DURATION)
143143
self.ble.stop_advertising()
144144

145-
def receive(self, **args):
145+
def receive(self, timeout=1):
146146
"""
147147
Returns a message received on the channel on which the radio is
148148
listening.
149149
150150
:return: A string representation of the received message, or else None.
151151
"""
152-
msg = self.receive_full(**args)
152+
msg = self.receive_full(timeout)
153153
if msg:
154154
return msg[0].decode("utf-8").replace("\x00", "")
155155
return None
156156

157-
def receive_full(self, wait=1):
157+
def receive_full(self, timeout=1):
158158
"""
159159
Returns a tuple containing three values representing a message received
160160
on the channel on which the radio is listening. If no message was
@@ -167,14 +167,14 @@ def receive_full(self, wait=1):
167167
* a microsecond timestamp: the value returned by time.monotonic() when
168168
the message was received.
169169
170-
:param float wait: The length of time the radio listens for a
171-
broadcast
170+
:param float timeout: The length of time (in seconds) the radio listens for a broadcast
172171
173172
:return: A tuple representation of the received message, or else None.
173+
174174
"""
175175
try:
176176
for entry in self.ble.start_scan(
177-
_RadioAdvertisement, minimum_rssi=-255, timeout=wait, extended=True
177+
_RadioAdvertisement, minimum_rssi=-255, timeout=timeout, extended=True
178178
):
179179
# Extract channel and unique message ID bytes.
180180
chan, uid = struct.unpack("<BB", entry.msg[:2])

0 commit comments

Comments
 (0)