1 // Copyright 2015-2018 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 #pragma once
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /**
21  * @brief Creates handle to esp_modem used as an esp-netif driver
22  *
23  * @param dte ESP Modem DTE object
24  *
25  * @return opaque pointer to esp-modem IO driver used to attach to esp-netif
26  */
27 void *esp_modem_netif_setup(modem_dte_t *dte);
28 
29 /**
30  * @brief Destroys the esp-netif driver handle
31  *
32  * @param h pointer to the esp-netif adapter for esp-modem
33  */
34 void esp_modem_netif_teardown(void *h);
35 
36 /**
37  * @brief Clears default handlers for esp-modem lifecycle
38  *
39  * @param h pointer to the esp-netif adapter for esp-modem
40  */
41 esp_err_t esp_modem_netif_clear_default_handlers(void *h);
42 
43 /**
44  * @brief Setups default handlers for esp-modem lifecycle
45  *
46  * @param h pointer to the esp-netif adapter for esp-modem
47  * @param esp_netif pointer corresponding esp-netif instance
48  */
49 esp_err_t esp_modem_netif_set_default_handlers(void *h, esp_netif_t * esp_netif);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54