wifi_connect.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* wifi_connect.h
  2. *
  3. * Copyright (C) 2006-2024 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. #ifndef _WIFI_CONNECT_H_
  22. #define _WIFI_CONNECT_H_
  23. #include <esp_idf_version.h>
  24. #include <esp_log.h>
  25. /* ESP lwip */
  26. #define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
  27. #define TLS_SMP_SERVER_TASK_NAME "tls_sever_example"
  28. #define TLS_SMP_SERVER_TASK_BYTES 22240
  29. #define TLS_SMP_SERVER_TASK_PRIORITY 8
  30. #define TLS_SMP_WIFI_SSID CONFIG_WIFI_SSID
  31. #define TLS_SMP_WIFI_PASS CONFIG_WIFI_PASSWORD
  32. #define USE_WIFI_EXAMPLE
  33. #ifdef USE_WIFI_EXAMPLE
  34. #include "esp_netif.h"
  35. #include "protocol_examples_common.h" /* see project CMakeLists.txt */
  36. #endif
  37. /**
  38. ******************************************************************************
  39. ******************************************************************************
  40. ** USER APPLICATION SETTINGS BEGIN
  41. ******************************************************************************
  42. ******************************************************************************
  43. **/
  44. /* when using a private config with plain text passwords,
  45. * file my_private_config.h should be excluded from git updates */
  46. /* #define USE_MY_PRIVATE_CONFIG */
  47. #ifdef USE_MY_PRIVATE_CONFIG
  48. #if defined(WOLFSSL_CMAKE_SYSTEM_NAME_WINDOWS)
  49. #include "/workspace/my_private_config.h"
  50. #elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_WSL)
  51. #include "/mnt/c/workspace/my_private_config.h"
  52. #elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_LINUX)
  53. #include "~/workspace/my_private_config.h"
  54. #elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_APPLE)
  55. #include "~/Documents/my_private_config.h"
  56. #else
  57. #warning "did not detect environment. using ~/my_private_config.h"
  58. #include "~/my_private_config.h"
  59. #endif
  60. #else
  61. /*
  62. ** The examples use WiFi configuration that you can set via project
  63. ** configuration menu
  64. **
  65. ** If you'd rather not, just change the below entries to strings with
  66. ** the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid"
  67. */
  68. #ifdef CONFIG_ESP_WIFI_SSID
  69. #define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID
  70. #else
  71. /* See new esp-sdk-lib.h helpers: */
  72. #ifndef EXAMPLE_ESP_WIFI_SSID
  73. #define EXAMPLE_ESP_WIFI_SSID "MYSSID_WIFI_CONNECT"
  74. #endif
  75. #endif
  76. #ifdef CONFIG_ESP_WIFI_PASSWORD
  77. #define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD
  78. #else
  79. /* See new esp-sdk-lib.h helpers: */
  80. #ifndef EXAMPLE_ESP_WIFI_PASS
  81. #define EXAMPLE_ESP_WIFI_PASS "MYPASSWORD_WIFI_CONNECT"
  82. #endif
  83. #endif
  84. #endif
  85. /* ESP lwip */
  86. #define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
  87. int wifi_init_sta(void);
  88. int wifi_show_ip(void);
  89. #endif /* _WIFI_CONNECT_H_ */