diff --git a/lib/bluetooth.ts b/lib/bluetooth.ts index 342f20b..cfced42 100644 --- a/lib/bluetooth.ts +++ b/lib/bluetooth.ts @@ -56,7 +56,6 @@ export class MicrobitWebBluetoothConnection this.availability = value; }; private availability: boolean | undefined; - private nameFilter: string | undefined; constructor(options: MicrobitWebBluetoothConnectionOptions = {}) { super(); @@ -175,9 +174,7 @@ export class MicrobitWebBluetoothConnection this.setStatus(ConnectionStatus.CONNECTED); } - setNameFilter(name: string) { - this.nameFilter = name; - } + setNameFilter(name: string) {} private async chooseDevice(): Promise { if (this.device) { @@ -189,13 +186,7 @@ export class MicrobitWebBluetoothConnection // TODO: give control over this to the caller const result = await Promise.race([ navigator.bluetooth.requestDevice({ - filters: [ - { - namePrefix: this.nameFilter - ? `BBC micro:bit [${this.nameFilter}]` - : "BBC micro:bit", - }, - ], + acceptAllDevices: true, optionalServices: [ profile.accelerometer.id, profile.button.id,