65
65
//| connections and also initiate connections."""
66
66
//|
67
67
68
- //| def __init__(self, ) :
68
+ //| def __init__(self) -> None :
69
69
//| """You cannot create an instance of `_bleio.Adapter`.
70
70
//| Use `_bleio.adapter` to access the sole instance available."""
71
71
//| ...
72
72
//|
73
73
74
- //| enabled: Any = ...
74
+ //| enabled: bool = ...
75
75
//| """State of the BLE adapter."""
76
76
//|
77
77
STATIC mp_obj_t bleio_adapter_get_enabled (mp_obj_t self ) {
@@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = {
95
95
(mp_obj_t )& mp_const_none_obj },
96
96
};
97
97
98
- //| address: Any = ...
98
+ //| address: Address = ...
99
99
//| """MAC address of the BLE adapter. (read-only)"""
100
100
//|
101
101
STATIC mp_obj_t bleio_adapter_get_address (mp_obj_t self ) {
@@ -111,7 +111,7 @@ const mp_obj_property_t bleio_adapter_address_obj = {
111
111
(mp_obj_t )& mp_const_none_obj },
112
112
};
113
113
114
- //| name: Any = ...
114
+ //| name: str = ...
115
115
//| """name of the BLE adapter used once connected.
116
116
//| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``,
117
117
//| to make it easy to distinguish multiple CircuitPython boards."""
@@ -135,7 +135,7 @@ const mp_obj_property_t bleio_adapter_name_obj = {
135
135
(mp_obj_t )& mp_const_none_obj },
136
136
};
137
137
138
- //| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> Any :
138
+ //| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None :
139
139
//| """Starts advertising until `stop_advertising` is called or if connectable, another device
140
140
//| connects to us.
141
141
//|
@@ -202,7 +202,7 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t
202
202
}
203
203
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (bleio_adapter_start_advertising_obj , 2 , bleio_adapter_start_advertising );
204
204
205
- //| def stop_advertising(self, ) -> Any :
205
+ //| def stop_advertising(self) -> None :
206
206
//| """Stop sending advertising packets."""
207
207
//| ...
208
208
//|
@@ -215,7 +215,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) {
215
215
}
216
216
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (bleio_adapter_stop_advertising_obj , bleio_adapter_stop_advertising );
217
217
218
- //| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any :
218
+ //| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> iterable :
219
219
//| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are
220
220
//| filtered and returned separately.
221
221
//|
@@ -288,7 +288,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args
288
288
}
289
289
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (bleio_adapter_start_scan_obj , 1 , bleio_adapter_start_scan );
290
290
291
- //| def stop_scan(self, ) -> Any :
291
+ //| def stop_scan(self) -> None :
292
292
//| """Stop the current scan."""
293
293
//| ...
294
294
//|
@@ -301,7 +301,7 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) {
301
301
}
302
302
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (bleio_adapter_stop_scan_obj , bleio_adapter_stop_scan );
303
303
304
- //| advertising: Any = ...
304
+ //| advertising: bool = ...
305
305
//| """True when the adapter is currently advertising. (read-only)"""
306
306
//|
307
307
STATIC mp_obj_t bleio_adapter_get_advertising (mp_obj_t self ) {
@@ -317,7 +317,7 @@ const mp_obj_property_t bleio_adapter_advertising_obj = {
317
317
(mp_obj_t )& mp_const_none_obj },
318
318
};
319
319
320
- //| connected: Any = ...
320
+ //| connected: bool = ...
321
321
//| """True when the adapter is connected to another device regardless of who initiated the
322
322
//| connection. (read-only)"""
323
323
//|
@@ -334,7 +334,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = {
334
334
(mp_obj_t )& mp_const_none_obj },
335
335
};
336
336
337
- //| connections: Any = ...
337
+ //| connections: tuple = ...
338
338
//| """Tuple of active connections including those initiated through
339
339
//| :py:meth:`_bleio.Adapter.connect`. (read-only)"""
340
340
//|
@@ -350,7 +350,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = {
350
350
(mp_obj_t )& mp_const_none_obj },
351
351
};
352
352
353
- //| def connect(self, address: Address, *, timeout: float/int) -> Any :
353
+ //| def connect(self, address: Address, *, timeout: float/int) -> Connection :
354
354
//| """Attempts a connection to the device with the given address.
355
355
//|
356
356
//| :param Address address: The address of the peripheral to connect to
@@ -380,7 +380,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args
380
380
}
381
381
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (bleio_adapter_connect_obj , 2 , bleio_adapter_connect );
382
382
383
- //| def erase_bonding(self, ) -> Any :
383
+ //| def erase_bonding(self) -> None :
384
384
//| """Erase all bonding information stored in flash memory."""
385
385
//| ...
386
386
//|
0 commit comments