From b564ee6d76e65b853f9d5ea0cea68a542effd0d3 Mon Sep 17 00:00:00 2001 From: Flavio Santes Date: Tue, 9 Aug 2016 12:04:35 -0500 Subject: [PATCH] mqtt: fix: Remove ping function call Zephyr's MQTT does not implement a client's message queue. So, a race-condition may be present when multiple messages are received and processed. We remove the pinreq function call to allow the mqtt_read function to handle all the incoming messages. CONFIG_IP_BUF_RX_SIZE is also updated to allow more messages to be queued by the IP stack. Jira: ZEP-669 Change-Id: Ie3ef55b17020e04c6540adf975a66fb004933914 Signed-off-by: Flavio Santes --- samples/net/paho_mqtt_clients/subscriber/prj_galileo.conf | 4 +--- samples/net/paho_mqtt_clients/subscriber/src/main.c | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/samples/net/paho_mqtt_clients/subscriber/prj_galileo.conf b/samples/net/paho_mqtt_clients/subscriber/prj_galileo.conf index 0026230b493..1338e876c88 100644 --- a/samples/net/paho_mqtt_clients/subscriber/prj_galileo.conf +++ b/samples/net/paho_mqtt_clients/subscriber/prj_galileo.conf @@ -9,11 +9,9 @@ CONFIG_NETWORKING_WITH_TCP=y CONFIG_NETWORKING_WITH_IPV4=y CONFIG_NETWORKING_IPV6_NO_ND=y -CONFIG_IP_BUF_RX_SIZE=4 +CONFIG_IP_BUF_RX_SIZE=16 CONFIG_IP_BUF_TX_SIZE=4 -CONFIG_NETZ=y - # Uncomment the following variables for debugging #CONFIG_NETWORKING_WITH_LOGGING=y diff --git a/samples/net/paho_mqtt_clients/subscriber/src/main.c b/samples/net/paho_mqtt_clients/subscriber/src/main.c index 8507392783b..c719d25a1bb 100644 --- a/samples/net/paho_mqtt_clients/subscriber/src/main.c +++ b/samples/net/paho_mqtt_clients/subscriber/src/main.c @@ -100,10 +100,6 @@ void fiber(void) do { printf("\n--------------------------------\n"); - rc = mqtt_pingreq(&app_ctx); - printf("Pingreq, rc: %s\n", RC_STR(rc)); - fiber_sleep(SLEEP_TIME); - mqtt_read(&app_ctx); fiber_sleep(SLEEP_TIME);