add msg_len

This commit is contained in:
Tuan PM
2017-02-15 13:16:44 +07:00
parent b230961b4b
commit 510dd21158

3
mqtt.c
View File

@@ -2,7 +2,7 @@
* @Author: Tuan PM
* @Date: 2016-09-10 09:33:06
* @Last Modified by: Tuan PM
* @Last Modified time: 2017-02-15 13:02:53
* @Last Modified time: 2017-02-15 13:11:53
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
@@ -33,6 +33,7 @@ static int resolve_dns(const char *host, struct sockaddr_in *ip) {
}
static void mqtt_queue(mqtt_client *client)
{
int msg_len;
while (rb_available(&client->send_rb) < client->mqtt_state.outbound_message->length) {
xQueueReceive(client->xSendingQueue, &msg_len, 1000 / portTICK_RATE_MS);
rb_read(&client->send_rb, client->mqtt_state.out_buffer, msg_len);