-#!/usr/bin/env lua
+#!/usr/bin/lua
function getConfig(configname)
end
if type=="ibeacon" then
printLog(string.format("{type:'ibeacon',mac:'%s',uuid:'%s',major:'%s',minor:'%s',power:%d,tx:%d}",mac,uuid,major,minor,power,tx))
- details=uuid..'/'..major..'/'..minor..'/'
+ details=uuid..'/'..major..'/'..minor
else
type='unknown'
details=dump(bytes)
printLog(details)
end
if mqtt_client then
+ if not mqtt_client.connected then
+ mqtt_client:connect(mqtt_id)
+ end
mqtt_path=string.gsub(mqtt_topic,"{(.-)}",
function (name)
if name=="type" then
if mqtt_user then
mqtt_client:auth(mqtt_user, mqtt_passwd)
end
- mqtt_client:connect(mqtt_id)
end
inp = open_dump()