Skip to content

Commit 1fc7c18

Browse files
author
Janne Kiiskila
committed
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. Moving the definition to be behind that same flag resolves the issue.
1 parent 1319843 commit 1fc7c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/cellular/framework/AT/AT_CellularDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state)
203203
_at->flush();
204204
nsapi_error_t error = _at->at_cmd_str("+CPIN", "?", simstr, sizeof(simstr));
205205
ssize_t len = strlen(simstr);
206-
device_err_t err = _at->get_last_device_error();
207206
_at->unlock();
208207

209208
if (len != -1) {
@@ -230,6 +229,7 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state)
230229
tr_error("SIM PUK required");
231230
break;
232231
case SimStateUnknown:
232+
device_err_t err = _at->get_last_device_error();
233233
if (err.errType == DeviceErrorTypeErrorCME && err.errCode == 14) {
234234
tr_info("SIM busy");
235235
} else {

0 commit comments

Comments
 (0)