Web Bluetooth pending connect cancel sampler

#40502943 Filed 2017-01-23 Assigned Related CL 6798921 merged

Purpose

manual hardware sampler

Pending gatt.connect() should be cancelable

This 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.

Live tester

Controls

First select the ESP32-C3 while it is advertising. Then make it unavailable and try canceling a pending connect.



Expected result

  1. gatt.connect() starts while the known device is unavailable.
  2. Clicking Disconnect / cancel pending connect should make the pending promise reject promptly with AbortError.
  3. After cancellation, requestDevice() and a connect attempt to another BLE device should still work without reloading the page.

Firmware

ESP32-C3 device firmware

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.

Tester firmware repository Download patched ChromePublic ARM64 APK APK SHA-256 Chromium issue Merged CL 6798921
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