X-Git-Url: https://git.rvb.name/openhab-process.git/blobdiff_plain/37883fdd57e2246043ee9f1f4c4c488104216cb5..229358bcd45588510fe83e5d88142725b7218802:/mqtt-bt/scan-beacons diff --git a/mqtt-bt/scan-beacons b/mqtt-bt/scan-beacons index 210bcfb..d6d0d26 100644 --- a/mqtt-bt/scan-beacons +++ b/mqtt-bt/scan-beacons @@ -98,7 +98,10 @@ end function printLog(str) if logging=="yes" then capture("logger -t beaconmon \""..str.."\"") - else + print(str) + elseif logging=="syslog" then + capture("logger -t beaconmon \""..str.."\"") + elseif logging=="stdout" then print(str) end end @@ -113,12 +116,10 @@ end function open_dump() - run_command("/usr/bin/pkill btmon") - run_command("/usr/bin/pkill hcitool") - f = assert(io.popen ("/usr/bin/stdbuf -o0 /usr/bin/btmon")) + f = assert(io.popen ("/usr/bin/btmon")) run_command("hciconfig hci0 down") run_command("hciconfig hci0 up") - f_null = assert(io.popen ("hcitool lescan --duplicates --passive")) + f_null = assert(io.popen ("hcitool lescan --duplicates")) return f