nodemcu-firmware/app
Caleb Mingle e547c2a094 mqtt: fix connfail callback
I've not been able to get the mqtt `connfail` callback to work.

I'm consistently receiving `method not supported` errors:
```
application.lua:53: method not supported
stack traceback:
        [C]: in function 'on'
        application.lua:53: in main chunk
        [C]: in function 'dofile'
        init.lua:18: in function <init.lua:6>
```

Example code:
```
function on_connection_failed(client, reason)
    print("mqtt connection failed: " .. reason)
end

m:on("connfail", on_connection_failed)
```

I believed this to be caused by the incorrect length comparison for `connfail`
that is updated here.

Once I changed that, the error went away, however the callback was never called.

I believe the callback was never called because of an incorrect assignment.

However, I saw this somewhat confusing description in the docs so this
assignment may be expected?
> The second (failure) callback aliases with the "connfail" callback available through :on(). (The "offline" callback is only called after an already established connection becomes closed. If the connect() call fails to establish a connection, the callback passed to :connect() is called and nothing else.)
2020-08-11 17:20:17 +01:00
..
coap Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
crypto SSL rampage (#2938) 2020-06-09 22:26:06 +02:00
dht Correct negative results in DHT driver (#3210) 2020-08-03 19:58:19 +01:00
driver Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
esp-gdbstub Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
fatfs Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
http Fix binary and chunked HTTP downloads (#2985) 2020-06-09 22:26:52 +02:00
include Add support to set the clock rate and have sntp use it. (#3236) 2020-08-08 13:32:14 +02:00
libc Fix of string.format("%.0f") (#3199) 2020-07-07 14:35:37 +01:00
lua Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
lua53 Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
lwip Networking rampage and accumulated fixes (#3060) 2020-06-09 22:26:52 +02:00
mbedtls tls: fix new verification API 2020-06-09 22:26:52 +02:00
modules mqtt: fix connfail callback 2020-08-11 17:20:17 +01:00
mqtt WIP: MQTT fixes (#2986) 2020-06-09 22:26:52 +02:00
net Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
pcm Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
platform Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
pm Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
sjson Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
smart Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
spiffs Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
tsl2561 Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
u8g2lib Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
ucglib Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
user Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
uzlib Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
websocket Networking rampage and accumulated fixes (#3060) 2020-06-09 22:26:52 +02:00
.gitignore seperate user_config.h to speed-up compile when modules disabled/enabled 2015-03-06 11:59:04 +08:00
Makefile Remove sqlite3 module 2020-06-10 02:14:29 +01:00