I have maybe a weird question but I need to know this. Im creating a lua script to connect esp8266 and my mqtt broker. The example script is very straight forward.
m = mqtt.Client("clientid", 120, "user", "password")
m:lwt("/lwt", "offline", 0, 0)
m:on("connect", function(con) print ("connected") end)
m:on("offline", function(con) print ("offline") end)
m:on("message", function(conn, topic, data)
print(topic .. ":" )
if data ~= nil then
print(data)
end
end)
m:connect("192.168.11.118", 1880, 0, function(conn)
print("connected")
end)
m:subscribe("/topic",0, function(conn)
print("subscribe success")
end)
m:publish("/topic","hello",0,0, function(conn)
print("sent")
end)
m:close();
But... there is one thing I can't get over. That is the "con" and "conn" parameter? It looks like an instance or something, but there is no such a thing defined. Can somebody explain this to me?