Skip to content

Commit 0003ef3

Browse files
PR #492: Fix MQTT client initialization
- Use same buffer for rx and tx in MqttClient_Init - Fix invalid rx_buf and rx_buf_len parameters Co-Authored-By: [email protected] <[email protected]>
1 parent b818a5e commit 0003ef3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fullstack/freertos-wolfip-wolfmqtt/src/mqtt_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ static void mqtt_client_task(void* pvParameters)
6262

6363
/* Initialize MQTT client */
6464
word16 port = MQTT_PORT;
65-
word32 tx_buf_len = sizeof(buf);
65+
word32 buf_len = sizeof(buf);
6666
rc = MqttClient_Init(&g_mqtt_client, &g_mqtt_net, mqtt_message_cb,
67-
buf, tx_buf_len, NULL, 0, MQTT_DEFAULT_CMD_TIMEOUT_MS);
67+
buf, buf_len, buf, buf_len, MQTT_DEFAULT_CMD_TIMEOUT_MS);
6868
if (rc != MQTT_CODE_SUCCESS) {
6969
printf("MQTT client init failed: %d\n", rc);
7070
return;

0 commit comments

Comments
 (0)