Skip to content

Commit eb9c688

Browse files
ESP8266 disconnect returns ERROR_NO_CONNECTION
1 parent 52822cb commit eb9c688

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ int ESP8266Interface::set_channel(uint8_t channel)
222222

223223
int ESP8266Interface::disconnect()
224224
{
225+
if (_conn_stat == NSAPI_STATUS_DISCONNECTED)
226+
{
227+
return NSAPI_ERROR_NO_CONNECTION;
228+
}
229+
225230
int ret = _esp.disconnect() ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
226231

227232
if (ret == NSAPI_ERROR_OK) {

0 commit comments

Comments
 (0)