Merge branch 'fix/removed_unused_handler_field' into 'master'

Removes leftover calls to event_handler

See merge request espressif/esp-mqtt!178
This commit is contained in:
Rocha Euripedes
2023-06-13 14:29:49 +08:00
3 changed files with 0 additions and 14 deletions

View File

@ -213,7 +213,6 @@ typedef struct esp_mqtt_event_t {
typedef esp_mqtt_event_t *esp_mqtt_event_handle_t;
typedef esp_err_t (*mqtt_event_callback_t)(esp_mqtt_event_handle_t event);
/**
* *MQTT* client configuration structure

View File

@ -61,7 +61,6 @@ typedef struct mqtt_state {
} mqtt_state_t;
typedef struct {
mqtt_event_callback_t event_handle;
esp_event_loop_handle_t event_loop_handle;
int task_stack;
int task_prio;

View File

@ -980,16 +980,12 @@ static esp_err_t esp_mqtt_dispatch_event(esp_mqtt_client_handle_t client)
client->event.protocol_ver = client->connect_info.protocol_ver;
esp_err_t ret = ESP_FAIL;
if (client->config->event_handle) {
ret = client->config->event_handle(&client->event);
} else {
#ifdef MQTT_SUPPORTED_FEATURE_EVENT_LOOP
esp_event_post_to(client->config->event_loop_handle, MQTT_EVENTS, client->event.event_id, &client->event, sizeof(client->event), portMAX_DELAY);
ret = esp_event_loop_run(client->config->event_loop_handle, 0);
#else
return ESP_FAIL;
#endif
}
if (client->connect_info.protocol_ver == MQTT_PROTOCOL_V_5) {
#ifdef MQTT_PROTOCOL_5
esp_mqtt5_client_delete_user_property(client->event.property->user_property);
@ -2132,10 +2128,6 @@ esp_err_t esp_mqtt_client_register_event(esp_mqtt_client_handle_t client, esp_mq
return ESP_ERR_INVALID_ARG;
}
#ifdef MQTT_SUPPORTED_FEATURE_EVENT_LOOP
if (client->config->event_handle) {
ESP_LOGW(TAG, "Registering event loop while event callback is not null, clearing callback");
client->config->event_handle = NULL;
}
return esp_event_handler_register_with(client->config->event_loop_handle, MQTT_EVENTS, event, event_handler, event_handler_arg);
#else
@ -2150,10 +2142,6 @@ esp_err_t esp_mqtt_client_unregister_event(esp_mqtt_client_handle_t client, esp_
return ESP_ERR_INVALID_ARG;
}
#ifdef MQTT_SUPPORTED_FEATURE_EVENT_LOOP
if (client->config->event_handle) {
ESP_LOGW(TAG, "Unregistering event loop while event callback is not null, clearing callback");
client->config->event_handle = NULL;
}
return esp_event_handler_unregister_with(client->config->event_loop_handle, MQTT_EVENTS, event, event_handler);
#else