libblepp
libblepp copied to clipboard
Setting scan parameters: Operation not permitted
$ examples/lescan
error 1611577006.276827: Setting scan parameters: Operation not permitted
terminate called after throwing an instance of 'BLEPP::HCIScanner::IOError'
what(): Setting scan parameters: Operation not permitted
Aborted (core dumped)
It looks like libblepp nees to be used with sudo in a default setup for me. Is this an inherent limitation of the non-dbus approach?
I don't know the answer to your question, but this post gave me a work-around.
Assuming you have libcap installed, the following line will give the lescan_simple the permissions it needs:
sudo setcap 'cap_net_raw,cap_net_admin+eip' lescan_simple
There could very well be better fixes to the sudo issue, but this is doing the job for me until I find one.
Thanks for the workaround. I'd always used sudo. I assumed dbus was needed for communication with a daemon running as root.