diff --git a/README.md b/README.md index deddeae..be45310 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ And of course, any contribution are welcome! To run tests in this git repo you need [**busted**](https://luarocks.org/modules/olivine-labs/busted) as well as some dependencies: Prepare: + ```sh luarocks install busted luarocks install luacov @@ -54,6 +55,7 @@ luarocks install lualogging ``` Running the tests: + ```sh busted ``` diff --git a/docs_topics/02-dependencies.md b/docs_topics/02-dependencies.md index aede65e..f52befd 100644 --- a/docs_topics/02-dependencies.md +++ b/docs_topics/02-dependencies.md @@ -5,27 +5,27 @@ The dependencies differ slightly based on the environment you use, and the requi * [**luasocket**](https://luarocks.org/modules/luasocket/luasocket) to establish TCP connections to the MQTT broker. This is a listed dependency in the luamqtt rockspec, so it will automatically be installed if you use LuaRocks to install luamqtt. To install it manually: - luarocks install luasocket + luarocks install luasocket * [**copas**](https://github.com/keplerproject/copas) module for asynchoneous IO. Copas is an advanced co-routine scheduler with far more features than the included `ioloop`. For anything more than a few devices, or for devices which require network IO beyond mqtt alone, Copas is the better alternative. Copas is also pure-Lua, but has parallel network IO (as opposed to sequential network IO in `ioloop`), and has features like; threads, timers, locks, semaphores, and non-blocking clients for http(s), (s)ftp, and smtp. - luarocks install copas + luarocks install copas * [**luasec**](https://github.com/brunoos/luasec) module for SSL/TLS based connections. This is optional and may be skipped if you don't need secure network connections (e.g. broker is located in your local network). It's not listed in package dependencies, please install it manually like this: - luarocks install luasec + luarocks install luasec * [**LuaBitOp**](http://bitop.luajit.org/) library to perform bitwise operations, which is required only on Lua 5.1. It's not listed in package dependencies, please install it manually like this: - luarocks install luabitop + luarocks install luabitop * [**LuaLogging**](https://github.com/lunarmodules/lualogging/) to enable logging by the MQTT client. This is optional but highly recommended for long running clients. This is a great debugging aid when developing your clients. Also when using OpenResty as your runtime, you'll definitely want to use this, see [openresty.lua](https://xhaskx.github.io/luamqtt/examples/openresty.lua.html) for an example. It's not listed in package dependencies, please install it manually like this: - luarocks install lualogging + luarocks install lualogging diff --git a/docs_topics/05-connectors.md b/docs_topics/05-connectors.md index 1f14b68..8575278 100644 --- a/docs_topics/05-connectors.md +++ b/docs_topics/05-connectors.md @@ -25,6 +25,3 @@ The main question is what event/io loop mechanism does your implementation have? The main thing to look for when checking out the existing implementations is the network timeout settings, and the returned `signals`. - - - diff --git a/examples/openresty/README.md b/examples/openresty/README.md index 6479473..8fcebd3 100644 --- a/examples/openresty/README.md +++ b/examples/openresty/README.md @@ -12,7 +12,7 @@ context. In the timer we'll spawn a thread that will do the listening, and the timer itself will go in an endless loop to do the keepalives. -**Caveats** +# Caveats * Due to the socket limitation we cannot Publish anything from another context. If you run into "bad request" errors on socket operations, you diff --git a/mqtt/protocol5.lua b/mqtt/protocol5.lua index 17842c6..9055d74 100644 --- a/mqtt/protocol5.lua +++ b/mqtt/protocol5.lua @@ -1324,7 +1324,7 @@ local function parse_packet_unsuback(ptype, flags, input) end -- Parse PINGREQ packet, DOC: 3.12 PINGREQ – PING request -local function parse_packet_pingreq(ptype, flags, input_) +local function parse_packet_pingreq(ptype, flags, _) -- DOC: 3.12.1 PINGREQ Fixed Header if flags ~= 0 then -- Reserved return false, packet_type[ptype]..": unexpected flags value: "..flags @@ -1333,7 +1333,7 @@ local function parse_packet_pingreq(ptype, flags, input_) end -- Parse PINGRESP packet, DOC: 3.13 PINGRESP – PING response -local function parse_packet_pingresp(ptype, flags, input_) +local function parse_packet_pingresp(ptype, flags, _) -- DOC: 3.13.1 PINGRESP Fixed Header if flags ~= 0 then -- Reserved return false, packet_type[ptype]..": unexpected flags value: "..flags