forked from espressif/arduino-esp32
Update IDF, tools and toolchains
This commit is contained in:
@ -815,6 +815,22 @@ esp_netif_t *esp_netif_next(esp_netif_t *esp_netif);
|
||||
*/
|
||||
size_t esp_netif_get_nr_of_ifs(void);
|
||||
|
||||
/**
|
||||
* @brief increase the reference counter of net stack buffer
|
||||
*
|
||||
* @param[in] netstack_buf the net stack buffer
|
||||
*
|
||||
*/
|
||||
void esp_netif_netstack_buf_ref(void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @brief free the netstack buffer
|
||||
*
|
||||
* @param[in] netstack_buf the net stack buffer
|
||||
*
|
||||
*/
|
||||
void esp_netif_netstack_buf_free(void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -70,7 +70,19 @@ extern "C" {
|
||||
.lost_ip_event = IP_EVENT_PPP_LOST_IP, \
|
||||
.if_key = "PPP_DEF", \
|
||||
.if_desc = "ppp", \
|
||||
.route_prio = 128 \
|
||||
.route_prio = 20 \
|
||||
};
|
||||
|
||||
#define ESP_NETIF_INHERENT_DEFAULT_SLIP() \
|
||||
{ \
|
||||
.flags = ESP_NETIF_FLAG_IS_SLIP, \
|
||||
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \
|
||||
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(ip_info) \
|
||||
.get_ip_event = 0, \
|
||||
.lost_ip_event = 0, \
|
||||
.if_key = "SLP_DEF", \
|
||||
.if_desc = "slip", \
|
||||
.route_prio = 16 \
|
||||
};
|
||||
|
||||
/**
|
||||
@ -112,6 +124,18 @@ extern "C" {
|
||||
.driver = NULL, \
|
||||
.stack = ESP_NETIF_NETSTACK_DEFAULT_PPP, \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default configuration reference of SLIP client
|
||||
*/
|
||||
#define ESP_NETIF_DEFAULT_SLIP() \
|
||||
{ \
|
||||
.base = ESP_NETIF_BASE_DEFAULT_SLIP, \
|
||||
.driver = NULL, \
|
||||
.stack = ESP_NETIF_NETSTACK_DEFAULT_SLIP, \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Default base config (esp-netif inherent) of WIFI STA
|
||||
*/
|
||||
@ -132,11 +156,18 @@ extern "C" {
|
||||
*/
|
||||
#define ESP_NETIF_BASE_DEFAULT_PPP &_g_esp_netif_inherent_ppp_config
|
||||
|
||||
/**
|
||||
* @brief Default base config (esp-netif inherent) of slip interface
|
||||
*/
|
||||
#define ESP_NETIF_BASE_DEFAULT_SLIP &_g_esp_netif_inherent_slip_config
|
||||
|
||||
|
||||
|
||||
#define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth
|
||||
#define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta
|
||||
#define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap
|
||||
#define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp
|
||||
#define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip
|
||||
|
||||
//
|
||||
// Include default network stacks configs
|
||||
@ -148,6 +179,7 @@ extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth;
|
||||
extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta;
|
||||
extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap;
|
||||
extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp;
|
||||
extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip;
|
||||
|
||||
//
|
||||
// Include default common configs inherent to esp-netif
|
||||
@ -158,6 +190,7 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config;
|
||||
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config;
|
||||
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config;
|
||||
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ppp_config;
|
||||
extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config;
|
||||
|
||||
extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip;
|
||||
|
||||
|
@ -69,6 +69,20 @@ void* esp_netif_get_netif_impl(esp_netif_t *esp_netif);
|
||||
*/
|
||||
esp_err_t esp_netif_transmit(esp_netif_t *esp_netif, void* data, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Outputs packets from the TCP/IP stack to the media to be transmitted
|
||||
*
|
||||
* This function gets called from network stack to output packets to IO driver.
|
||||
*
|
||||
* @param[in] esp_netif Handle to esp-netif instance
|
||||
* @param[in] data Data to be transmitted
|
||||
* @param[in] len Length of the data frame
|
||||
* @param[in] netstack_buf net stack buffer
|
||||
*
|
||||
* @return ESP_OK on success, an error passed from the I/O driver otherwise
|
||||
*/
|
||||
esp_err_t esp_netif_transmit_wrap(esp_netif_t *esp_netif, void *data, size_t len, void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @brief Free the rx buffer allocated by the media driver
|
||||
*
|
||||
|
77
tools/sdk/esp32/include/esp_netif/include/esp_netif_slip.h
Normal file
77
tools/sdk/esp32/include/esp_netif/include/esp_netif_slip.h
Normal file
@ -0,0 +1,77 @@
|
||||
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#ifndef _ESP_NETIF_SLIP_H_
|
||||
#define _ESP_NETIF_SLIP_H_
|
||||
|
||||
#include "esp_netif.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @brief Configuration structure for SLIP network interface
|
||||
*
|
||||
*/
|
||||
typedef struct esp_netif_slip_config {
|
||||
esp_ip6_addr_t ip6_addr; /* Local IP6 address */
|
||||
|
||||
} esp_netif_slip_config_t;
|
||||
|
||||
|
||||
/** @brief Sets common parameters for the supplied esp-netif.
|
||||
*
|
||||
* @param[in] esp_netif handle to slip esp-netif instance
|
||||
* @param[in] config Pointer to SLIP netif configuration structure
|
||||
*
|
||||
* @return ESP_OK on success, ESP_ERR_ESP_NETIF_INVALID_PARAMS if netif null or not SLIP
|
||||
*/
|
||||
esp_err_t esp_netif_slip_set_params(esp_netif_t *netif, const esp_netif_slip_config_t *config);
|
||||
|
||||
/** @brief Sets IPV6 address for the supplied esp-netif.
|
||||
*
|
||||
* @param[in] netif handle to slip esp-netif instance
|
||||
* @param[in] ipv6 IPv6 address of the SLIP interface
|
||||
*
|
||||
* @return ESP_OK on success, ESP_ERR_ESP_NETIF_INVALID_PARAMS if netif null or not SLIP
|
||||
*/
|
||||
esp_err_t esp_netif_slip_set_ipv6(esp_netif_t *netif, const esp_ip6_addr_t *ipv6);
|
||||
|
||||
/**
|
||||
* @brief Data path API to write raw packet ous the SLIP interface
|
||||
*
|
||||
* This API is typically used when implementing user defined methods
|
||||
*
|
||||
* @param[in] esp_netif handle to slip esp-netif instance
|
||||
* @param[in] buffer pointer to the outgoing data
|
||||
* @param[in] len length of the data
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
void esp_netif_lwip_slip_raw_output(esp_netif_t *netif, void *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Fetch IP6 address attached to the SLIP interface
|
||||
*
|
||||
* @param[in] esp_netif handle to slip esp-netif instance
|
||||
* @param[in] address index (unused)
|
||||
*
|
||||
* @return
|
||||
* - pointer to the internal ip6 address object
|
||||
*/
|
||||
const esp_ip6_addr_t *esp_slip_get_ip6(esp_netif_t *slip_netif);
|
||||
|
||||
#endif
|
@ -138,7 +138,8 @@ typedef enum esp_netif_flags {
|
||||
ESP_NETIF_FLAG_AUTOUP = 1 << 2,
|
||||
ESP_NETIF_FLAG_GARP = 1 << 3,
|
||||
ESP_NETIF_FLAG_EVENT_IP_MODIFIED = 1 << 4,
|
||||
ESP_NETIF_FLAG_IS_PPP = 1 << 5
|
||||
ESP_NETIF_FLAG_IS_PPP = 1 << 5,
|
||||
ESP_NETIF_FLAG_IS_SLIP = 1 << 6,
|
||||
} esp_netif_flags_t;
|
||||
|
||||
typedef enum esp_netif_ip_event_type {
|
||||
@ -163,7 +164,9 @@ typedef struct esp_netif_inherent_config {
|
||||
const char * if_key; /*!< string identifier of the interface */
|
||||
const char * if_desc; /*!< textual description of the interface */
|
||||
int route_prio; /*!< numeric priority of this interface to become a default
|
||||
routing if (if other netifs are up) */
|
||||
routing if (if other netifs are up).
|
||||
A higher value of route_prio indicates
|
||||
a higher priority */
|
||||
} esp_netif_inherent_config_t;
|
||||
|
||||
typedef struct esp_netif_config esp_netif_config_t;
|
||||
@ -184,6 +187,7 @@ typedef struct esp_netif_driver_base_s {
|
||||
struct esp_netif_driver_ifconfig {
|
||||
esp_netif_iodriver_handle handle;
|
||||
esp_err_t (*transmit)(void *h, void *buffer, size_t len);
|
||||
esp_err_t (*transmit_wrap)(void *h, void *buffer, size_t len, void *netstack_buffer);
|
||||
void (*driver_free_rx_buffer)(void *h, void* buffer);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user