Navideck / universal_ble

A cross-platform Android/iOS/macOS/Windows/Linux/Web Bluetooth Low Energy (BLE) plugin for Flutter
https://pub.dev/packages/universal_ble
Other
19 stars 2 forks source link

Scanning with services #13

Closed martin-robert-fink closed 2 months ago

martin-robert-fink commented 2 months ago

I can't seem to find a way to scan for devices that only support a specific service (like an HR monitor). It looks like I'd have to scan, connect, discover services, then disconnect if it doesn't support the services I want. This doesn't seem like a very efficient way to do this.

Is there a way to scan and check services at the same time without having to connect to the device to get the list of services?

What am I missing?

Thanks, Martin

fotiDim commented 2 months ago

@martin-robert-fink which OS are you targeting? Does your HR monitor list the supported services in the advertisement data?

martin-robert-fink commented 2 months ago

Hi - Yes it does. But, when I look at the BleScanResult class, there is no list of ServiceUUIDs member. So, how do I scan for BLE devices and filter on a specific serviceUUID so that only those devices (in my example HR Monitors) show up, or are returned in the list of discovered devices?

fotiDim commented 2 months ago

We need to expose this functionality in Dart. Which OS are you targeting?

martin-robert-fink commented 2 months ago

Right now, iOS and MacOS. Goal is to also support Android.

mortenboye commented 2 months ago

I would love this for Windows as well.

fotiDim commented 2 months ago

We have published 0.9.3 which adds the requested feature. Feel free to reopen if it does not work for you.