Skip to content

Commit 348d430

Browse files
committed
MCU8MASS-3330 Change connection timeout to uint32 for MQTT client to allow for longer timeouts
1 parent ef0ece5 commit 348d430

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

examples/mqtt_low_power/mqtt_low_power.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ void setup() {
5353
MQTT_PORT,
5454
MQTT_USE_TLS,
5555
MQTT_KEEPALIVE,
56-
MQTT_USE_ECC);
56+
MQTT_USE_ECC,
57+
"",
58+
"",
59+
90'000);
5760
#endif
5861

5962
Mcp9808.begin();
@@ -72,7 +75,10 @@ void loop() {
7275
MQTT_PORT,
7376
MQTT_USE_TLS,
7477
MQTT_KEEPALIVE,
75-
MQTT_USE_ECC);
78+
MQTT_USE_ECC,
79+
"",
80+
"",
81+
90'000);
7682
#endif
7783

7884
char message_to_publish[8] = {0};

src/mqtt_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ bool MqttClientClass::begin(const char* client_id,
397397
const bool use_ecc,
398398
const char* username,
399399
const char* password,
400-
const size_t timeout_ms,
400+
const uint32_t timeout_ms,
401401
const bool print_messages) {
402402

403403
if (!Lte.isConnected()) {

src/mqtt_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MqttClientClass {
6161
const bool use_ecc = true,
6262
const char* username = "",
6363
const char* password = "",
64-
const size_t timeout_ms = 30000,
64+
const uint32_t timeout_ms = 30000,
6565
const bool print_messages = true);
6666

6767
/**

0 commit comments

Comments
 (0)