`ESP8266Interface::connect()` and `ESP8266Interface::disconnect()` can be used in terms of asynchronous operations. Mainly, it is based on newly added private variable of type `esp_connection_software_status` which is used to keep tracking of state of connection.`wifi_connect_nonblock` test was renamed and amended to test both `connect()` and `disconnect()` operation
In custom wiring, there can be a power pin to power on/off the modem. This
commit supports it and allows for the following configurations:
- power pin name
- power pin polarity
- power on/off delay time
The ESP chip returns timeout, but keeps trying to connect, so we want to
keep track of time ourselves, instead of relying on the chip's timeout.
This fixes failing WIFI-CONNECT-SECURE-FAIL test.
ESP8266Interface::connect() checks the exact return value from
the underlying ESP8266::connect() call.
Increased timeout for network-wifi greentea tests to 6 minutes.
As part of the ESP8266 connect sequence, ESP8266Interface::connect,
a software reset is performed. If the ESP8266 had been connected
previously then the ESP8266 will sometimes send a "WIFI DISCONNECT" OOB
message before performing the software reset. This causes the
ESP8266::_oob_connection_status to change its state (_conn_status) from
NSAPI_STATUS_DISCONNECTED to NSAPI_STATUS_CONNECTING. This causes
ESP8266Interface::_startup, called later in the boot seqeunce, to skip
ESP8266::startup. Without this call socket mux mode (CIPMUX=1) is never
enabled and all send commands using this format fail with a "Link Type"
error.
This patch fixes that problem by unconditionally calling
ESP8266::startup as part of the ESP8266 connect sequence.
"ns_types.h" results in build failure when networking feature is ignored with
.mbedignored. ESP8266 component should be enabled only when NSAPI is present.