Skip to content

Commit ceed8ee

Browse files
author
Jarno Lamsa
committed
Skip local up status and add notice to the header
1 parent 31f09f1 commit ceed8ee

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ESP8266/ESP8266.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,16 +576,15 @@ void ESP8266::_connection_status_handler()
576576
{
577577
char status[13];
578578
if (_parser.recv("%12[^\"]\n", status)) {
579-
if (strcmp(status, "CONNECTED\n") == 0)
580-
_connection_status = NSAPI_STATUS_LOCAL_UP;
581-
else if (strcmp(status, "GOT IP\n") == 0)
579+
if (strcmp(status, "GOT IP\n") == 0)
582580
_connection_status = NSAPI_STATUS_GLOBAL_UP;
583-
else //DISCONNECTED or unknown
581+
else if (strcmp(status, "DISCONNECT\n") == 0)
584582
_connection_status = NSAPI_STATUS_DISCONNECTED;
583+
else
584+
return;
585585

586586
if(_connection_status_cb)
587587
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connection_status);
588-
589588
}
590589
}
591590

ESP8266Interface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
187187
* on the network. The parameters on the callback are the event type and
188188
* event-type dependent reason parameter.
189189
*
190+
* In ESP8266 the callback will be called when processing OOB-messages via
191+
* AT-parser. Do NOT call any ESP8266Interface -functions or do extensive
192+
* processing in the callback.
193+
*
190194
* @param status_cb The callback for status changes
191195
*/
192196
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);

0 commit comments

Comments
 (0)