edrosten / libblepp

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

I/O error & Switching off HCI scanner #64

Closed saeedamiri92 closed 2 years ago

saeedamiri92 commented 2 years ago

Hi, I trying to run "lescan_simple" from examples. the environment is ubuntu 20.04 in VM. I compiled and ran the program, but I got an error and execution aborted with following msg.

warn  1643202449.692793: Received I/O error while setting scan parameters.
warn  1643202449.692880: Switching off HCI scanner
error 1643202449.695767: Error disabling scan:: Input/output error
terminate called after throwing an instance of 'BLEPP::HCIScanner::IOError'
  what():  Error disabling scan:: Input/output error
Aborted

the problem related to HCIScanner of bellow command: BLEPP::HCIScanner scanner;

Can anyone help me to fix the problem? any idea

edrosten commented 2 years ago

Are you running as root?

saeedamiri92 commented 2 years ago

Are you running as root?

YES

saeedamiri92 commented 2 years ago

I have completed the following steps:

  1. clone
  2. cmake
  3. make install
  4. compile by: g++ lescan_simple.cc -o lescan_simple --std=c++11 -lble++ -lbluetooth
edrosten commented 2 years ago

Hard to tell. Something else might also be connected to the control mode of the bluetooth adapter (try disabling all bluetooth services), or possibly the VM has insufficient permissions on the device: according to the HCI protocol setting/disabling scanning has the same level of access as that needed to snoop on all traffic.

On Sat, 29 Jan 2022 at 12:39, saeedamiri92 @.***> wrote:

I have completed the following steps:

  1. clone
  2. cmake
  3. make install
  4. compile by: g++ lescan_simple.cc -o lescan_simple --std=c++11 -lble++ -lbluetooth

— Reply to this email directly, view it on GitHub https://github.com/edrosten/libblepp/issues/64#issuecomment-1024904254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZN26QYOXZYG6Q3TIRLJDUYPNZFANCNFSM5M3BGWQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

saeedamiri92 commented 2 years ago

Yes, that's right. I tested this library on an Ubuntu that installed directly on the system and found no errors.