Skip to content

Commit 08d469a

Browse files
committed
Merge branch 'feature/add_apis_to_compatible_with_esp_netif' into 'master'
tcpip_adapter: add header file and wrapper APIs to make code compatible with "esp_netif" See merge request sdk/ESP8266_RTOS_SDK!1273
2 parents 52961db + 72d2dc6 commit 08d469a

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

components/tcpip_adapter/esp_netif.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2020-2021 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "esp_netif.h"
16+
17+
esp_err_t esp_netif_init(void)
18+
{
19+
tcpip_adapter_init();
20+
21+
return ESP_OK;
22+
}
23+
24+
esp_err_t esp_netif_deinit(void)
25+
{
26+
return ESP_OK;
27+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#pragma once
16+
17+
#include <stdint.h>
18+
#include "sdkconfig.h"
19+
#include "esp_wifi_types.h"
20+
#include "tcpip_adapter.h"
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
/**
27+
* @defgroup ESP_NETIF_INIT_API ESP-NETIF Initialization API
28+
* @brief Add these APIs to make code compatible with esp-idf's newer branch
29+
*
30+
*/
31+
32+
/** @addtogroup ESP_NETIF_INIT_API
33+
* @{
34+
*/
35+
36+
/**
37+
* @brief Wrapper API to call "tcpip_adapter_init()" really
38+
*
39+
* @return
40+
* - ESP_OK on success
41+
42+
* @note This function should be called exactly once from application code, when the application starts up.
43+
*/
44+
esp_err_t esp_netif_init(void);
45+
46+
/**
47+
* @brief Empty function
48+
*
49+
* Note: Deinitialization is not supported yet
50+
*
51+
* @return
52+
* - ESP_OK on success
53+
*/
54+
esp_err_t esp_netif_deinit(void);
55+
56+
#ifdef __cplusplus
57+
}
58+
#endif

0 commit comments

Comments
 (0)