3 Replies Latest reply on Aug 2, 2015 6:06 PM by dump_truck

    Bluetooth Low Energy device scan while non-root user


      Hey Edison family,


      I'm using my Edison as a BLE master which connects to a peripheral device. I've actually gotten all the code that connects the device and writes to various characteristics functioning, but that's with a hard-coded device address. I can run this code as any user.


      I'm trying to add functionality to scan for local BLE peripherals, then choose the device to connect to according to an arbitrary set of criteria. The command:


      hcitool lescan


      and it's associated BlueZ method calls (hci_le_set_scan_parameters(), hci_le_set_scan_enable()) work perfectly for this, but only when I run them as root. If I try and run anything as another user, I get an Operation Not Permitted error. I've tried setting rwx permissions on everything in the /sys/class/bluetooth/hci0 folder, and that doesn't seem to help. I've also seen some talk on SO and other forums about Capabilities.


      Does anybody have some advice on how to expose this functionality to non-root users?