forked from espressif/esp-mqtt
mqtt_client: add session_present field to mqtt_event
Populate it using the CONNACK packet
This commit is contained in:
@@ -52,6 +52,7 @@ typedef struct {
|
|||||||
char *topic; /*!< Topic asociated with this event */
|
char *topic; /*!< Topic asociated with this event */
|
||||||
int topic_len; /*!< Length of the topic for this event asociated with this event */
|
int topic_len; /*!< Length of the topic for this event asociated with this event */
|
||||||
int msg_id; /*!< MQTT messaged id of message */
|
int msg_id; /*!< MQTT messaged id of message */
|
||||||
|
int session_present; /*!< MQTT session_present flag for connection event */
|
||||||
} esp_mqtt_event_t;
|
} esp_mqtt_event_t;
|
||||||
|
|
||||||
typedef esp_mqtt_event_t* esp_mqtt_event_handle_t;
|
typedef esp_mqtt_event_t* esp_mqtt_event_handle_t;
|
||||||
|
@@ -699,6 +699,7 @@ static void esp_mqtt_task(void *pv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
client->event.event_id = MQTT_EVENT_CONNECTED;
|
client->event.event_id = MQTT_EVENT_CONNECTED;
|
||||||
|
client->event.session_present = mqtt_get_connect_session_present(client->mqtt_state.in_buffer);
|
||||||
client->state = MQTT_STATE_CONNECTED;
|
client->state = MQTT_STATE_CONNECTED;
|
||||||
esp_mqtt_dispatch_event(client);
|
esp_mqtt_dispatch_event(client);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user