ble icon indicating copy to clipboard operation
ble copied to clipboard

Filters?

Open Stan92 opened this issue 5 years ago • 9 comments

Hi,

Nativescript-bluetooth version : 3.0.0-beta.10

Using a filter to the startScanning method, I can't find my devices. Do I miss something?

       const filters=[{serviceUUID:'5001'}];
        const seconds=3;
        bluetooth.startScanning(
            {
             filters,
             seconds,
              onDiscovered:(peripheral:Peripheral)=>{
                   console.log(peripheral);
              },
              skipPermissionCheck:false
        }).then(
            (res)=>{
                console.log("ble scan terminé");
            },
            (err)=>{
                console.log("err",err,true);
            });

Stan92 avatar Apr 16 '20 18:04 Stan92

What kind of device you are trying to connect? Where did you find the service UUID from? 5001 is something not listed in the spec.

manojdcoder avatar Apr 17 '20 08:04 manojdcoder

It’s a esp32 part with a customized code

Stan92 avatar Apr 17 '20 08:04 Stan92

Do you find the specific device on list if you do not apply filters?

manojdcoder avatar Apr 17 '20 08:04 manojdcoder

Yes I can see it, connect, read the services and characteristics Everything works except the filters Btw thanks for the package

Stan92 avatar Apr 17 '20 09:04 Stan92

Did you test on both iOS & Android? Is it platform specific?

manojdcoder avatar Apr 17 '20 16:04 manojdcoder

I only tested on Android.

Stan92 avatar Apr 17 '20 16:04 Stan92

Are you able to perform a read / write with the service id?

manojdcoder avatar Apr 17 '20 16:04 manojdcoder

Yes for the read (I don't have a write) Everything perfectly works except the filters :) I have also noticed, the Peripheral doesn't have the state property (within the interface). But if I log the object, I get these following properties type,UUID,name,RSSI,localName,state,manufacterId,advertismentData

Stan92 avatar Apr 17 '20 16:04 Stan92

Hi, It seems it doesn't work too with iOS (probably I missed something). I also tried with a "standard" service UUID (coming from my MacBook Pro).

Stan92 avatar May 01 '20 09:05 Stan92