multipart large MQTT data fixed
This commit is contained in:
parent
aaed490d84
commit
60f36fbf04
|
|
@ -266,6 +266,8 @@ msg_id = esp_mqtt_client_subscribe(client, (char*) topic, 0);
|
|||
#if MQTT_DEBUG_MODE > 1
|
||||
ESP_LOGI(TAG, "MQTT_EVENT_DATA, client %d", idx);
|
||||
#endif
|
||||
if (event->data_len == 0 || event->current_data_offset > 0) //possible fragments of long data
|
||||
goto end_of_system_handler;
|
||||
//Check if topic is SYSTEM and pass data to handler
|
||||
ComposeTopic(topic, idx, SERVICE_NAME, DOWNLINK_SUBTOPIC);
|
||||
if (!memcmp(topic, event->topic, event->topic_len))
|
||||
|
|
@ -301,6 +303,7 @@ msg_id = esp_mqtt_client_subscribe(client, (char*) topic, 0);
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
break;
|
||||
case MQTT_EVENT_ERROR:
|
||||
ESP_LOGE(TAG, "MQTT_EVENT_ERROR, client %d", idx);
|
||||
|
|
@ -319,6 +322,7 @@ msg_id = esp_mqtt_client_subscribe(client, (char*) topic, 0);
|
|||
#endif
|
||||
break;
|
||||
}
|
||||
end_of_system_handler:
|
||||
xSemaphoreGive(xSemaphoreMQTTHandle);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user