gatt.connect() should be cancelableThis page tests whether BluetoothRemoteGATTServer.disconnect() cancels a pending Web Bluetooth gatt.connect() attempt. The ESP32-C3 test device advertises as dino c(h)ancler.
Use this page over HTTPS. Web Bluetooth is not available from an insecure origin.
First select the ESP32-C3 while it is advertising. Then make it unavailable and try canceling a pending connect.
gatt.connect() starts while the known device is unavailable.Disconnect / cancel pending connect should make the pending promise reject promptly with AbortError.requestDevice() and a connect attempt to another BLE device should still work without reloading the page.The firmware and source for this sampler live in the tester repository. It exposes one BLE GATT service and serial commands to stop advertising, disconnect the central, or enter deep sleep.
cd firmware/arduino-esp32c3
pio run -t upload
pio device monitor
serial commands:
a - start advertising
s - stop advertising
d - disconnect central
z - stop advertising, disconnect, deep sleep
r - restart