46
46
ESP8266Interface::ESP8266Interface ()
47
47
: _esp(MBED_CONF_ESP8266_TX, MBED_CONF_ESP8266_RX, MBED_CONF_ESP8266_DEBUG, MBED_CONF_ESP8266_RTS, MBED_CONF_ESP8266_CTS),
48
48
_initialized(false ),
49
- _started(false )
49
+ _started(false ),
50
+ _ap_sec(NSAPI_SECURITY_UNKNOWN)
50
51
{
51
52
memset (_ids, 0 , sizeof (_ids));
52
53
memset (_cbs, 0 , sizeof (_cbs));
53
54
memset (ap_ssid, 0 , sizeof (ap_ssid));
54
55
memset (ap_pass, 0 , sizeof (ap_pass));
55
56
memset (_local_ports, 0 , sizeof (_local_ports));
56
- ap_sec = NSAPI_SECURITY_UNKNOWN;
57
57
58
58
_esp.sigio (this , &ESP8266Interface::event);
59
59
_esp.set_timeout ();
@@ -65,14 +65,14 @@ ESP8266Interface::ESP8266Interface()
65
65
ESP8266Interface::ESP8266Interface (PinName tx, PinName rx, bool debug, PinName rts, PinName cts)
66
66
: _esp(tx, rx, debug, rts, cts),
67
67
_initialized(false ),
68
- _started(false )
68
+ _started(false ),
69
+ _ap_sec(NSAPI_SECURITY_UNKNOWN)
69
70
{
70
71
memset (_ids, 0 , sizeof (_ids));
71
72
memset (_cbs, 0 , sizeof (_cbs));
72
73
memset (ap_ssid, 0 , sizeof (ap_ssid));
73
74
memset (ap_pass, 0 , sizeof (ap_pass));
74
75
memset (_local_ports, 0 , sizeof (_local_ports));
75
- ap_sec = NSAPI_SECURITY_UNKNOWN;
76
76
77
77
_esp.sigio (this , &ESP8266Interface::event);
78
78
_esp.set_timeout ();
@@ -102,7 +102,7 @@ int ESP8266Interface::connect()
102
102
return NSAPI_ERROR_NO_SSID;
103
103
}
104
104
105
- if (ap_sec != NSAPI_SECURITY_NONE) {
105
+ if (_ap_sec != NSAPI_SECURITY_NONE) {
106
106
if (strlen (ap_pass) < ESP8266_PASSPHRASE_MIN_LENGTH) {
107
107
return NSAPI_ERROR_PARAMETER;
108
108
}
@@ -141,7 +141,7 @@ int ESP8266Interface::connect()
141
141
142
142
int ESP8266Interface::set_credentials (const char *ssid, const char *pass, nsapi_security_t security)
143
143
{
144
- ap_sec = security;
144
+ _ap_sec = security;
145
145
146
146
if (!ssid) {
147
147
return NSAPI_ERROR_PARAMETER;
@@ -157,7 +157,7 @@ int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_
157
157
return NSAPI_ERROR_PARAMETER;
158
158
}
159
159
160
- if (ap_sec != NSAPI_SECURITY_NONE) {
160
+ if (_ap_sec != NSAPI_SECURITY_NONE) {
161
161
162
162
if (!pass) {
163
163
return NSAPI_ERROR_PARAMETER;
0 commit comments