25
25
try :
26
26
from typing import Optional
27
27
import _bleio
28
- from circuitpython_typing import ReadableBuffer , WriteableBuffer
28
+ from circuitpython_typing import ReadableBuffer
29
29
except ImportError :
30
30
pass
31
31
@@ -112,7 +112,7 @@ def __init__(self, **args):
112
112
# Handle user related configuration.
113
113
self .configure (** args )
114
114
115
- def configure (self , channel : int = 42 ) -> ValueError :
115
+ def configure (self , channel : int = 42 ) -> ValueError :
116
116
"""
117
117
Set configuration values for the radio.
118
118
@@ -152,7 +152,7 @@ def send_bytes(self, message: bytes) -> None:
152
152
time .sleep (AD_DURATION )
153
153
self .ble .stop_advertising ()
154
154
155
- def receive (self , timeout : float = 1.0 ) -> str :
155
+ def receive (self , timeout : float = 1.0 ) -> Optional [ str ] :
156
156
"""
157
157
Returns a message received on the channel on which the radio is
158
158
listening.
@@ -166,7 +166,9 @@ def receive(self, timeout: float=1.0) -> str:
166
166
return msg [0 ].decode ("utf-8" ).replace ("\x00 " , "" )
167
167
return None
168
168
169
- def receive_full (self , timeout : float = 1.0 ) -> Optional [tuple [ReadableBuffer , int , float ]]:
169
+ def receive_full (
170
+ self , timeout : float = 1.0
171
+ ) -> Optional [tuple [ReadableBuffer , int , float ]]:
170
172
"""
171
173
Returns a tuple containing three values representing a message received
172
174
on the channel on which the radio is listening. If no message was
0 commit comments