esp_modem_netif.h 1.5 KB

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