mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: Fix ATHandler set/restore_at_timeout with mutex lock
parent
31da50e8fa
commit
d48adcce2c
|
|
@ -272,6 +272,7 @@ nsapi_error_t ATHandler::unlock_return_error()
|
|||
|
||||
void ATHandler::set_at_timeout(uint32_t timeout_milliseconds, bool default_timeout)
|
||||
{
|
||||
lock();
|
||||
if (default_timeout) {
|
||||
_previous_at_timeout = timeout_milliseconds;
|
||||
_at_timeout = timeout_milliseconds;
|
||||
|
|
@ -279,13 +280,16 @@ void ATHandler::set_at_timeout(uint32_t timeout_milliseconds, bool default_timeo
|
|||
_previous_at_timeout = _at_timeout;
|
||||
_at_timeout = timeout_milliseconds;
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
|
||||
void ATHandler::restore_at_timeout()
|
||||
{
|
||||
lock();
|
||||
if (_previous_at_timeout != _at_timeout) {
|
||||
_at_timeout = _previous_at_timeout;
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
|
||||
void ATHandler::process_oob()
|
||||
|
|
|
|||
Loading…
Reference in New Issue