function mqtt_encode(str)
if (str) then
str = string.gsub (str, "\n", "")
+ str = string.gsub (str, ":", "-")
str = string.gsub (str, "/", "-")
+ str = string.gsub (str, " ", "_")
end
return str
end
function open_dump()
- f = assert(io.popen ("hcidump --raw"))
- run_command("kill `pgrep hcitool`")
- run_command("hciconfig hci0 down")
- run_command("hciconfig hci0 up")
- f_null = assert(io.popen ("hcitool lescan --duplicates"))
+ run_command("/bin/kill `/usr/bin/pgrep hcidump`")
+ run_command("/bin/kill `/usr/bin/pgrep hcitool`")
+ f = assert(io.popen ("/usr/bin/hcidump --raw"))
+ run_command("/usr/bin/hciconfig hci0 down")
+ run_command("/usr/bin/hciconfig hci0 up")
+ f_null = assert(io.popen ("/usr/bin/hcitool lescan --duplicates"))
return f