23
23
24
24
"""
25
25
try :
26
- from typing import Optional
26
+ from typing import Optional , Tuple
27
27
import _bleio
28
28
from circuitpython_typing import ReadableBuffer
29
29
except ImportError :
@@ -79,7 +79,7 @@ def matches(cls, entry: _bleio.ScanEntry) -> bool:
79
79
)
80
80
81
81
@property
82
- def msg (self ) -> bytes :
82
+ def msg (self ) -> ReadableBuffer :
83
83
"""Raw radio data"""
84
84
if _RADIO_DATA_ID not in self .manufacturer_data .data :
85
85
return b""
@@ -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 ) -> None :
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 ) -> Optional [ str ] :
155
+ def receive (self , timeout : float = 1.0 ) -> str :
156
156
"""
157
157
Returns a message received on the channel on which the radio is
158
158
listening.
@@ -168,7 +168,7 @@ def receive(self, timeout: float = 1.0) -> Optional[str]:
168
168
169
169
def receive_full (
170
170
self , timeout : float = 1.0
171
- ) -> Optional [tuple [ReadableBuffer , int , float ]]:
171
+ ) -> Optional [Tuple [ReadableBuffer , int , float ]]:
172
172
"""
173
173
Returns a tuple containing three values representing a message received
174
174
on the channel on which the radio is listening. If no message was
0 commit comments