Request Bluetooth Device
Request a connection to a LEGO hub — the user will see a browser popup to select their device
// Request connection to a LEGO hub
const device = await navigator.bluetooth.requestDevice({
filters: [
{ namePrefix: 'LEGO' },
{ services: ['00001623-1212-efde-1623-785feabcd123'] }
],
optionalServices: ['00001623-1212-efde-1623-785feabcd123']
});
console.log('Connected to:', device.name);