samples/net/mqtt: Fix mqtt_connect function
Remove erroneous initialization of 'data' via memset. Set keep alive interval to 0. Change-Id: I5da4649985efd39b37bbbdc6ae21a856f9e40b13 Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit is contained in:
parent
d1d0ee7b2d
commit
65ccf8330f
1 changed files with 1 additions and 4 deletions
|
@ -14,7 +14,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -40,11 +39,9 @@ int mqtt_connect(struct net_context *ctx, char *client_name)
|
||||||
size_t tx_len;
|
size_t tx_len;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
memset(&data, 0x00, sizeof(MQTTPacket_connectData));
|
|
||||||
|
|
||||||
data.MQTTVersion = 4;
|
data.MQTTVersion = 4;
|
||||||
data.clientID.cstring = client_name;
|
data.clientID.cstring = client_name;
|
||||||
data.keepAliveInterval = 500;
|
data.keepAliveInterval = 0;
|
||||||
data.cleansession = 1;
|
data.cleansession = 1;
|
||||||
data.username.cstring = "zephyr";
|
data.username.cstring = "zephyr";
|
||||||
data.password.cstring = "1234";
|
data.password.cstring = "1234";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue