AT_CellularDevice.cpp - unused variable err warning

We get this compiler warning;

Compile [  7.9%]: AT_CellularDevice.cpp
[Warning] AT_CellularDevice.cpp@206,18: variable 'err' set but not used [-Wunused-but-set-variable]

Due to the fact, that the code that would actually use this variable
is behind trace flags. Based on review feedback from Antti Kauppila and
Kimmo Väisänen, adding same flagging also for that.
- Reason being - the operation needs to be within the locks.
pull/11598/head
Janne Kiiskila 2019-09-30 14:43:34 +03:00
parent 1319843042
commit 55f6518853
1 changed files with 2 additions and 0 deletions

View File

@ -203,7 +203,9 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state)
_at->flush();
nsapi_error_t error = _at->at_cmd_str("+CPIN", "?", simstr, sizeof(simstr));
ssize_t len = strlen(simstr);
#if MBED_CONF_MBED_TRACE_ENABLE
device_err_t err = _at->get_last_device_error();
#endif
_at->unlock();
if (len != -1) {