weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
89 stars 22 forks source link

Ubuntu 22.10: Discovering starts only after disable and enable the bluetooth adapter #57

Closed freibauer closed 2 months ago

freibauer commented 2 months ago

I am using the example and adapted the filters for my device. If the bluetooth adapter is disabled the example is not starting. If the bluetooth adapter is enabled the example is starting the discovering but nothing happens. If i disable and enable the adapter (with the Ubuntu-GUI) during discover the discovering is starting and the example is pairing. Perhaps rfkill needs to be used in the correct moment, but i am not sure when.

martijnvanwelie commented 2 months ago

Please share relevant code and log.

weliem commented 2 months ago

try rfkill unblock bluetooth before running your app.....

freibauer commented 2 months ago

Many thanks for the quick replies. I get a start-script with the unblock to work. Which looks like: sudo hciconfig hci0 down; sudo rfkill unblock bluetooth ; sudo hciconfig up ; sudo ./central