@@ -162,7 +162,9 @@ def __init__(self, adapter=None):
162
162
self ._current_advertisement = None
163
163
self ._connection_cache = {}
164
164
165
- def start_advertising (self , advertisement , scan_response = None , interval = 0.1 , timeout = 0 ):
165
+ def start_advertising (
166
+ self , advertisement , scan_response = None , interval = 0.1 , timeout = None
167
+ ):
166
168
"""
167
169
Starts advertising the given advertisement.
168
170
@@ -171,7 +173,7 @@ def start_advertising(self, advertisement, scan_response=None, interval=0.1, tim
171
173
`BLERadio.name` and `BLERadio.tx_power`.
172
174
:param float interval: advertising interval, in seconds
173
175
:param int timeout: advertising timeout in seconds.
174
- If 0 , no timeout.
176
+ If None , no timeout.
175
177
"""
176
178
advertisement_bytes = bytes (advertisement )
177
179
scan_response_bytes = b""
@@ -181,6 +183,7 @@ def start_advertising(self, advertisement, scan_response=None, interval=0.1, tim
181
183
scan_response .tx_power = self .tx_power
182
184
if scan_response :
183
185
scan_response_bytes = bytes (scan_response )
186
+ timeout = 0 if timeout is None else timeout
184
187
self ._adapter .start_advertising (
185
188
advertisement_bytes ,
186
189
scan_response = scan_response_bytes ,
@@ -327,5 +330,5 @@ def address_bytes(self):
327
330
328
331
@property
329
332
def advertising (self ):
330
- """The adverstising state"""
333
+ """The advertising state"""
331
334
return self ._adapter .advertising
0 commit comments