Closed brentru closed 4 years ago
Does the MQTT client actually need a negotiated disconnect, or does it fail resiliently whenever the hardware connection fails? The tests I did with forced WiFi.disconnect() always seemed to come back just fine with a subsequent call to io.connect().
EDIT: This is incorrect
@sellensr It might not need a negotiated disconnect, edited issue to reflect.
I'll add the _disconnect() in my next pr along with the test for non-empty ssid, as it can be part of the same functionality.
WiFi disconnect is handled in https://github.com/adafruit/Adafruit_IO_Arduino/pull/104. After that's set, let's open a new PR to add a negotiated mqtt client disconnect and a wifi disconnect, io.disconnect()
Fixed in #104, closing...
Add
io.disconnect()
function to shut down the connection and release any resources.We support many types of network connections with this library (https://github.com/adafruit/Adafruit_IO_Arduino/tree/master/src/wifi). Each WiFi client may require a corresponding
AdafruitIO_HARDWARETYPE::_disconnect()
method, analogous to theAdafruitIO_HARDWARETYPE::_connect()
method.Originally suggested by @sellensr in issue https://github.com/adafruit/Adafruit_IO_Arduino/issues/99.