Fixed length of binary lwt message (#28)

* changed reconnect timeout to 5 seconds

* changed reconnect timeout to 5 sec

* fixed binary lwt message

* stop reconnect timer to block CPU

* reduced task stack and network timeout

* fixed length of non-string lwt message
This commit is contained in:
Tijn Kooijmans
2018-03-06 12:12:51 +01:00
committed by Tuan
parent 60567cb238
commit 6d8a6c79bd

View File

@ -129,6 +129,7 @@ static esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_
client->connect_info.will_message = malloc(config->lwt_msg_len);
mem_assert(client->connect_info.will_message);
memcpy(client->connect_info.will_message, config->lwt_msg, config->lwt_msg_len);
client->connect_info.will_length = config->lwt_msg_len;
} else if (config->lwt_msg[0]) {
client->connect_info.will_message = strdup(config->lwt_msg);
client->connect_info.will_length = strlen(config->lwt_msg);