@@ -125,7 +125,7 @@ int ESP8266Interface::connect(const char *ssid, const char *pass, nsapi_security
125
125
126
126
void ESP8266Interface::start_bg_oob ()
127
127
{
128
- static const uint32_t _stack_sz = 2048 ;
128
+ static const uint32_t _stack_sz = 1536 ;
129
129
130
130
if (!_oob_thr_sta) {
131
131
_oob_thr_sta = (unsigned char *) (malloc (_stack_sz));
@@ -139,17 +139,20 @@ void ESP8266Interface::start_bg_oob()
139
139
_oob_thr = new Thread (osPriorityNormal,
140
140
_stack_sz,
141
141
_oob_thr_sta,
142
- " oob_proc " );
142
+ " esp8266_oob " );
143
143
}
144
-
145
144
if (!_oob_thr) {
146
145
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_THREAD_CREATE_FAILED), \
147
- " ESP8266::start_bg_oob: no thread" );
146
+ " ESP8266::start_bg_oob: thread creation failed " );
148
147
}
149
148
150
149
if (_oob_thr->get_state () == rtos::Thread::Deleted) {
151
150
_oob_thr_run = true ;
152
- _oob_thr->start (callback (this , &ESP8266Interface::bg_process_oob));
151
+ osStatus status = _oob_thr->start (callback (this , &ESP8266Interface::thr_process_oob));
152
+ if (status != osOK) {
153
+ MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_THREAD_CREATE_FAILED), \
154
+ " ESP8266::start_bg_oob: thread start failed" );
155
+ }
153
156
}
154
157
}
155
158
@@ -661,7 +664,6 @@ void ESP8266Interface::update_conn_state_cb()
661
664
// Start from scratch if connection drops/is dropped
662
665
case NSAPI_STATUS_DISCONNECTED:
663
666
_started = false ;
664
- _initialized = false ;
665
667
break ;
666
668
// Handled on AT layer
667
669
case NSAPI_STATUS_LOCAL_UP:
@@ -676,7 +678,7 @@ void ESP8266Interface::update_conn_state_cb()
676
678
}
677
679
}
678
680
679
- void ESP8266Interface::bg_process_oob ()
681
+ void ESP8266Interface::thr_process_oob ()
680
682
{
681
683
while (_oob_thr_run) {
682
684
if (_initialized) {
0 commit comments