We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f55b276 commit 9aaf956Copy full SHA for 9aaf956
src/mqtt_client.cpp
@@ -404,6 +404,13 @@ bool MqttClientClass::begin(const char* client_id,
404
SequansController.writeBytes((uint8_t*)MQTT_DISCONNECT,
405
strlen(MQTT_DISCONNECT),
406
true);
407
+
408
+ // Force to read the result so that we don't go on with the next command
409
+ // instantly. We just want to close the current connection if there are any.
410
+ // If there aren't, this will return an error from the modem, but that is
411
+ // fine as it just means that there aren't any connections active.
412
+ SequansController.readResponse(NULL, 0);
413
414
SequansController.clearReceiveBuffer();
415
416
// -- Configuration --
0 commit comments