kakzaki / blue_thermal_printer

Working with thermal printer via bluetooth (Flutter)
MIT License
164 stars 205 forks source link

How to filter getBondedDevices() to printer devices only? #137

Closed fuadreza closed 2 years ago

fuadreza commented 2 years ago

Hello, I'm want to know if there is a way to filter devices to bluetooth printer only.

In my case I already pair my android to my laptop and when I get a list from getBondedDevices() there is also my laptop in the results.

Thank you.

Aronastu commented 2 years ago

same issue any progress ? as it name indicate it should only filter printer, not all the Bluetooth devices, can you let us know any progress has been taken, thanks

fuadreza commented 2 years ago

Hello @Aronastu , I ended up using another package flutter_bluetooth_serial. In there you could find on the package code, there is already a attribute in the BluetoothDevice class called device_class but it's commented, and you should uncomment that to work with DeviceClass.

And from here, you could filter the scanned result with specific device_class.

Since the original package not maintained, I fork the repo and made a change myself. You could find it here