From bb9a7356acfce03515a4c0bb117d0ec5b9ea4c69 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 16 Jun 2020 15:22:40 +0200 Subject: [PATCH] esp-netif: removing SLIP related events as the slip-modem set state synchronously --- components/esp_netif/include/esp_netif_slip.h | 9 ----- .../esp_netif/lwip/esp_netif_lwip_slip.c | 2 -- .../slip_modem/library/slip_modem.c | 36 ------------------- 3 files changed, 47 deletions(-) diff --git a/components/esp_netif/include/esp_netif_slip.h b/components/esp_netif/include/esp_netif_slip.h index bb0aa08303..9cfafb97ed 100644 --- a/components/esp_netif/include/esp_netif_slip.h +++ b/components/esp_netif/include/esp_netif_slip.h @@ -22,15 +22,6 @@ extern "C" { #endif -/** @brief SLIP event base */ -ESP_EVENT_DECLARE_BASE(SLIP_EVENT); - -typedef enum esp_netif_slip_event { - SLIP_EVENT_START = 1, - SLIP_EVENT_STOP = 2, - -} esp_netif_slip_event_e; - /** @brief Configuration structure for SLIP network interface * */ diff --git a/components/esp_netif/lwip/esp_netif_lwip_slip.c b/components/esp_netif/lwip/esp_netif_lwip_slip.c index 80cbf1b91f..990fbc84b9 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_slip.c +++ b/components/esp_netif/lwip/esp_netif_lwip_slip.c @@ -28,8 +28,6 @@ #include -ESP_EVENT_DEFINE_BASE(SLIP_EVENT); - static const char *TAG = "esp-netif_lwip-slip"; /** diff --git a/examples/protocols/slip/slip_udp/components/slip_modem/library/slip_modem.c b/examples/protocols/slip/slip_udp/components/slip_modem/library/slip_modem.c index 0583dc2380..2982774d88 100644 --- a/examples/protocols/slip/slip_udp/components/slip_modem/library/slip_modem.c +++ b/examples/protocols/slip/slip_udp/components/slip_modem/library/slip_modem.c @@ -200,42 +200,6 @@ static esp_err_t esp_slip_modem_post_attach(esp_netif_t *esp_netif, void *args) return ESP_OK; } -esp_err_t esp_slip_modem_set_default_handlers(esp_netif_t *esp_netif) { - esp_err_t ret; - - if (esp_netif == NULL) { - ESP_LOGE(TAG, "esp-netif handle can't be null"); - return ESP_ERR_INVALID_ARG; - } - - ret = esp_event_handler_register(SLIP_EVENT, SLIP_EVENT_START, esp_netif_action_start, esp_netif); - if (ret != ESP_OK) { - goto fail; - } - - ret = esp_event_handler_register(SLIP_EVENT, SLIP_EVENT_STOP, esp_netif_action_stop, esp_netif); - if (ret != ESP_OK) { - goto fail; - } - -fail: - esp_eth_clear_default_handlers(esp_netif); - return ret; -} - -esp_err_t esp_slip_modem_clear_default_handlers(void *esp_netif) -{ - if (!esp_netif) { - ESP_LOGE(TAG, "esp-netif handle can't be null"); - return ESP_ERR_INVALID_ARG; - } - esp_event_handler_unregister(SLIP_EVENT, SLIP_EVENT_START, esp_netif_action_start); - esp_event_handler_unregister(SLIP_EVENT, SLIP_EVENT_STOP, esp_netif_action_stop); - - return ESP_OK; -} - - static void esp_slip_modem_uart_rx_task(void *arg) { esp_slip_modem_t *slip_modem = (esp_slip_modem_t *) arg;