Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Bluetooth scan devices doesn't refresh #15

Open
Traver72 opened this issue Jul 19, 2020 · 0 comments
Open

Bluetooth scan devices doesn't refresh #15

Traver72 opened this issue Jul 19, 2020 · 0 comments

Comments

@Traver72
Copy link

Traver72 commented Jul 19, 2020

Hello,

in my project i use the scan function of your plugin. However, devices which are no longer in the range or switched off will still be present in the response. I use the following code:

    scan_devices() {
      BluetoothSerial
      .scan()
      .then(response => {
        console.log("Scan: ", JSON.stringify(response));
        this.bluetooth_devices = response
      })
      .catch(() => {
        console.log('Error scanning devices');
        this.bluetooth_devices = null
      });
    },

   //call the func
   setInterval(function() {
      this.scan_devices()
    }.bind(this), 7500);

Results in the following response:

Devices { "devices": [ { "name": "SoundBuds", "address": "A8:06:BF:80:74:9B", "id": "A8:06:BF:80:74:9B", "class": 1028 }, { "address": "75:3C:0A:A6:05:A6", "id": "75:3C:0A:A6:05:A6", "class": 7936 }, { "address": "05:A5:2A:0E:97:44", "id": "05:A5:2A:0E:97:44", "class": 7936 }, { "address": "7F:5D:3B:32:C3:D8", "id": "7F:5D:3B:32:C3:D8", "class": 7936 } ] }

Even if i turn of the "SoundBuds", they are still present on the next scan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant