mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
esp-netif: removing SLIP related events as the slip-modem set state synchronously
This commit is contained in:
@@ -22,15 +22,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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
|
/** @brief Configuration structure for SLIP network interface
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -28,8 +28,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
ESP_EVENT_DEFINE_BASE(SLIP_EVENT);
|
|
||||||
|
|
||||||
static const char *TAG = "esp-netif_lwip-slip";
|
static const char *TAG = "esp-netif_lwip-slip";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -200,42 +200,6 @@ static esp_err_t esp_slip_modem_post_attach(esp_netif_t *esp_netif, void *args)
|
|||||||
return ESP_OK;
|
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)
|
static void esp_slip_modem_uart_rx_task(void *arg)
|
||||||
{
|
{
|
||||||
esp_slip_modem_t *slip_modem = (esp_slip_modem_t *) arg;
|
esp_slip_modem_t *slip_modem = (esp_slip_modem_t *) arg;
|
||||||
|
Reference in New Issue
Block a user