fix: export open function
This commit is contained in:
parent
18875eb860
commit
0d88c472fa
10
mqtt.lua
10
mqtt.lua
|
@ -1,4 +1,4 @@
|
|||
local net = require("internet")
|
||||
local mqtt = {}
|
||||
|
||||
local read_varint = function (conn, first_byte)
|
||||
local b
|
||||
|
@ -26,10 +26,10 @@ local read_varint = function (conn, first_byte)
|
|||
return n + (b << s), nil
|
||||
end
|
||||
|
||||
local MqttClient
|
||||
local MqttClient = {}
|
||||
|
||||
function open (address, port)
|
||||
local conn = net.open(address, port)
|
||||
function mqtt.open (address, port)
|
||||
local conn = require("internet").open(address, port)
|
||||
if conn == nil then
|
||||
return nil, "connection failed"
|
||||
end
|
||||
|
@ -171,3 +171,5 @@ function MqttClient:disconnect (reason)
|
|||
|
||||
return nil
|
||||
end
|
||||
|
||||
return mqtt
|
||||
|
|
Loading…
Reference in New Issue