Skip to content

Commit

Permalink
Renames identifiers related to global event queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Veijo Pesonen committed Oct 26, 2018
1 parent c8a4b6c commit 1375c89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ESP8266Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ESP8266Interface::ESP8266Interface()
_started(false),
_conn_stat(NSAPI_STATUS_DISCONNECTED),
_conn_stat_cb(NULL),
_geq(NULL),
_global_event_queue(NULL),
_oob_event_id(0)
{
memset(_cbs, 0, sizeof(_cbs));
Expand All @@ -79,7 +79,7 @@ ESP8266Interface::ESP8266Interface(PinName tx, PinName rx, bool debug, PinName r
_started(false),
_conn_stat(NSAPI_STATUS_DISCONNECTED),
_conn_stat_cb(NULL),
_geq(NULL),
_global_event_queue(NULL),
_oob_event_id(0)
{
memset(_cbs, 0, sizeof(_cbs));
Expand All @@ -99,7 +99,7 @@ ESP8266Interface::ESP8266Interface(PinName tx, PinName rx, bool debug, PinName r
ESP8266Interface::~ESP8266Interface()
{
if (_oob_event_id) {
_geq->cancel(_oob_event_id);
_global_event_queue->cancel(_oob_event_id);
}
}

Expand All @@ -118,10 +118,10 @@ int ESP8266Interface::connect(const char *ssid, const char *pass, nsapi_security
return connect();
}

void ESP8266Interface::_oob2geq()
void ESP8266Interface::_oob2global_event_queue()
{
_geq = mbed_event_queue();
_oob_event_id = _geq->call_every(ESP8266_RECV_TIMEOUT, callback(this, &ESP8266Interface::proc_oob_evnt));
_global_event_queue = mbed_event_queue();
_oob_event_id = _global_event_queue->call_every(ESP8266_RECV_TIMEOUT, callback(this, &ESP8266Interface::proc_oob_evnt));

if (!_oob_event_id) {
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
Expand Down Expand Up @@ -149,7 +149,7 @@ int ESP8266Interface::connect()
}

if (!_oob_event_id) {
_oob2geq();
_oob2global_event_queue();
}

if(get_ip_address()) {
Expand Down Expand Up @@ -655,7 +655,7 @@ void ESP8266Interface::update_conn_state_cb()
default:
_started = false;
_initialized = false;
_geq->cancel(_oob_event_id);
_global_event_queue->cancel(_oob_event_id);
_oob_event_id = 0;
_conn_stat = NSAPI_STATUS_DISCONNECTED;
}
Expand Down
4 changes: 2 additions & 2 deletions ESP8266Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface

// Background OOB processing
// Use global EventQueue
events::EventQueue *_geq;
events::EventQueue *_global_event_queue;
int _oob_event_id;
void proc_oob_evnt();
void _oob2geq();
void _oob2global_event_queue();
};

#endif

0 comments on commit 1375c89

Please sign in to comment.