demo · v138
Connection Diagnostics
Web Serial over Bluetooth on Android (Chrome 138) brings the full SerialPort API to Bluetooth Classic (SPP) devices. This page lets you explore baud rate options, expected throughput, connection settings, and the serialPort event lifecycle — all without needing a physical device.
Checking Web Serial API…
SerialPort options explorer
Baud rate
Data bits
Parity
Stop bits
Flow control
Buffer size
Baud rate comparison
serialPort event lifecycle
→ requestPort() →
→ open() →
→ close() →
Click a state to see what happens at that step.
// Web Serial over Bluetooth — Chrome 138 (Android)
// Works with devices that expose a Bluetooth SPP profile
// 1. Request port (shows BT device picker on Android)
const port = await navigator.serial.requestPort({
// Optionally filter to specific BT Classic services
// filters: [{ bluetoothServiceClassId: '...' }]
});
// 2. Open with your device's baud rate
await port.open({
baudRate: 9600, // must match device
dataBits: 8,
parity: 'none',
stopBits: 1,
flowControl: 'none',
bufferSize: 4096
});
// 3. Read data
const reader = port.readable.getReader();
while (true) {
const { value, done } = await reader.read();
if (done) break;
console.log(new TextDecoder().decode(value));
}
// 4. Write data
const writer = port.writable.getWriter();
await writer.write(new TextEncoder().encode('AT+NAME?\r\n'));
writer.releaseLock();
// 5. Close
await port.close();