6262//| Use `_bleio.adapter` to access the sole instance already available.
6363//| """
6464//| ...
65+ //|
6566static mp_obj_t bleio_adapter_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
6667 #if CIRCUITPY_BLEIO_HCI
6768 bleio_adapter_obj_t * self = common_hal_bleio_allocate_adapter_or_raise ();
@@ -135,6 +136,7 @@ MP_PROPERTY_GETSET(bleio_adapter_address_obj,
135136//| """name of the BLE adapter used once connected.
136137//| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``,
137138//| to make it easy to distinguish multiple CircuitPython boards."""
139+ //|
138140static mp_obj_t _bleio_adapter_get_name (mp_obj_t self ) {
139141 return MP_OBJ_FROM_PTR (common_hal_bleio_adapter_get_name (self ));
140142}
@@ -161,7 +163,7 @@ MP_PROPERTY_GETSET(bleio_adapter_name_obj,
161163//| timeout: int = 0,
162164//| interval: float = 0.1,
163165//| tx_power: int = 0,
164- //| directed_to: Optional[Address] = None
166+ //| directed_to: Optional[Address] = None,
165167//| ) -> None:
166168//| """Starts advertising until `stop_advertising` is called or if connectable, another device
167169//| connects to us.
@@ -181,6 +183,7 @@ MP_PROPERTY_GETSET(bleio_adapter_name_obj,
181183//| :param int tx_power: transmitter power while advertising in dBm
182184//| :param Address directed_to: peer to advertise directly to"""
183185//| ...
186+ //|
184187static mp_obj_t bleio_adapter_start_advertising (mp_uint_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
185188 bleio_adapter_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
186189
@@ -243,6 +246,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_advertising_obj, 1, bleio_
243246//| def stop_advertising(self) -> None:
244247//| """Stop sending advertising packets."""
245248//| ...
249+ //|
246250static mp_obj_t bleio_adapter_stop_advertising (mp_obj_t self_in ) {
247251 bleio_adapter_obj_t * self = MP_OBJ_TO_PTR (self_in );
248252
@@ -262,7 +266,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapt
262266//| interval: float = 0.1,
263267//| window: float = 0.1,
264268//| minimum_rssi: int = -80,
265- //| active: bool = True
269+ //| active: bool = True,
266270//| ) -> Iterable[ScanEntry]:
267271//| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are
268272//| filtered and returned separately.
@@ -282,6 +286,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapt
282286//| :returns: an iterable of `_bleio.ScanEntry` objects
283287//| :rtype: iterable"""
284288//| ...
289+ //|
285290static mp_obj_t bleio_adapter_start_scan (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
286291 enum { ARG_prefixes , ARG_buffer_size , ARG_extended , ARG_timeout , ARG_interval , ARG_window , ARG_minimum_rssi , ARG_active };
287292 static const mp_arg_t allowed_args [] = {
@@ -346,6 +351,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter
346351//| def stop_scan(self) -> None:
347352//| """Stop the current scan."""
348353//| ...
354+ //|
349355static mp_obj_t bleio_adapter_stop_scan (mp_obj_t self_in ) {
350356 bleio_adapter_obj_t * self = MP_OBJ_TO_PTR (self_in );
351357
@@ -381,6 +387,7 @@ MP_PROPERTY_GETTER(bleio_adapter_connected_obj,
381387//| connections: Tuple[Connection]
382388//| """Tuple of active connections including those initiated through
383389//| :py:meth:`_bleio.Adapter.connect`. (read-only)"""
390+ //|
384391static mp_obj_t bleio_adapter_get_connections (mp_obj_t self ) {
385392 return common_hal_bleio_adapter_get_connections (self );
386393}
@@ -395,6 +402,7 @@ MP_PROPERTY_GETTER(bleio_adapter_connections_obj,
395402//| :param Address address: The address of the peripheral to connect to
396403//| :param float/int timeout: Try to connect for timeout seconds."""
397404//| ...
405+ //|
398406static mp_obj_t bleio_adapter_connect (mp_uint_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
399407 bleio_adapter_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
400408
@@ -418,6 +426,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 1, bleio_adapter_co
418426//| """Erase all bonding information stored in flash memory."""
419427//| ...
420428//|
429+ //|
421430static mp_obj_t bleio_adapter_erase_bonding (mp_obj_t self_in ) {
422431 bleio_adapter_obj_t * self = MP_OBJ_TO_PTR (self_in );
423432
0 commit comments