Skip to content

Commit

Permalink
Note a required workaround for gatttool with sudoless operation
Browse files Browse the repository at this point in the history
Fixes #282
  • Loading branch information
peplin committed Feb 21, 2021
1 parent 9f3838e commit 538c24f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pygatt/backends/gatttool/gatttool.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def start(self, reset_on_start=True, initialization_timeout=3):
:param bool reset_on_start: Perhaps due to a bug in gatttol or pygatt,
but if the bluez backend isn't restarted, it can sometimes lock up
the computer when trying to make a connection to HCI device.
the computer when trying to make a connection to HCI device. This
requires 'sudo'.
:param int initialization_timeout: Seconds to wait for the gatttool
prompt. This should appear almost instantly, but on some HCI devices
it may take longer to start up.
Expand Down Expand Up @@ -395,6 +396,9 @@ def kill(self):
# scanning as a non-root user:
#
# $ sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool`
#
# You must call start(reset_on_start=False) when trying to run without
# sudo as the reset workaround requires sudo.
try:
self._scan.kill(signal.SIGINT)

Expand Down

0 comments on commit 538c24f

Please sign in to comment.