demo · v138

Protocol explorer

Chrome 138 brings Web Serial to Bluetooth RFCOMM on Android. This terminal opens a real serial port, configures baud rate / parity / data bits, reads getInfo(), and sends binary frames to the selected device.

checking support…

SerialPort.getInfo()

usbVendorId usbProductId bluetoothServiceClassId transport stateclosed

Binary frame builder

Frame preview (hex bytes)
[sys] Web Serial protocol explorer ready. Connect to a port to begin.

the code

// Request a serial port (USB or Bluetooth RFCOMM on Android/138+)
const port = await navigator.serial.requestPort();

// Open with parameters
await port.open({
  baudRate: 115200,
  dataBits: 8,
  stopBits: 1,
  parity: 'none',
  flowControl: 'none',
  bufferSize: 1024,
});

// Inspect the port
const info = port.getInfo();
// { usbVendorId, usbProductId } for USB
// { bluetoothServiceClassId } for Bluetooth RFCOMM (Chrome 138+ Android)

// Write a binary frame
const writer = port.writable.getWriter();
await writer.write(new Uint8Array([0xAA, 0xBB, 0x48, 0x45, 0x4C, 0x4C, 0x4F]));
writer.releaseLock();

see also