接前一篇文章:ESP32-C3在MQTT访问时出现“transport_base: Poll timeout or error”问题的分析(10)
上一回解析了process_keepalive函数中调用的esp_mqtt_client_ping函数,本回继续往下解析。为了便于理解和回顾,再次贴出process_keepalive函数源码,在components\components\mqtt\esp-mqtt\mqtt_client.c中,如下:
static esp_err_t process_keepalive(esp_mqtt_client_handle_t client)
{
if (client->mqtt_state.connection.information.keepalive > 0) {
const uint64_t keepalive_ms = client->mqtt_state.connection.information.keepalive * 1000;
if (client->wait_for_ping_resp ==