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

Linux: Device not reporting all services #31

Closed mortenboye closed 1 month ago

mortenboye commented 1 month ago

I am trying to use Universal_Ble on Linux and have observed the following issue:

When scanning for devices with filtering on services: UniversalBle.startScan(scanFilter: ScanFilter(withServices: [MY_SERVICE_ID]));

The intended devices are being discovered and I can connect to them. However, when discovering their services, the service which was used for the filtering of the scan is not being reported. In my case only two services are listed:

flutter: Service: 0000180a-0000-1000-8000-00805f9b34fb
flutter: Service: 00001801-0000-1000-8000-00805f9b34fb

And I expected to see a third with the uuid corresponding to my MY_SERVICE_ID value.

Scanning without the filter, yields the same results.

Maybe related, I am seeing this in the log as well:

[UniversalBle] UnhandledDevicePropertyChanged MyBLEDevice - MIDI CB:81:F4:3B:FB:4F: Name
[UniversalBle] UnhandledDevicePropertyChanged MyBLEDevice - MIDI CB:81:F4:3B:FB:4F: Alias
mortenboye commented 1 month ago

After further troubleshooting and googling, this seems to be an issue with my BlueZ installation. Will close this issue for now.

mortenboye commented 1 month ago

Reopened, as it appears that BlueZ does in fact see the services correctly.

This from the terminal after connecting to my device:

[CHG] Device CB:81:F4:3B:FB:4F UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device CB:81:F4:3B:FB:4F UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device CB:81:F4:3B:FB:4F UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device CB:81:F4:3B:FB:4F UUIDs: 03b80e5a-ede8-4b33-a751-6ce34ec4c700
[CHG] Device CB:81:F4:3B:FB:4F ServicesResolved: yes

How can it be that I don't see the same through Universal_ble?

mortenboye commented 1 month ago

Reclosing. This is a Linux configuration issue.

fotiDim commented 1 month ago

@mortenboye what kind of configuration was needed? It might be useful for others.

mortenboye commented 1 month ago

@mortenboye what kind of configuration was needed? It might be useful for others.

I'm still not completely sure. Trying to work with BLE MIDI devices and not interested in using the builtin BlueZ profiles.

fotiDim commented 1 month ago

That's a cool use case. Unfortunately I don't have any BLE MIDI device to check. From what I read the latest bluez versions support MIDI. If you manage to find what kind of configuration is needed let's document it.