davidgyoung / ble-scanner

Bluetooth LE scanning CLI tool for Linux/BlueZ
BSD 3-Clause "New" or "Revised" License
19 stars 6 forks source link

bulletproof termination after set amount of time [ of inactivity ] #4

Closed m4444x closed 1 year ago

m4444x commented 1 year ago

Implemented a new method to make sure that the program is terminated after a set amount of time has passed. It works by setting a timer via alert() and it should be bulletproof under all conditions.

Also adds the ability to choose between continuous and non-continuous scanning. In non-continuous mode it will terminate when the time is up while in continuous mode it will reset the timer every time a beacon is detected. The timer can also be disabled by setting the timeout <= 0.

m4444x commented 1 year ago

Added a few things to mimic the old behaviour ( exit code 0, 10 seconds timeout ). So it should be a drop in replacement for people using the original program in their scripts.