forked from luca/mineqtt
style: convert snake_case to camelCase
This commit is contained in:
parent
f9b8ecf600
commit
26c6b24c78
6
mqtt.lua
6
mqtt.lua
|
@ -1,6 +1,6 @@
|
||||||
local mqtt = {}
|
local mqtt = {}
|
||||||
|
|
||||||
local read_varint = function (conn, first_byte)
|
local readVarint = function (conn, first_byte)
|
||||||
local b
|
local b
|
||||||
if first_byte == nil then
|
if first_byte == nil then
|
||||||
b = conn:read(1)
|
b = conn:read(1)
|
||||||
|
@ -42,7 +42,7 @@ function MqttClient:new (conn)
|
||||||
setmetatable(c, self)
|
setmetatable(c, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
|
|
||||||
conn.read_varint = read_varint
|
conn.readVarint = readVarint
|
||||||
conn:setTimeout(1)
|
conn:setTimeout(1)
|
||||||
|
|
||||||
c.conn = conn
|
c.conn = conn
|
||||||
|
@ -60,7 +60,7 @@ function MqttClient:handle ()
|
||||||
|
|
||||||
local ptype, length, _ = string.unpack("B B", s)
|
local ptype, length, _ = string.unpack("B B", s)
|
||||||
|
|
||||||
local length, err = self.conn:read_varint(length)
|
local length, err = self.conn:readVarint(length)
|
||||||
if err ~= nil then
|
if err ~= nil then
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue