esp_netif_defaults.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2015-2019 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. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #include "esp_netif.h"
  14. #include "esp_wifi_default.h"
  15. #if CONFIG_ETH_ENABLED
  16. #include "esp_eth.h"
  17. #endif
  18. //
  19. // Purpose of this module is to provide
  20. // - general esp-netif definitions of default objects for STA, AP, ETH
  21. // - default init / create functions for basic default interfaces
  22. //
  23. //
  24. // Default configuration of common interfaces, such as STA, AP, ETH
  25. //
  26. const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config = ESP_NETIF_INHERENT_DEFAULT_WIFI_STA();
  27. const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config = ESP_NETIF_INHERENT_DEFAULT_WIFI_AP();
  28. const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config = ESP_NETIF_INHERENT_DEFAULT_ETH();
  29. const esp_netif_inherent_config_t _g_esp_netif_inherent_ppp_config = ESP_NETIF_INHERENT_DEFAULT_PPP();
  30. const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config = ESP_NETIF_INHERENT_DEFAULT_SLIP();
  31. const esp_netif_inherent_config_t _g_esp_netif_inherent_openthread_config = ESP_NETIF_INHERENT_DEFAULT_OPENTHREAD();
  32. const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip = {
  33. .ip = { .addr = ESP_IP4TOADDR( 192, 168, 4, 1) },
  34. .gw = { .addr = ESP_IP4TOADDR( 192, 168, 4, 1) },
  35. .netmask = { .addr = ESP_IP4TOADDR( 255, 255, 255, 0) },
  36. };