Merge branch 'cellular_fsm' of ssh://github.com/marcemmers/mbed-os into rollup

pull/8686/head
Cruz Monrreal II 2018-11-08 13:24:20 -06:00
commit 6ebc5be0f0
1 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,11 @@ void CellularConnectionFSM::stop()
_queue_thread = NULL; _queue_thread = NULL;
} }
if (_at_queue) {
_at_queue->chain(NULL);
_at_queue = NULL;
}
if (_power) { if (_power) {
_cellularDevice->close_power(); _cellularDevice->close_power();
_power = NULL; _power = NULL;
@ -131,6 +136,10 @@ nsapi_error_t CellularConnectionFSM::init()
} }
_at_queue = _cellularDevice->get_queue(); _at_queue = _cellularDevice->get_queue();
if (!_at_queue) {
stop();
return NSAPI_ERROR_NO_MEMORY;
}
_at_queue->chain(&_queue); _at_queue->chain(&_queue);
_retry_count = 0; _retry_count = 0;