edrosten / libblepp

Modern clean C++ Bluetooth Low Energy on Linux without the Bluez DBUS API
Other
239 stars 62 forks source link

getting error/exception whenever trying to stop() a running HCIScanner #62

Open vleeb opened 2 years ago

vleeb commented 2 years ago

Hi, thank you for this nice library. Whenever I try to stop() a running HCIScanner I am getting:

Error disabling scan:: Connection timed out
terminate called after throwing an instance of 'BLEPP::HCIScanner::IOError'
  what():  Error disabling scan:: Connection timed out

Am I doing anything wrong, or is this a bug? You have some nice examples for using the HCIScanner, but they do not use the stop() function at all.

I was able to fix this problem by using the err = hci_close_dev(hci_fd); within the stop() function instead of calling hci_le_set_scan_enable(...) there ... ... but then I had to move hci_open_dev(dev_id) from constructor() to start().