Skip to content

Commit 3e85cfe

Browse files
committed
Fix ESP and HCI build
1 parent 269d51d commit 3e85cfe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

devices/ble_hci/common-hal/_bleio/__init__.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ bool vm_used_ble;
5757
// }
5858
// }
5959

60+
void bleio_user_reset() {
61+
// HCI doesn't support the BLE workflow so just do a full reset.
62+
bleio_reset();
63+
}
64+
6065
// Turn off BLE on a reset or reload.
6166
void bleio_reset() {
6267
// Create a UUID object for all CCCD's.

ports/espressif/common-hal/_bleio/Adapter.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,9 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool
574574
}
575575

576576
void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) {
577+
if (!common_hal_bleio_adapter_get_advertising(self)) {
578+
return;
579+
}
577580
int err_code = ble_gap_ext_adv_stop(0);
578581
self->user_advertising = false;
579582

0 commit comments

Comments
 (0)