Skip to content

Commit

Permalink
changed BT filter
Browse files Browse the repository at this point in the history
  • Loading branch information
puttley committed Apr 24, 2024
1 parent b76ca63 commit d77876a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function onDevice() {
// Array of names to filter for
var namesToFilterFor = ['SEEKER', 'ESP32', 'MPY'];
// Create an array of filters for each name
var filterr = namesToFilterFor.map(name => ({ namePrefix: name }));
var filter_list = namesToFilterFor.map(name => ({ namePrefix: name }));

async function connect() {
if (device && device.gatt.connected) {
Expand All @@ -131,7 +131,7 @@ async function connect() {
navigator.bluetooth.requestDevice({

// filters:[{namePrefix: [DEVICE_BT_NAME_PREFIX]}],
filters: filterr,
filters: filter_list,

// acceptAllDevices:true,
optionalServices: [NUS_SERVICE_UUID]
Expand Down

0 comments on commit d77876a

Please sign in to comment.