Queue in MQTT transport wait for connected
This commit is contained in:
parent
65b977f089
commit
2996e4175d
|
|
@ -383,9 +383,12 @@ void MQTTTaskTransmit(void *pvParameter)
|
||||||
vTaskDelay(pdMS_TO_TICKS(300)); //wait for MQTT queue ready
|
vTaskDelay(pdMS_TO_TICKS(300)); //wait for MQTT queue ready
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
while (!mqtt[idx].is_connected)
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(300));
|
||||||
xQueueReceive(mqtt[idx].mqtt_queue, &DSS, portMAX_DELAY);
|
xQueueReceive(mqtt[idx].mqtt_queue, &DSS, portMAX_DELAY);
|
||||||
if (mqtt[idx].mqtt && mqtt[idx].is_connected)
|
if (mqtt[idx].mqtt && mqtt[idx].is_connected)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if MQTT_DEBUG_MODE > 1
|
#if MQTT_DEBUG_MODE > 1
|
||||||
ESP_LOGI(TAG, "MQTT client %d data send:%.*s", idx, DSS.data_length, DSS.raw_data_ptr);
|
ESP_LOGI(TAG, "MQTT client %d data send:%.*s", idx, DSS.data_length, DSS.raw_data_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user