📡 Web Bluetooth API Playground

Scan for Bluetooth Low Energy devices, explore GATT services and characteristics, and perform read/write/notify operations.

🔎 Request Device

Use navigator.bluetooth.requestDevice() to prompt the user to select a BLE device. Requires a user gesture.

📱 Device Info

🔴
No device connected
Scan for a device to connect

🌳 GATT Service / Characteristic Explorer

After connecting, discover GATT services and their characteristics. You can read, write, and subscribe to notifications.

Connect to a device and click "Discover Services" to explore.

📖 Known Service UUIDs

Standard Bluetooth GATT service UUIDs. Click to copy.

⚠️ Error Handling Patterns

NotFoundError

User cancelled the device picker or no matching device found.

try {
  device = await navigator.bluetooth.requestDevice(opts);
} catch (e) {
  if (e.name === 'NotFoundError') {
    // User cancelled or no device
  }
}

SecurityError

Not in a secure context (HTTPS) or missing user gesture.

// Must be called from user interaction
button.onclick = () => {
  navigator.bluetooth.requestDevice(opts);
};

NetworkError

GATT connection failed. Device may be out of range.

device.gatt.connect().catch(e => {
  if (e.name === 'NetworkError') {
    // Retry or notify user
  }
});

NotSupportedError

Requested service/characteristic not available on device.

// Always list required services in filters
// and optional services in optionalServices

📜 Event Log

[Ready] Web Bluetooth API Playground loaded.