Skip to content

Commit

Permalink
samples/net/mqtt: Fix mqtt_connect function
Browse files Browse the repository at this point in the history
Remove erroneous initialization of 'data' via memset.
Set keep alive interval to 0.

Change-Id: I5da4649985efd39b37bbbdc6ae21a856f9e40b13
Signed-off-by: Flavio Santes <[email protected]>
  • Loading branch information
1010101001010101 committed May 31, 2016
1 parent d1d0ee7 commit 65ccf83
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions samples/net/paho_mqtt_client/src/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <string.h>
#include <errno.h>

#include "config.h"
Expand All @@ -40,11 +39,9 @@ int mqtt_connect(struct net_context *ctx, char *client_name)
size_t tx_len;
int rc;

memset(&data, 0x00, sizeof(MQTTPacket_connectData));

data.MQTTVersion = 4;
data.clientID.cstring = client_name;
data.keepAliveInterval = 500;
data.keepAliveInterval = 0;
data.cleansession = 1;
data.username.cstring = "zephyr";
data.password.cstring = "1234";
Expand Down

0 comments on commit 65ccf83

Please sign in to comment.