forked from wolfSSL/wolfssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwifi_connect.h
More file actions
139 lines (127 loc) · 5.28 KB
/
wifi_connect.h
File metadata and controls
139 lines (127 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* wifi_connect.h
*
* Copyright (C) 2006-2026 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef _WIFI_CONNECT_H_
#define _WIFI_CONNECT_H_
/* ESP lwip */
#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
#define TLS_SMP_WIFI_SSID CONFIG_WIFI_SSID
#define TLS_SMP_WIFI_PASS CONFIG_WIFI_PASSWORD
#define USE_WIFI_EXAMPLE
#ifdef USE_WIFI_EXAMPLE
#include "esp_netif.h"
#include "protocol_examples_common.h" /* see project CMakeLists.txt */
#endif
/**
******************************************************************************
******************************************************************************
** USER APPLICATION SETTINGS BEGIN
******************************************************************************
******************************************************************************
**/
/* when using a private config with plain text passwords,
* file my_private_config.h should be excluded from git updates */
/* #define USE_MY_PRIVATE_CONFIG */
/* Note that IntelliSense may not work properly in the next section for the
* Espressif SDK 3.4 on the ESP8266. Macros should still be defined.
* See the project-level Makefile. Example found in:
* https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples/template
*
* The USE_MY_PRIVATE_[OS]_CONFIG is typically an environment variable that
* triggers the make (not cmake) to add compiler defines.
*/
#if defined(USE_MY_PRIVATE_WINDOWS_CONFIG)
#include "/workspace/my_private_config.h"
#elif defined(USE_MY_PRIVATE_WSL_CONFIG)
#include "/mnt/c/workspace/my_private_config.h"
#elif defined(USE_MY_PRIVATE_LINUX_CONFIG)
#include "~/workspace/my_private_config.h"
#elif defined(USE_MY_PRIVATE_MAC_CONFIG)
#include "~/Documents/my_private_config.h"
#elif defined(USE_MY_PRIVATE_CONFIG)
/* This section works best with cmake & non-environment variable setting */
#if defined(WOLFSSL_CMAKE_SYSTEM_NAME_WINDOWS)
#define WOLFSSL_CMAKE
#include "/workspace/my_private_config.h"
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_WINDOWS)
#define WOLFSSL_MAKE
#include "/workspace/my_private_config.h"
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_WSL)
#define WOLFSSL_CMAKE
#include "/mnt/c/workspace/my_private_config.h"
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_WSL)
#define WOLFSSL_MAKE
#include "/mnt/c/workspace/my_private_config.h"
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_LINUX)
#define WOLFSSL_CMAKE
#include "~/workspace/my_private_config.h"
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_LINUX)
#define WOLFSSL_MAKE
#include "~/workspace/my_private_config.h"
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_APPLE)
#include "~/Documents/my_private_config.h"
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_APPLE)
#define WOLFSSL_MAKE
#include "~/Documents/my_private_config.h"
#elif defined(OS_WINDOWS)
#include "/workspace/my_private_config.h"
#else
/* Edit as needed for your private config: */
#warning "default private config using /workspace/my_private_config.h"
#include "/workspace/my_private_config.h"
#endif
#else
/*
** The examples use WiFi configuration that you can set via project
** configuration menu
**
** If you'd rather not, just change the below entries to strings with
** the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid"
*/
#if defined(CONFIG_ESP_WIFI_SSID)
/* tyically from ESP32 with ESP-IDF v4 to v5 */
#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID
#elif defined(CONFIG_EXAMPLE_WIFI_SSID)
/* typically from ESP8266 rtos-sdk/v3.4 */
#define EXAMPLE_ESP_WIFI_SSID CONFIG_EXAMPLE_WIFI_SSID
#else
/* See new esp-sdk-lib.h helpers: */
#ifndef EXAMPLE_ESP_WIFI_SSID
#define EXAMPLE_ESP_WIFI_SSID "MYSSID_WIFI_CONNECT"
#endif
#endif
#if defined(CONFIG_ESP_WIFI_PASSWORD)
/* tyically from ESP32 with ESP-IDF v4 or v5 */
#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD
#elif defined(CONFIG_EXAMPLE_WIFI_SSID)
/* typically from ESP8266 rtos-sdk/v3.4 */
#define EXAMPLE_ESP_WIFI_PASS CONFIG_EXAMPLE_WIFI_PASSWORD
#else
/* See new esp-sdk-lib.h helpers: */
#ifndef EXAMPLE_ESP_WIFI_PASS
#define EXAMPLE_ESP_WIFI_PASS "MYPASSWORD_WIFI_CONNECT"
#endif
#endif
#endif
/* ESP lwip */
#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
int wifi_init_sta(void);
int wifi_show_ip(void);
#endif /* _WIFI_CONNECT_H_ */